0
Turn on/off a schedule
One script reply has been approved by the moderators Verified

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

Created by admin 588 days ago Viewed 2525 times
0
Submitted by admin Deno
Verified 588 days ago
1
import * as wmill from "https://deno.land/x/windmill@v1.85.0/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