A loan-approval orchestration in Durable Functions must pause until an underwriter records a decision, which can take several days. If no decision arrives before a deadline, the workflow should escalate. Which pattern fits?
Show answer and explanation
Answer: B
The human interaction pattern uses WaitForExternalEvent so the orchestration pauses until an external event, such as an underwriter's decision, is raised. Pairing that wait with a durable timer through Task.WhenAny gives the workflow a deadline, so it can escalate if the decision does not arrive in time. While it waits, the orchestration's state is checkpointed and holds no compute, which makes multi-day waits practical.
Why the other options are wrong
- A. Fan-out/fan-in runs many activities in parallel and gathers their results. It has no built-in way to pause for a person's reply, so it does not fit a multi-day wait for a decision.
- C. The async request-reply pattern lets a client check progress, but the waiting happens on the client side. It does not model an orchestration that is itself waiting on an external decision.
- D. The monitor pattern repeatedly checks status on a timer. It works, but each check runs code and adds cost, whereas a waiting orchestrator pauses without active executions.