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
| Expression | Meaning |
|---|---|
0 9 * * * | Every day at 09:00 |
*/15 * * * * | Every 15 minutes |
0 9 * * MON-FRI | Weekdays at 09:00 |
0 8 * * 1-5 | Same 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-FRI | Every hour 09:00-17:00 weekdays |
*/5 9-17 * * MON-FRI | Every 5 min during business hours |
Operators
| Operator | Meaning | Example |
|---|---|---|
* | any value | * * * * * = every minute |
, | list | 1,15,30 * * * * = at :01, :15, :30 of every hour |
- | range | 9-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
| Pitfall | Example | Fix |
|---|---|---|
| Day-of-week 7 vs 0 for Sunday | 0 9 * * 7 | Use 0 or SUN for portability |
| Step on a non-uniform field | 0 0 */5 * * doesn't fire every 5 days reliably | Avoid / on day-of-month; use an every: interval instead |
| 12am vs 12pm confusion | 0 12 * * * | Cron is 24h: 0=midnight, 12=noon |
| Both day-of-month and day-of-week set | 0 9 1 * MON fires on the 1st OR Monday | Use one or the other; don't combine unless you mean OR |
| TZ not set, daemon on UTC server | Schedule fires 4-8h "early" | Start the daemon with TZ set to your zone |
See also
- overview.md — scheduling overview
- dry-run.md — verify before enabling
- daemon-mode.md — running schedules continuously