Skip to main content

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

#EntityStorage purposeOwnership / relationshipTenant field/filterKey constraints and indexesLifecycle
1WorkflowDefinitionAuthored process rootOwns versions; cascadeNumeric tenant; filteredPK; unique tenant/keyDraft and Published data
2WorkflowVersionImmutable-after-publication snapshotChild of definition; owns steps/conditions; cascadeNumeric tenant; filteredPK; unique definition/versionDraft then published
3WorkflowStepStage/approver specificationChild of version; cascadeNumeric tenant; filteredPK; version/order indexRebuilt in drafts
4WorkflowConditionStage condition specificationChild of version; cascadeNumeric tenant; filteredPK; version FK indexRebuilt in drafts
5WorkflowInstanceRunning/terminal process rootOwns tasks/actions; definition/version scalar refsNumeric tenant; filteredPK; tenant/status; tenant/keyRunning to terminal
6WorkflowTaskAssignment and decisionChild of instance; cascadeNumeric tenant; filteredPK; instance; tenant/status/user/rolePending to decision; delegation stays Pending
7WorkflowActionInstance/task action historyChild of instance; cascade; task scalar refNumeric tenant; filteredPK; instance indexApplication append-only
8WorkflowAuditLogActor/action audit trailIndependent operational recordNumeric tenant; filteredPK; tenant/timeApplication append-only
9WorkflowTimelineLifecycle activity feedIndependent operational recordNumeric tenant; filteredPK; tenant/timeApplication append-only
10OutboxMessageIntegration-event delivery recordIndependent shared-kernel recordOptional envelope tenant; unfilteredPK; unique event; status/timePending/Failed/Processed
11ProcessedIntegrationEventConsumer idempotency ledger foundationIndependent operational recordOptional numeric tenant; unfilteredPK; unique eventNo 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.cs
  • microservices/src/workflow-service/Infrastructure/Migrations/20260706165438_InitialWorkflowSchema.cs
  • microservices/src/workflow-service/Infrastructure/Migrations/WorkflowDbContextModelSnapshot.cs

See Also

Keywords

Workflow database, EF Core, Workflow schema.

Revision Information

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