A Microsoft mérnöki elemzése 5 gyakorlati példán keresztül mutatja be a Durable Task keretrendszer használatát. A példák között szerepel a számla-jóváhagyás, az Azure-környezetek telepítése, az előfizetői fizetési kísérletek, a híreket feldolgozó CMS-rendszerek és az AI-alapú incidenskezelő ügynökök. A keretrendszer abban segít, hogy a hosszan tartó vagy megszakadó folyamatok automatikusan ott folytatódjanak, ahol félbeszakadtak.
A cikk kiemeli, hogy a Durable Task nem csodaszer: nyomon követi a folyamat állapotát, de nem garantálja a külső rendszerek pontosan egyszeri végrehajtását. A nem determinisztikus műveleteket, mint az AI-modellhívások, mindig el kell különíteni az orchestrációs logikától.
A fejlesztők a Durable Task .NET SDK v1.26.0 verzióját használhatják a DTS ütemezővel. A beszámoló előrevetíti a készülő Durable Agents és Durable Workflows kiegészítőket is a Microsoft Agent Frameworkhöz.
Az eredeti szöveg (.NET Blog (daily.dev))
Five practical examples of when durable execution makes sense, when it doesn’t, and what it means for AI agents.
Durable Task raises an important question:
This all looks interesting, but what are the actual use cases?
Not how Durable Task works. Not what happens during replay or how the scheduler persists state. But the more practical question: what problems does it actually solve?
When should I reach for durable execution instead of regular C#, a queue, a database, or a background worker? And when would adding it just make things more complicated?
Those are fair questions. Rather than walk through another hello world orchestration, I want to look at real situations where things get messy, especially when work takes a long time, depends on external systems, or gets interrupted halfway through. I also want to be clear about what Durable Task does not solve for you.
Imagine a background worker creating a customer’s Azure environment. It provisions a network, starts a database deployment, creates storage, and deploys an application. Then the worker disappears. Azure might still be working, but your local variables and continuations are gone. Restarting the method is easy. Figuring out which operations completed and which are safe to repeat is the hard part.
Of course, you could build your own solution with a database, a queue, an outbox, scheduled jobs, and reconciliation logic. Sometimes that’s exactly what you should do. But once you find yourself building a whole system just to remember what happens next and how to resume it, durable orchestration starts to get interesting.
I’ll walk through five examples: invoice approvals, Azure tenant provisioning, subscription payments, breaking news articles arriving through out of order webhooks, and an AI agent investigating an incident. We’ll use the standalone Durable Task .NET SDK v1.26.0 with Durable Task Scheduler (DTS), and I’ll show both the useful parts and the responsibilities that still belong to our application.
A note on the examples: The snippets below are deliberately focused on orchestration boundaries. Application adapters, DTO definitions, registrations, and some helper implementations are omitted. They illustrate the design rather than constituting a compiled, tested sample. In particular, do not infer exactly-once external effects from durable history.
Each example has the same boundary: Durable Task coordinates part of the process, while the application remains authoritative for the external result.
Consider an invoice-processing service. It extracts a document, validates the result, and either posts the invoice, rejects it, or asks a human to review it. A batch may contain eight invoices, only one of which needs approval. The other seven shouldn’t wait for it.
Here’s an ordinary C# implementation of the individual processing path:
There’s nothing inherently unreliable about this method. OpenInvoiceReviewAsync can persist a review ticket and notification outbox. But when someone approves the invoice tomorrow, another handler must load the right document generation, check the deadline, recover the approved payload, and continue. If the worker dies between extraction and validation, the application must decide whether to extract again or retrieve the saved result.
That continuation protocol is what Durable Task can express directly.
A bounded batch can start independent child orchestrations:
Eight is an application admission limit, not a DTS quota. Larger batches can be paged and subject to tenant/global concurrency limits. A child that completes can post its invoice while another child remains suspended awaiting review. Task.WhenAll waits for every child; it does not undo a sibling’s accounting entry if another child fails.
Inside the invoice child, extraction and validation are activities. Once their successful results are recorded in orchestration history, a compatible replay follows the same code path using those recorded results instead of repeat