Bound recovery before adding retries
How retry policies, error handlers, timeouts, and externally persisted circuit-breaker state prevent cascading failures and select fallback paths. · advanced
A failed Task first goes through its matching Retry policy. Step Functions scans retriers in order and uses the first matching one. Only when retries are unavailable or exhausted does it scan Catch handlers in order. Put specific errors before broad matches; States.ALL must appear alone and last in its array. Retry transient failures, not invalid requests or authorization failures.
MaxAttempts counts retries after the initial attempt. IntervalSeconds and BackoffRate control increasing delays; MaxDelaySeconds caps them, and JitterStrategy: FULL randomizes each delay within its calculated range. Bound attempts and delays together: synchronized retries can otherwise multiply pressure on an unhealthy dependency. Coordinate SDK retries with workflow retries rather than multiplying both layers unknowingly.
A Task's TimeoutSeconds bounds each attempt, not the entire retry sequence. Explicitly handle States.Timeout: States.TaskFailed does not match it. An execution-level timeout is a final boundary, not an internal fallback trigger. A Task timeout also does not guarantee that downstream work stopped; use stable request identifiers and idempotent side effects because an apparently failed attempt may still finish.
| Control | Bounds | Does not guarantee |
|---|---|---|
| Task timeout | One attempt's wait | Remote work stopped |
| Retry policy | Additional attempts and delays | Shared outage suppression |
| Catch handler | Recovery routing | Recovery always succeeds |
| Execution timeout | Whole execution lifetime | Internal fallback runs |
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.