Workflow DbContext Inventory
Audience
Backend engineers, database engineers, QA, support and architects.
Summary
Exactly one runtime DbContext is implemented: WorkflowDbContext.
Reference Content
| Context | Purpose | DbSets | Tenant filtering | Save behavior | Audit behavior | Source |
|---|---|---|---|---|---|---|
WorkflowDbContext | Own Workflow canonical and operational persistence | 11 | Global filters on definitions, versions, steps, conditions, instances, tasks, actions, audit and timeline; administrative bypass | Maps supported aggregate domain events to outbox, then delegates to EF Core save | Audit/timeline rows are staged by adapters in the same context | microservices/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.csmicroservices/src/workflow-service/Infrastructure/Persistence.csmicroservices/src/workflow-service/Program.cs
Related Articles
See Also
Keywords
Workflow database, EF Core, Workflow schema.
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Next review: 2026-10-20