.NET | Durable Task SDK
Demonstrates sub-orchestrations using the Durable Task SDK. A parent orchestration processes an order by delegating each line item to a child orchestration, which handles validation, pricing, and inventory reservation independently.
This pattern is useful for:
- Breaking complex workflows into smaller, reusable pieces
- Processing collections where each item has multi-step logic
- Isolating failure domains within a larger workflow
- .NET 8 SDK
- Docker (for the emulator)
-
Start the Durable Task Scheduler emulator:
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
-
Start the worker (in one terminal):
cd Worker dotnet run -
Start the client (in another terminal):
cd Client dotnet run -
View the orchestration hierarchy in the dashboard: http://localhost:8082
- The parent orchestration receives an order with multiple line items
- For each line item, it calls a child orchestration as a sub-orchestration
- Each child orchestration runs independently: validates the item, calculates the price, and reserves inventory
- The parent collects all results and returns the complete order summary
- If any child fails, the parent can handle the error gracefully