Schedules are for scheduling Workflows to be run at specific times in the future.
In this sample, a reminder Workflow (src/workflows.ts
) is scheduled to run every 10 seconds with:
npm run schedule.start
:src/start-schedule.ts
You can see each Workflow Execution in the UI:
You can interact with the running Schedule using these scripts:
npm run schedule.go-faster
:src/go-faster.ts
npm run schedule.pause
:src/pause-schedule.ts
npm run schedule.unpause
:src/unpause-schedule.ts
npm run schedule.delete
:src/delete-schedule.ts
temporal server start-dev
to start Temporal Server.npm install
to install dependencies.npm run start.watch
to start the Worker.- In another shell,
npm run schedule.start
to start the Schedule.
It should output:
Started schedule 'sample-schedule'.
The reminder Workflow will run and log from the Worker every 10 seconds.
You can now run:
npm run schedule.go-faster
npm run schedule.pause
npm run schedule.unpause
npm run schedule.delete