Skip to main content

Workflow State Management

Summary

State transitions are encoded as aggregate methods and command guards. No state-machine package or declarative transition table is used.

State transitions

Guards

Definition publication requires a draft with steps. Task decisions require a Running instance and Pending task. These guards provide duplicate-decision protection.

Recorded but unreachable states

Definition Archived, instance Cancelled, task Delegated/Skipped and action Cancel are enum values without complete transition paths in commands and aggregates.

Consistency boundary

Aggregate changes, action records, audit/timeline rows and newly mapped outbox messages are saved through one DbContext unit of work.

Limitations

No explicit concurrency token protects competing requests. Rejection can leave sibling tasks Pending. Skipped stages create no state record.

Requires Confirmation

Concurrency policy, cancellation, archival, sibling-task finalization and skipped-stage audit semantics require confirmation.

Source References

  • microservices/src/workflow-service/Domain/Common/Enums.cs
  • microservices/src/workflow-service/Domain/Workflow/WorkflowDefinition.cs
  • microservices/src/workflow-service/Domain/Workflow/WorkflowInstance.cs
  • microservices/src/workflow-service/Application/Commands/WorkflowInstanceCommands.cs

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