How to Automatically Retry Timeout Errors in AWS Step Functions?
A developer is building a serverless application on AWS for a workflow that processes high volumes of data. In the workflow, an AWS Step Functions state machine invokes several AWS Lambda functions. One of the Lambda functions occasionally fails because of timeout errors during periods of high demand. The developer must ensure that the workflow automatically retries the failed function invocation if a timeout error occurs. Which solution will meet this requirement?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
Tests native Step Functions error-handling capabilities, with the common trap being confusion between execution time limits and explicit retry policy configurations.
This question evaluates native error handling and automatic retry mechanisms in AWS Step Functions when invoking Lambda functions. The community unanimously agrees that configuring the Retry field within the Task state definition is the correct and most efficient approach.
Option B is frequently selected by mistake because it mentions both 'Timeout' and 'retry attempts,' but the TimeoutSeconds field only defines the maximum wait time before a state fails and does not trigger automatic retries without a dedicated Retry block.
Community Discussion (6 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
AWS Step Functions natively supports fault tolerance through the Retry field in Task state definitions. By specifying ErrorEquals with States.Timeout alongside MaxAttempts, IntervalSeconds, and BackoffRate, the orchestrator automatically catches timeout exceptions and re-invokes the Lambda function according to the defined exponential backoff policy. This directly satisfies the requirement for automatic retry handling during high-demand periods.Why the Other Options Are Wrong
Option B incorrectly associates the Timeout field with retry logic; TimeoutSeconds merely caps execution duration before triggering a failure, it does not configure recovery attempts. Option C introduces a Fail state, which explicitly halts the workflow and transitions it to a terminal state rather than attempting recovery. Option D unnecessarily routes requests through Amazon SNS, adding architectural complexity and latency while shifting retry responsibility away from Step Functions' native workflow engine.Community Comment Notes
Multiple candidates verified that AWS documentation explicitly recommends using the Retry array in Task states for automated error recovery [1][4]. Contributors shared exact JSON templates demonstrating the proper syntax, emphasizing that States.Timeout must be matched in the ErrorEquals array to capture these specific failures [3]. The overwhelming consensus confirms that native state machine configuration eliminates the need for external messaging services like SNS for basic retry requirements [2][5].Official Reference
Exam Strategy
Memorize the native error-handling fields (Retry and Catch) available for each Step Functions state type, as they are heavily tested in DVA-C02 scenario questions. Always distinguish between execution time limits (TimeoutSeconds) and failure recovery logic (Retry), since exam writers deliberately pair these terms to assess your grasp of state machine mechanics.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →