Workflow steps now expose retry attempt number via step context
Key Points
- Step context exposes retry attempt number
- 1-indexed attempt numbering system
- Enables progressive backoff and conditional logic
Summary
Cloudflare Workflows now provides access to the current retry attempt number through the step context in step.do() calls. This enhancement enables better observability and conditional logic based on retry attempts.
Key Points
- Step context now includes
ctx.attemptproperty indicating current retry attempt - Attempt numbering is 1-indexed (first try = 1, first retry = 2, etc.)
- Use cases include improved logging, progressive backoff strategies, and conditional workflow logic
- Available in TypeScript with
await step.do("my-step", async (ctx) => { console.log(Attempt ${ctx.attempt}); })