DVA-C03 practice question: Orchestration with Step Functions
Development with AWS Services A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.
If the call still fails after these retries, the workflow must go to a state named NotifyFailure, and that state must receive the original order input as well as the error.
What should the developer add?
Choose one answer.
AA. A Catch with ErrorEquals LabelServiceUnavailable, ResultPath set to $.error, and Next set to NotifyFailure.
BB. A second Retry entry with ErrorEquals States.ALL, and a Next field that names NotifyFailure.
CC. A Catch with ErrorEquals LabelServiceUnavailable and Next set to NotifyFailure, with no ResultPath.
DD. An on-failure destination on the Lambda function that names NotifyFailure as the target state.
B. Wrong: Retry entries have no Next field. Only a Catch can move the execution to another state.
C. Wrong: This reaches the right state, but the default ResultPath of $ overwrites the whole input with the error output.
D. Wrong: Lambda destinations apply to asynchronous invocations and cannot target a state inside a workflow. The Task state calls the function synchronously.
Explanation
Step Functions tries the Retry first and uses a Catch only when retries are exhausted. A Catch needs ErrorEquals and Next. Its default ResultPath is $, which overwrites the input with the error, so a path such as $.error keeps the original input and adds the error to it.
Want more on Orchestration with Step Functions? The 5 full-length practice sets have 6 more Orchestration with Step Functions questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →