aws timeout_error ai_generated true

States.Timeout: The state/task exceeded the maximum duration

ID: aws/aws-step-functions-timeout

Also available as: JSON · Markdown
82%Fix Rate
85%Confidence
55Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Step Functions state or execution exceeded its configured timeout, stopping the workflow.

generic

Workarounds

  1. 85% success Add a Retry policy with exponential backoff for transient failures
    Add Retry block with States.Timeout error type, IntervalSeconds, MaxAttempts, BackoffRate in the state definition

    Sources: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html

  2. 82% success Optimize the underlying task (Lambda, ECS, etc.) or split into smaller steps
    Profile the slow task, break long operations into parallel Map states or sequential smaller tasks

    Sources: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html

Dead Ends

Common approaches that don't work:

  1. Remove the TimeoutSeconds to have no timeout 70% fail

    Without a timeout, stuck executions run forever and incur costs; default execution timeout is 1 year

  2. Set very large timeout values to avoid the error 65% fail

    Masks the underlying performance issue and leads to long-running expensive executions

Error Chain

Frequently confused with: