Request a demo
Docs / Apps & scheduling / Cron syntax reference

Cron syntax reference

InsightWorker schedules use standard 5-field cron expressions, parsed by cron-parser.

Format

┌─── minute (0–59)
│ ┌─── hour (0–23)
│ │ ┌─── day of month (1–31)
│ │ │ ┌─── month (1–12 or JAN–DEC)
│ │ │ │ ┌─── day of week (0–6, Sun–Sat, or SUN–SAT)
│ │ │ │ │
* * * * *

Common patterns

ExpressionMeaning
0 9 * * *Every day at 09:00
*/15 * * * *Every 15 minutes
0 9 * * MON-FRIWeekdays at 09:00
0 8 * * 1-5Same as above (numeric weekdays)
0 9,17 * * *09:00 and 17:00 every day
0 9 1 * *First of every month at 09:00
0 0 1 1 *Once a year at midnight Jan 1
30 * * * *Every hour at :30
0 9-17 * * MON-FRIEvery hour 09:00-17:00 weekdays
*/5 9-17 * * MON-FRIEvery 5 min during business hours

Operators

OperatorMeaningExample
*any value* * * * * = every minute
,list1,15,30 * * * * = at :01, :15, :30 of every hour
-range9-17 = 9 through 17
/step*/15 = every 15 (units of the field)

Time zones

Cron expressions are evaluated in the local time zone of the machine running the daemon, or in the zone named by the TZ environment variable. There is no per-schedule time zone setting.

# <workspace>/.insightworker/schedules.yaml
schedules:
  - name: morning-digest
    cron: "0 9 * * MON-FRI"
    prompt: "Summarise the active sprint and write reports/digest.md."

If the daemon machine and your team are in different time zones, start the daemon with TZ set, for example TZ=America/New_York insightworker --daemon.

Verifying

An invalid expression is reported, and the schedule skipped, when the file is loaded:

insightworker schedule list

There is no command that prints upcoming fire times. Once the daemon is running, its once-a-minute status line shows the next fire time for each schedule. To test what a schedule does, rather than when, run it once by hand — see Dry-run.

Common pitfalls

PitfallExampleFix
Day-of-week 7 vs 0 for Sunday0 9 * * 7Use 0 or SUN for portability
Step on a non-uniform field0 0 */5 * * doesn't fire every 5 days reliablyAvoid / on day-of-month; use an every: interval instead
12am vs 12pm confusion0 12 * * *Cron is 24h: 0=midnight, 12=noon
Both day-of-month and day-of-week set0 9 1 * MON fires on the 1st OR MondayUse one or the other; don't combine unless you mean OR
TZ not set, daemon on UTC serverSchedule fires 4-8h "early"Start the daemon with TZ set to your zone

See also