Choosing Queues, Cron, or Workflows
Select Cloudflare async primitives by separating buffered messages, scheduled triggers, and durable multi-step execution.
Edited and verified by Orange Book Editorial Team ·
Fast choice
Use Queues to buffer producers and consumers, Cron for a UTC schedule, and Workflows for durable steps, retries, and waits.
| Need | Start with | Questions to answer |
|---|---|---|
| Accept now, consume later | Queues | Are duplicates safe, how do retries end, where do failures go? |
| Run on a schedule | Cron Trigger | Is UTC conversion correct and is execution idempotent? |
| Coordinate a long multi-step job | Workflows | Which steps can replay, and how are state and compensation handled? |
“Async” does not mean automatically reliable
Design consumers with at-least-once delivery in mind: assign an idempotency key, check whether work already completed, and treat downstream timeouts as ordinary branches. A Cron scheduled() handler triggers work; it does not persist a long-running process for you.
Acceptance checklist
- Deliver one message twice and still produce one business result.
- Force a downstream 500 and observe retry and alert behavior.
- Verify the UTC schedule instead of guessing from local time.
- Record maximum backlog, processing time, and manual replay procedure.
- Add compensation or human confirmation around irreversible side effects.
Primary sources
Did this page help you complete your goal?
Beta feedback is generated in this browser and is never uploaded automatically.
Bindings, environments, and secrets
Separate resource bindings, plain variables, and secrets while avoiding non-inherited environment configuration.
External database integrations: D1, Hyperdrive, or the official driver
Before connecting an external database from Workers, decide whether D1 is enough, then choose between Hyperdrive pooled TCP and the database's official HTTP driver.