references/cron-triggers/patterns.md
Cron Triggers Patterns
Choose the execution boundary before writing a scheduled job; fetch the relevant integration docs for implementation.
| Need | Documentation | | --- | --- | | Periodic API sync, cleanup, reports, or health checks in a Worker | Cron Triggers background and scheduled handler | | Different jobs on different schedules | Handle multiple cron triggers | | Durable multi-step work started on a schedule | Trigger Workflows | | Send work to a queue and implement its consumer | Queues JavaScript APIs | | Coordinate state across invocations | What are Durable Objects? | | Inspect whether scheduled work ran | View past events |
Keep the trigger separate from the business operation so manual recovery and scheduled execution can share it. Decide how partial progress is recorded, how repeated attempts affect side effects, and who owns completion reporting. When distributing a batch, distinguish successful enqueueing from successful processing.
Use Workers limits to evaluate whether the job fits one invocation. If it needs durable steps, waiting, or explicit retry boundaries, inspect Workflows before building those mechanisms in the handler.
See api.md for tests and gotchas.md for operational checks.