Workflows are messier than they look on a whiteboard. Some steps depend on others, some wait on approvals, some can run in parallel, and when one fails halfway through you don’t want to start over.
Azure Durable Functions is built for this. It ships with a set of named patterns, each aimed at a specific kind of workflow problem. My team used four of them to build a document processing engine that handles several document types. Here is what each one looked like in practice.
Function chaining
Our engine validates a document, preprocesses it, then processes it. After each stage succeeds, function chaining saves progress. If processing fails, we resume from there and skip validation, because we already know the document passed.
Use it when the steps are distinct and ordered, and repeating finished work would be wasteful or risky.
Fan-out/fan-in
A document is made of pages, so we process them in parallel (fan-out/fan-in) and combine the results once they have all finished. This is much faster than going one page after another, and the more pages a document has, the more parallelism you get.
The monitor pattern
In our engine, the output of one document type feeds the processing of another. Once an XML document’s results were saved to the database, the PDF orchestration needed them. Using the monitor pattern, it checked the database periodically and carried on once they appeared. That keeps the two workflows loosely coupled. Nothing tells the PDF orchestration the results are ready, so it has to look.
The human interaction pattern
When a document failed a validation check, we didn’t reject it outright. The workflow paused and waited for a person to approve or reject it, then acted on their answer. With the human interaction pattern, the orchestration stays idle until that signal arrives. It is the same idea as an expense system, where a manager approves or rejects a refund request and the workflow continues or stops accordingly.
Signals can get lost to transient errors, so an event sometimes fails to be raised. To make this reliable we added a periodic database check as a fallback, which is the monitor pattern again. The workflow can then recover even if the event never arrives.
Performance
Once the patterns were in place, we tuned how many activities and orchestrators could run concurrently, which batch sizes worked best, and how the infrastructure scaled out under load. Throughput scaled roughly linearly: triple the resources, triple the output. That is not guaranteed in every system, but it held here.
It also tripled the bill. Past a certain point the limit is cost rather than technology.
Would I use it again?
Yes, when the workflow has real complexity: dependent steps, parallel work that needs coordinating, a human decision in the middle, or external systems to wait on. For a simple job it would be overkill.
The four patterns here (function chaining, fan-out/fan-in, monitor and human interaction) are the ones Microsoft documents as the durable application patterns. Task hubs, error handling and retries, and versioning of long-running workflows are worth a separate post.