Workflow Repository Architecture
Summary
Two Domain repository interfaces support aggregate writes and execution loads. EF Core implementations are registered as scoped services.
Definition repository
The contract supports identifier lookup, eager loading of versions/steps/conditions, published-key lookup, tenant/key existence checks, add and query access.
Instance repository
The contract supports instance loading with tasks/actions, task-to-instance loading, add and query access for instances and tasks.
Loading behavior
Definition execution loads the full version graph. Task decisions load the owning instance with all tasks and actions. Global tenant filters apply to each mapped entity.
Read-side boundary
WorkflowQueries reads directly from WorkflowDbContext; the definition detail endpoint uses a small loader wrapper over the definition repository.
Limitations
No specifications, pagination repository, cache, distributed lock, explicit concurrency behavior or separate read repository exists. Exposed IQueryable members weaken strict repository encapsulation.
Requires Confirmation
Repository abstraction goals, caching and concurrency ownership require confirmation.
Source References
microservices/src/workflow-service/Domain/Repositories.csmicroservices/src/workflow-service/Infrastructure/Persistence.csmicroservices/src/workflow-service/Application/Queries/WorkflowQueries.cs
Related Articles
See Also
Keywords
Workflow architecture, approval engine, Workflow Service, technical foundation.
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Next review: 2026-10-20