0

Turn on/off a schedule

by
Published Aug 19, 2022

Set the state of a Windmill schedule to be turned on or off

Script windmill Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 6 days ago
1
//native
2

3
import * as wmill from "windmill-client@1";
4

5
export async function main(schedule_path: string, enabled: boolean) {
6
  const conf = wmill.createConf();
7
  const schedule_api = new wmill.ScheduleApi(conf);
8
  return await schedule_api.setScheduleEnabled(
9
    conf.workspace_id,
10
    schedule_path,
11
    {
12
      enabled,
13
    }
14
  );
15
}
16

Other submissions
  • Submitted by admin Deno
    Created 398 days ago
    1
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    2
    
    
    3
    export async function main(schedule_path: string, enabled: boolean) {
    4
      const conf = wmill.createConf();
    5
      const schedule_api = new wmill.ScheduleApi(conf);
    6
      return await schedule_api.setScheduleEnabled(
    7
        conf.workspace_id,
    8
        schedule_path,
    9
        {
    10
          enabled,
    11
        }
    12
      );
    13
    }
    14