Workflow scheduling
Workflow scheduling#
The Workflow Service scheduling system organizes and manages schedules as sub-resources under workflow definitions. Each workflow definition can have one or more schedules, which determine when and how workflow instances are triggered for execution.
Schedules are typically defined using cron expressions for flexible and precise time-based automation. The service provides RESTful APIs to create, get, update, and delete schedules associated with a specific workflow definition.
This hierarchical structure ensures that all scheduling logic is tightly coupled to the lifecycle and context of the workflow definition. This enables robust orchestration, easy management, and clear traceability of automated workflow executions within the platform.
Workflow scheduling concepts#
| Term | Description |
|---|---|
| Schedule | Create a Schedule to define when a workflow runs. For more information, see Schedule. |
| Job | A job represents the executable unit tied to a specific workflow definition. Each schedule results in the creation of a job in the scheduler. |
| Trigger | A trigger determine the precise timing and recurrence of job execution. One or more triggers are associated with each job. Triggers use cron expressions to specify intervals (for example, every hour, every Monday at 9.00 AM) and can be managed independently. This allows for flexible scheduling and rescheduling of workflow runs. |
Schedule#
Create a Schedule to define when a workflow runs based on the schedule type, a run interval cron expression, and a timezone parameter:
Schedule definition example
{ "_namespaces": ["default"], "_schedule": { "_type": "TIME_BASED", "_runInterval": "0 0/5 * ? * * *", // Every 5 minutes "_timeZone": "UTC" }, "_inputParams":{ "param1": "test" }}| Parameter | Type | Description |
|---|---|---|
_namespaces | Array of String | An array of namespaces you want to add the Schedule to |
_schedule | Object | An object with your type, run interval, and timezone parameters |
_type | String | Defines the Schedule type. Enter "TIME_BASED" |
_runInterval | String | Enter a cron expression |
_timeZone | String | Enter a timezone, such as "UTC". |
_inputParams | Object | An object that contains your parameter names and values in key-balue pairs |
Cron expressions#
To define a cron expression for the _runInterval parameter, adhere to the guidelines in the following table:
Cron expression values
| Field | Required | Allowed values |
|---|---|---|
| Seconds | Yes | 0-59 |
| Minutes | Yes | 0-59 |
| Hours | Yes | 0-23 |
| Day of Month | Yes | 1–31 |
| Month | Yes | 1–12 or JAN–DEC |
| Day of Week | Yes | 1–7 or SUN–SAT |
| Year | No | empty, 1970–2099 |
For example, the following run interval cron expression commands the schedule to run on July 16th 2025 at 02:06:00:
0 06 02 16 7 ? 2025
For a detailed breakdown, see the following table:
Cron expression values
| Field | Value | Runs on/at |
|---|---|---|
| Seconds | 0 | 0 seconds on the hour |
| Minutes | 06 | 6 minutes past the hour |
| Hours | 02 | 2 AM |
| Day of Month | 16 | 16th day of the month |
| Month | 7 | July, 7th month of the year |
| Day of Week | ? | ignored |
| Year | 2025 | 2025 |
See the following common examples that you can copy and modify:
| Expression | Meaning |
|---|---|
| 0 0 12 * * ? | Run at 12pm (noon) every day |
| 0 15 10 ? * * | Run at 10:15am every day |
| 0 15 10 * * ? | Run at 10:15am every day |
| 0 15 10 * ? | Run at 10:15am every day |
| 0 15 10 * * ? 2005 | Run at 10:15am every day during the year 2005 |
| 0 14 * ? | Run every minute starting at 2pm and ending at 2:59pm, every day |
| 0 0/5 14 * * ? | Run every 5 minutes starting at 2pm and ending at 2:55pm, every day |
| 0 0/5 14,18 * * ? | Run every 5 minutes starting at 2pm and ending at 2:55pm, AND Run every 5 minutes starting at 6pm and ending at 6:55pm, every day |
| 0 0-5 14 * * ? | Run every minute starting at 2pm and ending at 2:05pm, every day |
| 0 10,44 14 ? 3 WED | Run at 2:10pm and at 2:44pm every Wednesday in the month of March. |
| 0 15 10 ? * MON-FRI | Run at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
| 0 15 10 15 * ? | Run at 10:15am on the 15th day of every month |
| 0 15 10 L * ? | Run at 10:15am on the last day of every month |
| 0 15 10 L-2 * ? | Run at 10:15am on the 2nd-to-last last day of every month |
| 0 15 10 ? * 6L | Run at 10:15am on the last Friday of every month |
| 0 15 10 ? * 6L | Run at 10:15am on the last Friday of every month |
| 0 15 10 ? * 6L 2002-2005 | Run at 10:15am on every last Friday of every month during the years 2002, 2003, 2004 and 2005 |
| 0 15 10 ? * 6#3 | Run at 10:15am on the third Friday of every month |
| 0 0 12 1/5 * ? | Run at 12pm (noon) every 5 days every month, starting on the first day of the month. |
| 0 11 11 11 11 ? | Run every November 11th at 11:11am. |