Cron syntax
The exact expression format Work on Repeat accepts, and how it is evaluated.
Schedules are five-field cron expressions evaluated in the routine's IANA timezone.
Fields
┌───────────── minute 0–59
│ ┌─────────── hour 0–23
│ │ ┌───────── day of month 1–31
│ │ │ ┌─────── month 1–12
│ │ │ │ ┌───── day of week 0–6 (Sunday = 0)
│ │ │ │ │
* * * * *Exactly five fields are required. Expressions are validated on save, and one
that cannot produce a future occurrence is rejected with
400 invalid_schedule.
Accepted characters
| Character | Meaning | Example |
|---|---|---|
* | Every value | * * * * * |
, | List | 0 9 * * 1,3,5 |
- | Range | 0 9 * * 1-5 |
/ | Step | */15 * * * * |
L | Last | 0 9 L * * |
# | Nth weekday of the month | 0 9 * * 1#2 |
? | No specific value | 0 9 ? * 1 |
Named months and weekdays (JAN, MON) are not accepted. Neither are
six-field expressions with seconds, nor shorthand such as @daily or
@weekly.
Field length is capped at 120 characters for the whole expression.
Common schedules
| Expression | Fires |
|---|---|
0 9 * * 1 | 09:00 every Monday |
0 9 * * 1-5 | 09:00 on weekdays |
30 7 * * * | 07:30 every day |
0 */6 * * * | Every six hours, on the hour |
*/15 * * * * | Every fifteen minutes |
0 9 1 * * | 09:00 on the first of the month |
0 9 L * * | 09:00 on the last day of the month |
0 9 1 1,4,7,10 * | 09:00 on the first day of each quarter |
0 11 * * 1,3,5 | 11:00 on Monday, Wednesday, and Friday |
0 9 * * 1#2 | 09:00 on the second Monday of the month |
Evaluation
The next occurrence is computed in the routine's timezone, not converted from UTC afterwards. A 09:00 schedule stays at 09:00 through daylight-saving transitions.
Two consequences are worth planning around:
- Times inside the hour skipped by a spring-forward transition do not exist on
that date. Avoid
02:00–03:00in zones that shift there. - Times inside a repeated fall-back hour exist twice on the local clock. The scheduler advances past an occurrence once claimed, so the routine runs once.
Where the timing is contractual, set the timezone to UTC.
Resolution
The operations tick runs once a minute, so a routine fires within a minute of its occurrence rather than at the exact second. Schedules finer than one minute are not meaningful.