Skip to main content

Workflow Indexes and Constraints

Audience

Backend engineers, database engineers, QA and architects.

Summary

The model defines primary keys for all 11 entities, three explicit unique business/event constraints and indexes for ownership, worklists, lifecycle and chronological reads.

Reference Content

EntityVerified indexes/constraints
DefinitionPrimary key; unique tenant/key
VersionPrimary key; unique definition/version number
StepPrimary key; version/order index
ConditionPrimary key; version foreign-key index
InstancePrimary key; tenant/status; tenant/key
TaskPrimary key; instance foreign-key index; tenant/status/user; tenant/status/role
ActionPrimary key; instance index
AuditPrimary key; tenant/occurrence
TimelinePrimary key; tenant/occurrence
OutboxPrimary key; unique event identifier; status/occurrence
Processed eventPrimary key; unique event identifier

Constraint boundaries

Required fields, maximum text lengths and cascade foreign keys are enforced by the migration. No check constraints, filtered indexes or concurrency constraints were found.

Requires Confirmation

Index effectiveness under production volume, additional subject/definition lookups and check constraints 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