Course menuDOP-C02

Exams / DOP-C02 / Automation with Lambda and Step Functions / Question 1

DOP-C02 practice question: Automation with Lambda and Step Functions

Configuration Management and IaC A free question from our original DOP-C02 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 logistics company automates the onboarding of new warehouse robots. Each onboarding runs about 90 minutes and calls several internal systems, and it must pause until a site engineer approves the robot's configuration in the company's ticketing system.

The workflow must not run a step twice if it is retried, and the operations team needs to see the status and history of each onboarding in the console for at least 60 days after it finishes. Today a single Lambda function is triggered by a queue and polls the ticketing system every minute, which makes the process hard to follow.

The company wants the approval to resume the workflow when the engineer responds, with the least custom polling code.

Which design meets these requirements?

Choose one answer.

  1. A. Run the onboarding in an AWS Step Functions Express workflow that calls the ticketing system and waits for the approval by polling a status endpoint in a loop.
  2. B. Keep the queue-triggered Lambda function, and have it write its progress to an Amazon DynamoDB table so the team can query each onboarding, with the polling interval reduced to 10 seconds.
  3. C. Run the onboarding as a Standard Step Functions workflow that pauses at a callback task with a task token, and resumes when the engineer's response calls SendTaskSuccess.
  4. D. Use an Amazon EventBridge Scheduler schedule that starts the onboarding Lambda function every minute, and have the function check the ticketing system for an approval before it continues.
Show the answer and explanation

Answer: C

  • A. Wrong: Express workflows can run for at most five minutes, so a 90-minute onboarding cannot finish in one, and they do not keep execution history in the Step Functions console. Polling in a loop is also the custom code the company wanted to remove. Learn more: Choosing workflow type in Step Functions (opens in a new tab)
  • B. Wrong: The team would still build and run the polling and the state tracking itself. Retries could also repeat steps, since the function has no built-in record of which steps completed.
  • C. Right: Correct. Standard workflows can run for up to a year and keep their execution history for 90 days after they close, and a callback task with a task token pauses without polling until the approval returns. Standard workflows also provide exactly-once workflow execution. Learn more: Choosing workflow type in Step Functions (opens in a new tab)
  • D. Wrong: A schedule that starts a function every minute keeps the polling loop in place and adds more invocations. It still has no built-in execution history or pause and resume for the approval. Learn more: Invoke a Lambda function on a schedule (opens in a new tab)

Explanation

A Standard Step Functions workflow can run for the full 90 minutes, keeps its execution history for 90 days after it closes, and can pause at a callback task that waits for a task token. The engineer's response resumes the workflow with SendTaskSuccess, so no polling code is needed. Express workflows are limited to five minutes, and polling functions and scheduled checks keep the polling and lack the history.

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 Automation with Lambda and Step Functions? The 5 full-length practice sets have 5 more Automation with Lambda and Step Functions questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets