Course menuDVA-C03

Exams / DVA-C03 / Orchestration with Step Functions / Question 1

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.

Last verified against current AWS documentation ·How we write our questions

A shipping workflow in AWS Step Functions has a Task state that calls a label-printing Lambda function.

The function sometimes raises a custom error called LabelServiceUnavailable. The state has this Retry field:

"Retry": [{ "ErrorEquals": ["LabelServiceUnavailable"], "IntervalSeconds": 2, "MaxAttempts": 3, "BackoffRate": 2 }]

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.

  1. A. A Catch with ErrorEquals LabelServiceUnavailable, ResultPath set to $.error, and Next set to NotifyFailure.
  2. B. A second Retry entry with ErrorEquals States.ALL, and a Next field that names NotifyFailure.
  3. C. A Catch with ErrorEquals LabelServiceUnavailable and Next set to NotifyFailure, with no ResultPath.
  4. D. An on-failure destination on the Lambda function that names NotifyFailure as the target state.
Show the answer and explanation

Answer: A

  • A. Right: Correct. Catch runs once the retries are used up, Next sends the execution to NotifyFailure, and ResultPath adds the error to the input rather than replacing it. Learn more: Handling errors in Step Functions workflows (opens in a new tab)
  • 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.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

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