Workflow Database Schema Reference
Audience
Backend engineers, database engineers, QA, support, security reviewers and architects.
Summary
This is the authoritative schema inventory. It contains exactly 11 mapped entities, each listed once.
Reference Content
| # | Entity | Storage purpose | Ownership / relationship | Tenant field/filter | Key constraints and indexes | Lifecycle |
|---|---|---|---|---|---|---|
| 1 | WorkflowDefinition | Authored process root | Owns versions; cascade | Numeric tenant; filtered | PK; unique tenant/key | Draft and Published data |
| 2 | WorkflowVersion | Immutable-after-publication snapshot | Child of definition; owns steps/conditions; cascade | Numeric tenant; filtered | PK; unique definition/version | Draft then published |
| 3 | WorkflowStep | Stage/approver specification | Child of version; cascade | Numeric tenant; filtered | PK; version/order index | Rebuilt in drafts |
| 4 | WorkflowCondition | Stage condition specification | Child of version; cascade | Numeric tenant; filtered | PK; version FK index | Rebuilt in drafts |
| 5 | WorkflowInstance | Running/terminal process root | Owns tasks/actions; definition/version scalar refs | Numeric tenant; filtered | PK; tenant/status; tenant/key | Running to terminal |
| 6 | WorkflowTask | Assignment and decision | Child of instance; cascade | Numeric tenant; filtered | PK; instance; tenant/status/user/role | Pending to decision; delegation stays Pending |
| 7 | WorkflowAction | Instance/task action history | Child of instance; cascade; task scalar ref | Numeric tenant; filtered | PK; instance index | Application append-only |
| 8 | WorkflowAuditLog | Actor/action audit trail | Independent operational record | Numeric tenant; filtered | PK; tenant/time | Application append-only |
| 9 | WorkflowTimeline | Lifecycle activity feed | Independent operational record | Numeric tenant; filtered | PK; tenant/time | Application append-only |
| 10 | OutboxMessage | Integration-event delivery record | Independent shared-kernel record | Optional envelope tenant; unfiltered | PK; unique event; status/time | Pending/Failed/Processed |
| 11 | ProcessedIntegrationEvent | Consumer idempotency ledger foundation | Independent operational record | Optional numeric tenant; unfiltered | PK; unique event | No active writer found |
Scope
This reference documents mappings, not live database contents. No database connection or migration execution was performed.
Requires Confirmation
Production schema drift, row counts, grants, partitioning, retention and ownership require confirmation.
Source References
microservices/src/workflow-service/Infrastructure/WorkflowDbContext.csmicroservices/src/workflow-service/Infrastructure/Migrations/20260706165438_InitialWorkflowSchema.csmicroservices/src/workflow-service/Infrastructure/Migrations/WorkflowDbContextModelSnapshot.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