Enterprise reference implementation of distributed workflow patterns in .NET.
Distributed systems become challenging when multiple independent components need to coordinate reliable execution.
This project demonstrates reusable distributed workflow patterns instead of application-specific business logic.
The repository does not implement scenarios such as:
- Order Processing
- Payment
- Reservation
- Shopping Cart
Instead, it provides architectural building blocks for:
- Workflow orchestration
- Saga Pattern
- Message-driven communication
- Compensation
- Retry strategies
- Correlation
- Technology-independent messaging
RabbitMQ is the first transport implementation. The architecture is designed to allow future integration with Kafka, Azure Service Bus, or MassTransit without changing the core workflow engine.
The solution follows Clean Architecture principles.
API
|
v
Application
/ \
v v
Domain BuildingBlocks
|
v
Infrastructure
Dependency direction always moves toward the core.
Infrastructure contains implementation details.
Domain contains workflow concepts without infrastructure dependencies.
DistributedWorkflowPatterns
src/
├── DistributedWorkflowPatterns.Api
├── DistributedWorkflowPatterns.Application
├── DistributedWorkflowPatterns.Domain
├── DistributedWorkflowPatterns.Infrastructure
├── DistributedWorkflowPatterns.Contracts
└── DistributedWorkflowPatterns.BuildingBlocks
Contains the core workflow model:
- Workflow
- Workflow Step
- Workflow State
- Workflow Execution
- Workflow Compensation
No dependency on external technologies.
Responsible for workflow coordination:
- Workflow execution
- Saga orchestration
- Compensation handling
- Application use cases
Contains reusable abstractions:
- Messaging abstractions
- Correlation concepts
- Retry contracts
- Compensation contracts
Contains external implementations:
- RabbitMQ transport
- OpenTelemetry configuration
- External adapters
Contains shared communication contracts:
- Commands
- Events
- Message definitions
Implemented:
- Workflow Definition
- Workflow Steps
- Workflow State Management
- Workflow Execution Model
- Messaging Abstractions
- Saga Orchestration
- Compensation Strategy
- RabbitMQ Transport
- Retry Abstractions
- Saga Choreography Contracts
- OpenTelemetry Integration
- Persistence Contract
Not included:
- Database implementation
- Authentication
- Dashboard
- Docker/Kubernetes deployment
- Event Sourcing
Client
|
v
Workflow Definition
|
v
Workflow Coordinator
|
v
Execute Workflow Step
|
v
Publish Message
|
v
External Component
|
+------------+
| Success |
+------------+
|
v
Next Step
Failure:
Workflow Coordinator
|
v
Compensation Flow
|
v
Rollback Previous Steps
Coordinator
|
v
Execute Step A
|
v
Execute Step B
|
v
Failure Occurs
|
v
Compensate Previous Steps
The orchestrator manages:
- Workflow state
- Executed steps
- Failure handling
- Compensation execution
Completed:
- Solution structure
- Clean Architecture setup
- Domain modeling
Completed:
- IMessageBus abstraction
- Publisher/Subscriber contracts
- Message metadata concepts
Completed:
- RabbitMQ adapter
- Connection handling
- Message publishing and consuming
Completed:
- Workflow execution concepts
- Step management
- State transitions
Completed:
- Workflow coordination
- Saga execution flow
- Failure handling
Completed:
- Compensation contracts
- Recovery strategy
Completed:
- Retry abstractions
- Transient failure handling
Completed:
- Event contracts
- Command contracts
- Decoupled communication model
Completed:
- OpenTelemetry setup
- Trace instrumentation foundation
Completed:
- Persistence abstraction
- Future database provider support
The project follows:
- Clean Architecture
- Separation of Concerns
- Technology Independence
- Low Coupling
- High Cohesion
- Extensible Design
- Message-driven Architecture
- .NET 8
- ASP.NET Core
- C#
- Clean Architecture
- RabbitMQ
- OpenTelemetry
Current Version:
v1.0.0
Status:
✅ MVP Completed
The first version focuses on architecture and reusable distributed workflow patterns.
Future versions will add:
- Executable workflow examples
- Automated tests
- Database providers
- Additional messaging transports
- Monitoring capabilities
MIT License