Workflow Entity Mappings
Audience
Backend engineers, database engineers, QA and architects.
Summary
All 11 entity mappings are configured inline in WorkflowDbContext.OnModelCreating; no separate entity-configuration classes were found.
Reference Content
| Mapping concern | Verified behavior |
|---|---|
| Default schema | One Workflow-owned schema |
| Keys | GUID primary keys for all mapped entities |
| Domain identifiers | Application-generated and marked non-generated for aggregate/entity domain types |
| Required/optional fields | Configured with fluent required flags, CLR nullability and migration nullability |
| Text lengths | Explicit for business/operational text fields |
| Enum conversion | Eight enum properties convert to bounded strings |
| Structured JSON | Instance context, audit details, timeline metadata and outbox payload use structured JSON columns |
| Precision | No explicit decimal/date precision configuration |
| Defaults | CLR/domain initializers; no verified database default expressions |
| Delete behavior | Cascade for definition-version-step/condition and instance-task/action ownership |
| Ignored state | Aggregate domain-event collections are not persisted |
Limitations
Configuration is centralized in a large method. No mapping tests or database check constraints were found.
Requires Confirmation
Mapping modularization, database defaults and constraint hardening require confirmation.
Source References
microservices/src/workflow-service/Infrastructure/WorkflowDbContext.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