Modern distributed applications frequently execute long-running business processes that span multiple services, external APIs, message queues, and databases. Examples include order processing, payment workflows, document approval systems, data synchronization, and AI agent orchestration. These workflows must remain reliable even when individual services fail or infrastructure experiences temporary outages.
This is where durable execution frameworks become valuable. They provide mechanisms for checkpointing workflow state, retrying failed operations, recovering from crashes, and coordinating distributed processes without requiring developers to implement these capabilities manually.
In this article, you'll learn the core concepts of durable execution, compare popular approaches available to .NET developers, and understand how to choose the right framework for different distributed application scenarios.
Note: This article compares architectural approaches rather than ranking frameworks. The most appropriate choice depends on application requirements, operational constraints, and deployment environments.
What Is Durable Execution?
Durable execution allows a workflow to continue reliably despite failures.
Traditional execution:
Start
|
Step 1
|
Step 2
|
Application Crash
|
Workflow Lost
Durable execution:
Start
|
Step 1
|
Checkpoint
|
Step 2
|
Crash
|
Resume From Checkpoint
Instead of restarting from the beginning, the workflow resumes from its last persisted state.
Why Durable Workflows Matter
Many enterprise processes involve multiple systems.
Examples include:
Payment processing
Order fulfillment
Invoice generation
Employee onboarding
Document approval
AI agent workflows
Data import pipelines
These operations may run for several minutes—or even hours—and must survive application restarts and temporary infrastructure failures.
Typical Durable Architecture
A common workflow architecture looks like this:
Client
|
Workflow Engine
|
-------------------------
| Database |
| Message Broker |
| External Services |
-------------------------
The workflow engine coordinates execution while persisting state between steps.
Core Durable Execution Features
Most workflow frameworks provide:
| Feature | Purpose |
|---|---|
| State Persistence | Resume after failures |
| Automatic Retries | Recover from transient errors |
| Checkpointing | Save workflow progress |
| Scheduling | Delay future execution |
| Timeout Handling | Detect stalled operations |
| Compensation | Reverse completed actions |
| Monitoring | Observe workflow status |
These capabilities reduce the amount of custom reliability code developers need to write.
Common Durable Execution Approaches
Several approaches are available within the .NET ecosystem.
| Approach | Typical Use Case |
|---|---|
| Azure Durable Functions | Serverless workflows |
| Dapr Workflows | Cloud-native microservices |
| Temporal | Complex distributed workflows |
| Workflow Core | Self-hosted .NET applications |
| Custom State Machines | Simple business processes |
Each approach balances flexibility, operational complexity, and infrastructure requirements differently.
Azure Durable Functions
Azure Durable Functions extend Azure Functions with durable orchestration capabilities.
Typical architecture:
HTTP Request
|
Durable Function
|
Activities
|
Storage
Strengths include:
Serverless execution
Automatic checkpointing
Timer support
Event-driven workflows
This approach is particularly suitable for Azure-centric solutions.
Dapr Workflows
Dapr provides workflow capabilities for cloud-native applications.
Architecture:
Application
|
Dapr Sidecar
|
Workflow Runtime
Advantages include:
Platform independence
Microservice integration
Simplified service communication
Cloud portability
Applications remain relatively independent of specific cloud providers.
Temporal
Temporal is a workflow orchestration platform designed for highly reliable distributed systems.
Typical workflow:
Workflow
|
Activities
|
Persistent History
Temporal emphasizes durable execution, automatic retries, and long-running workflow management.
Workflow Core
Workflow Core is an open-source .NET workflow engine.
Example workflow:
Start
|
Approval
|
Notification
|
Finish
It is often used for business process automation inside self-hosted applications.
State Persistence
Workflow state should be stored outside application memory.
Workflow
|
Checkpoint
|
Database
Persistent storage enables workflow recovery after application restarts or infrastructure failures.
Retry Strategies
Transient failures should not immediately terminate workflows.
Typical retry flow:
Failure
|
Retry
|
Retry
|
Success
Retry policies should define:
Maximum attempts
Delay interval
Backoff strategy
Failure handling
Avoid infinite retry loops.
Compensation Workflows
Not every workflow can simply retry.
Example:
Create Order
|
Reserve Inventory
|
Payment Failed
|
Release Inventory
Compensation actions reverse completed steps when later operations fail.
This approach differs from traditional database rollbacks because multiple distributed systems may already have committed changes.
Example Workflow Service
A simplified abstraction:
public interface IWorkflowService
{
Task StartAsync(Guid workflowId);
Task ResumeAsync(Guid workflowId);
}
Join the conversation! Your thoughts help the community grow.