onSchedule starts independent runs from a five-field cron expression evaluated in UTC or a configured IANA time zone.
Example
automations/weekday-report.automation.ts
Options
onSchedule has one-minute precision and rejects six-field expressions with seconds.
Trigger data
onSchedule returns a Signal<ScheduleEvent> for each matching occurrence:
scheduledAt is the event’s scheduled minute. Use it instead of the automation’s wall-clock start time to identify delayed occurrences.
Delivery behavior
onSchedulevalidates its configuration during deployment.- IANA time zones follow local daylight-saving-time transitions.
- After a restart, the scheduler delivers every matching occurrence from the previous 60 minutes and skips older occurrences.
- The deployment active during catch-up receives those occurrences, including an occurrence whose
scheduledAtpredates that deployment. - Each occurrence starts an independent run. A later or recovered occurrence can run while an earlier one is still active.
onScheduledoesn’t prevent overlaps or enforce execution order. - Recovered occurrences count as ordinary runs.
- Retries for the same schedule and timestamp are deduplicated.