Workflow Transactions and Save Boundaries
Summary
Commands normally call one unit-of-work save after staging aggregate, audit and timeline changes. DbContext adds mapped outbox records immediately before that save.
Transaction boundary diagram
Command boundary
Definition and instance commands stage all normal changes before one save. No explicit transaction object or cross-context transaction is created.
Multi-save behavior
Outbox status updates each save independently after the original command. Development seeding saves each missing definition separately.
Failure handling
Definition commands translate domain validation before save. Workflow code does not define persistence retries or compensating transactions. Relay failures are represented through outbox status/error updates by the processing boundary.
Requires Confirmation
Database retry policy, atomicity expectations for relay status and seed partial-failure recovery require confirmation.
Source References
microservices/src/workflow-service/Infrastructure/WorkflowDbContext.csmicroservices/src/workflow-service/Infrastructure/Persistence.csmicroservices/src/workflow-service/Application/Commands/WorkflowInstanceCommands.csmicroservices/src/workflow-service/Infrastructure/DevelopmentSeeder.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