Skip to main content

Workflow Persistence Architecture

Summary

Commands load or create aggregates through repositories, stage audit/timeline records, then commit through one unit-of-work adapter. DbContext save maps queued domain events into outbox rows.

Workflow persistence lifecycle

Canonical boundary

Definitions own version graphs. Instances own task/action graphs. Repository includes restore the required graph before mutation.

Operational boundary

Audit/timeline rows are added by writer adapters. Outbox rows are generated from aggregate events. The hosted relay later marks outbox records processed or failed using additional saves.

Limitations

No explicit transaction wrapper, retry policy, distributed transaction, concurrency token or retention process is defined in Workflow code.

Requires Confirmation

Transaction retry, relay/save interleaving, cleanup and failure-recovery procedures require confirmation.

Source References

  • microservices/src/workflow-service/Infrastructure/WorkflowDbContext.cs
  • microservices/src/workflow-service/Infrastructure/Persistence.cs
  • microservices/src/workflow-service/Application/Commands/WorkflowInstanceCommands.cs

See Also

Keywords

Workflow database, EF Core, Workflow schema.

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-20
  • Next review: 2026-10-20