Skip to main content
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
This automation runs at 9:30 AM every Monday through Friday in Los Angeles local time.

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

  • onSchedule validates 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 scheduledAt predates that deployment.
  • Each occurrence starts an independent run. A later or recovered occurrence can run while an earlier one is still active. onSchedule doesn’t prevent overlaps or enforce execution order.
  • Recovered occurrences count as ordinary runs.
  • Retries for the same schedule and timestamp are deduplicated.