Skip to main content

Workflow DbContext Inventory

Audience

Backend engineers, database engineers, QA, support and architects.

Summary

Exactly one runtime DbContext is implemented: WorkflowDbContext.

Reference Content

ContextPurposeDbSetsTenant filteringSave behaviorAudit behaviorSource
WorkflowDbContextOwn Workflow canonical and operational persistence11Global filters on definitions, versions, steps, conditions, instances, tasks, actions, audit and timeline; administrative bypassMaps supported aggregate domain events to outbox, then delegates to EF Core saveAudit/timeline rows are staged by adapters in the same contextmicroservices/src/workflow-service/Infrastructure/WorkflowDbContext.cs

Runtime and design time

Runtime registration injects the HTTP tenant context. The design-time factory creates the same DbContext type with a null/super-administrator tenant adapter for migration tooling.

Limitations

No read-only context, separate outbox context, sharded tenant context or test context exists.

Requires Confirmation

Whether operational records should remain co-located and whether a separate read model is planned require confirmation.

Source References

  • microservices/src/workflow-service/Infrastructure/WorkflowDbContext.cs
  • microservices/src/workflow-service/Infrastructure/Persistence.cs
  • microservices/src/workflow-service/Program.cs

See Also

Keywords

Workflow database, EF Core, Workflow schema.

Revision Information

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