Workflow Engine Architecture
Summary
The verified engine is not a standalone class or runtime. It is the collaboration between WorkflowInstanceCommands, immutable published-version data and WorkflowInstance transition methods.
Engine responsibilities
The application command class selects a published version, serializes context, orders stages, evaluates conditions, resolves assignees, opens stages and decides when to advance or complete. The aggregate creates tasks, enforces task/instance transitions, records actions and raises domain events.
Stage model
Distinct step orders are processed in ascending order. Steps sharing an order create tasks together. A stage advances only when all its tasks are no longer Pending. Despite stored StepMode, the engine derives grouping only from step order.
Condition model
All conditions for a stage must pass. Comparisons are case-insensitive; ne and neq mean inequality and every other operator is treated as equality. Invalid stored context JSON becomes an empty dictionary.
Assignment model
User and manager approvers resolve to a user field; Role, HR and Admin resolve to a role field. Manager lookup uses two context names, then configured fallback data, then an unresolved placeholder.
Limitations
No executor registry, asynchronous step execution, transition table, expression language, notification-step behavior, rollback, compensation, timeout or cancellation engine exists.
Requires Confirmation
Future semantics for StepMode, notification steps, richer conditions and unresolved managers require confirmation.
Source References
microservices/src/workflow-service/Application/Commands/WorkflowInstanceCommands.csmicroservices/src/workflow-service/Domain/Workflow/WorkflowInstance.csmicroservices/src/workflow-service/Domain/Workflow/WorkflowDefinition.cs
Related Articles
See Also
Keywords
Workflow architecture, approval engine, Workflow Service, technical foundation.
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Next review: 2026-10-20