↑↓ to navigate Enter to open "…" all these words ANDOR to combine

Architecture Decision Record

ADR-086: A Process Manager Is Deferred, Not Absent (Relates to ADR-054)

Status

Accepted (2026-08-18) as a documented deferral. Nothing ships with this record: no state machine, no correlation store, no new package. What ships is the shape the coordinator would take, the constraint that limits the technology choice, and the single condition that would start the work. ADR-054 remains the accepted mechanism until then. Revised (2026-09-11): the first per-instance scheduled deadline now exists in MMCA.Store, built on ADR-114's internal-command queue rather than on a state machine, which retires one of the three absent properties without meeting this record's trigger; the deferral stands. See the Revision below. Revised 2026-10-07: the in-process provider is not MassTransit, so a state machine needs a broker provider (or a new in-process MassTransit registration) to ride, and the EF saga repository would then have been a fourth MassTransit package that the v8 pin gate covers only once its id is added; the deferral stands. Revised 2026-10-21: anchors refreshed after the 2026-10-07 change to DependencyVersionTestsBase moved the pin gate's lines; the deferral stands. Revised 2026-10-26: the MassTransit pin now covers five v8 packages at 8.5.12 across four broker providers (RabbitMQ and PostgreSQL built in, Azure Service Bus and Amazon SQS as adapters), so the EF saga repository would be a sixth pinned package; the deferral stands. Revised 2026-10-28: the unpaid-order deadline is now armed by PlacedOrderFinalizer, shared by customer and guest checkout, and a second independent OrderCancelled handler schedules the cancellation notice; the deferral stands. Revised 2026-11-12: the deferral was revisited and is resolved for a flow whose state fits ONE aggregate, by the behaviour-only process-manager primitive of ADR-143 (no framework state table, no correlation store, no package; MMCA.Store's order flow is its first adopter). The MassTransit saga state machine below, its correlation store and its trigger remain deferred for workflow state that fits no aggregate. See the Revision below. Revised 2026-11-23: both unpaid-order arming sites now go through ProcessTimeoutScheduler.ArmAsync rather than a direct future-dated ScheduleAsync, and the order measures its payment window from a stored PaymentWindowStartedOn; anchors refreshed; the deferral stands.

Context

ADR-054 decided how this workspace achieves cross-boundary consistency without two-phase commit: choreography. Each step of a workflow raises a domain event, each compensating action is its own handler, idempotency is a marker committed by the same SaveChanges as the compensating writes, and a periodic reconciliation sweep is the saga-timeout backstop for a step that depends on an external system.

That record also states, precisely and without hedging, why choreography was correct for the one workflow it covers: Order.Status plus Order.InventoryRestored are the saga state, so an orchestrator would add a state machine and a persistence store to track what the aggregate already records. The rationale is conditional on the workflow, and the condition is not stated as permanent.

What ADR-054 does not answer is what happens to that reasoning when a workflow's state stops fitting on one aggregate in one database. Three properties of a multi-step workflow break the choreography argument. Two of them are still absent, and the third has since arrived on its own terms:

  • State that belongs to no aggregate. "Step 2 of 4 completed, step 3 awaiting a reply, deadline at 14:05" is workflow state, not order state. Choreography needs somewhere to put it, and today the answer is a status column on the aggregate that happens to have one.
  • A timeout that is not a poll. This one is no longer absent, and it arrived without a coordinator: since 2026-09-11 every unpaid order in MMCA.Store arms its own durable deadline on ADR-114's internal-command queue, and ADR-054's fixed-interval sweep (PaymentReconciliationService, a 10-minute interval and a 30-minute stuck age at the shipped defaults) is the backstop behind it rather than the mechanism. What is still absent is a workflow instance with several different waits, which is what would need either a sweep per wait or a coordinator that owns them all. See the Revision below.
  • Compensation that must unwind in order. ADR-054's compensating handlers are independent: cancel restores stock, a separate cancel handler schedules the cancellation notice, payment failure notifies the customer, and none depends on another having run. A four-step workflow that must undo steps 3, 2 and 1 in that order has an ordering requirement no set of independent handlers expresses.

Nothing in the four repositories has all three properties. A content sweep of the Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga and InMemorySagaRepository returns no match in any repo, which is the verifiable form of "no orchestrated workflow exists". PaymentReconciliationService in MMCA.Store's Sales module is still the only reconciliation sweep (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationService.cs:81). PeriodicBackgroundService has five production subclasses: that sweep (PaymentReconciliationService.cs:87) plus four MMCA.Common maintenance jobs (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Auth/RefreshSessionCleanupService.cs:53, .../Persistence/Auth/PermissionGrantRefreshService.cs:36, .../Persistence/InternalCommands/Administration/InternalCommandCleanupService.cs:46, .../Persistence/Outbox/Administration/OutboxCleanupService.cs:50), none of which coordinates a workflow.

Writing an orchestrator now would therefore be building the coordinator before the workflow. This record exists because the alternative failure mode is worse: the first genuine multi-step cross-service workflow arriving with no recorded design, and being answered with a fifth ad-hoc status column.

Decision

Defer the orchestrated process manager (a coordinator that owns workflow state outside any aggregate), and record its shape so the deferral is a design decision rather than an omission. A flow whose whole state fits on one aggregate is not deferred: that aggregate is the process, under the behaviour-only primitive of ADR-143, which adds no state row (MMCA.Common/Source/Core/MMCA.Common.Domain/ProcessManagers/ProcessManagerAggregateRoot.cs:10-11,17). Everything below describes the coordinator that stays deferred.

The shape it would take

A durable multi-step workflow coordinator in this workspace is a MassTransit v8 saga state machine, not a hand-rolled orchestrator and not a third-party workflow engine:

  • MassTransitStateMachine<TInstance> for the definition. The transport abstraction (ADR-066) is MassTransit for every broker provider (RabbitMQ and PostgreSQL built in, Azure Service Bus and Amazon SQS through adapter packages), so in a broker deployment the state machine rides the bus that already exists. The InProcess provider is not MassTransit: AddBrokerMessaging returns before AddMassTransit is ever called, and the bus is the hand-written InProcessMessageBus dispatching through IDomainEventDispatcher. A coordinator therefore needs a broker provider, or a MassTransit registration added for the in-process mode, before it has a bus to ride. Introducing a second coordination technology beside MassTransit would mean two retry models, two dead-letter destinations and two sets of transport configuration.
  • Durable correlation state per workflow instance. One row per running workflow, keyed by a CorrelationId, carrying the current state and whatever the workflow needs to remember between steps. It belongs in the owning service's own database (ADR-006), the same placement the outbox and the inbox already take, which keeps the coordinator inside one transactional boundary with the data it coordinates and adds no shared store to race on.
  • Timeouts as scheduled messages, not as a sweep. A state machine expresses a deadline per instance rather than as a periodic scan for stale rows. ADR-054's sweep cannot express that, but a state machine is no longer the only thing that can: Store schedules one deadline per unpaid order on ADR-114's internal-command queue, so a single wait against a single aggregate needs no coordinator. What a coordinator adds is several deadlines per workflow instance, each interpreted against instance state that lives nowhere else.
  • Compensation hooks folding into ADR-054's backstop, not replacing it. A state machine's compensating transitions would call the same guarded, Result-returning domain transitions ADR-054 already insists on ("the sweep gets no private path into the aggregate"). The reconciliation sweep stays underneath as the backstop for the case the coordinator itself cannot cover: an external system that never replies at all. Orchestration narrows what the sweep has to catch; it does not make an external provider reliable.

The constraint that shapes the technology choice

MassTransit is pinned to v8 and the pin is a build gate (ADR-016): MassTransit, MassTransit.RabbitMQ, MassTransit.Azure.ServiceBus.Core, MassTransit.AmazonSQS and MassTransit.SqlTransport.PostgreSQL are all held at 8.5.12 in MMCA.Common/Directory.Packages.props:188-190,193,199, because v9 requires a commercial license. The build gate checks a fixed list of exactly those five ids, so the EF saga repository the design needs would be a sixth MassTransit package, guarded only once its id is added. The design assumes the v8 saga state machine and its EF Core saga repository are sufficient, an assumption no source here exercises (no saga type and no MassTransit.EntityFrameworkCore version exists in any repo), so the pin is not known to block the design; what it blocks is assuming a future v9 feature, and it means the coordinator inherits the pin's own risk. If v8 stops receiving security fixes, a process manager built on it is inside the blast radius of that migration rather than beside it. That is a reason to build the coordinator when a workflow needs it, not in advance of one.

The trigger

Build it when the first real multi-step cross-service workflow appears: a workflow with at least three steps spanning at least two services, whose state does not fit on a single aggregate, and which needs at least one per-instance deadline. Until then ADR-054's compensating handlers plus the outbox's bounded retries and dead-lettering (ADR-003) are sufficient, and this record is the design the implementing PR starts from.

Rationale

  • Choreography is genuinely correct for the workflow that exists. This is not a case of the simpler option being tolerated. Checkout's saga state is two fields on Order, and an orchestrator would introduce a state row that duplicates them, with the two able to disagree. ADR-054's argument is sound and this record does not weaken it.
  • The coordinator is cheap to add and expensive to have prematurely. In a broker deployment a saga state machine is a class, a migration, one new package and a repository registration on a MassTransit bus that already exists; under the InProcess provider it also needs a MassTransit registration that does not exist today. What is expensive is the standing cost: a second persistence model, a second failure mode (a stuck instance that is neither running nor complete), and a second place to look during an incident. Nothing today earns that.
  • The design is the deliverable, not the code. The failure this record prevents is a fifth status column, not the absence of a state machine. Whoever meets the trigger inherits a technology choice, a placement, a licensing constraint and a relationship to ADR-054, which is most of the design work.
  • Naming the trigger keeps the deferral falsifiable. "We do not need one yet" is a claim that can be checked against a workflow inventory. Without the three-part test above it is a preference.
  • One coordination technology, chosen for the transport the broker providers already use. The InProcess provider has no MassTransit bus, so this holds for broker deployments; a monolith deployment adopting the coordinator takes on MassTransit either way. Reaching for a workflow engine outside the bus would add an operational dependency to two production deployments to solve a problem neither currently has.

Trade-offs

  • The first workflow to hit the trigger pays the full cost at once, under whatever deadline made it appear. Deferral moves the work onto the critical path of the feature that needs it, which is the standing cost of every deferral and is recorded rather than mitigated.
  • The trigger relies on someone recognizing it. There is no inventory of workflow shapes and no gate that fires when a third step is added to a two-step flow. In practice the third status column is likelier to be noticed at review than at design time, and by then it exists.
  • Nothing here is validated by running code. No saga state machine has ever been built in this workspace, so the shape above is a design on paper: the EF saga repository has not been exercised against SQLServerDbContext, and the interaction between a saga's own persistence and the outbox interceptor (ADR-003) is unexplored. Expect the implementing PR to find something this record did not anticipate.
  • The v8 pin is inherited, not resolved. A coordinator built on MassTransit v8 makes the pin harder to leave, because a licensing or end-of-support forced move would then also be a workflow migration rather than only a transport one.
  • ADR-054's sweep does not go away. Even after a process manager exists, the reconciliation backstop is still needed for external systems that never reply, so the eventual state is two mechanisms rather than one replacing the other. This record's benefit is a narrower job for the sweep, not its retirement.

Revision (2026-09-11): the first per-instance deadline exists, and it is not a state machine

One of the three properties this record listed as absent has arrived, from an unexpected direction. MMCA.Store now gives every unpaid order its own scheduled deadline: CheckOutHandler arms an ExpireUnpaidOrderInternalCommand for now plus UnpaidOrderExpiry:Minutes inside the checkout transaction (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/ShoppingCarts/UseCases/CheckOut/CheckOutHandler.cs:178-184,226-229), OrderPaymentFailedSagaHandler re-arms it after a failed payment attempt (.../Orders/Saga/OrderPaymentFailedSagaHandler.cs:81-84), and its handler cancels the order only when it is still unpaid and its window has genuinely elapsed (.../Orders/InternalCommands/ExpireUnpaidOrderInternalCommandHandler.cs:61-74). That is a timeout which is not a poll: per instance, durable, and exact.

It was built on ADR-114's internal-command queue, not on a state machine (MMCA.Common/Source/Core/MMCA.Common.Application/InternalCommands/IInternalCommandScheduler.cs:16). A scheduled row carrying a due time and one aggregate id is sufficient when the state the deadline acts on already lives on that aggregate: the handler re-reads the order and decides against what is stored, so there is nothing to correlate and no second copy of the workflow's state to keep in step. This is worth recording precisely because it is the cheap answer this record predicted would be reached for, and here it was the right one.

It does not meet the trigger, and the deferral stands unchanged. The condition this record names is three properties together, and the other two remain absent. There is no workflow state outside an aggregate: the deadline's payload is an order id, and Order.Status plus Order.InventoryRestored are still the saga state. And there is no compensation that must unwind in order: cancelling an expired order runs the one independent OrderCancelled handler, exactly as ADR-054 describes. A sweep per wait is likewise still hypothetical, because there is exactly one wait. What has changed is the balance of reasons: a per-instance timeout on its own no longer argues for a coordinator, so the argument that remains for one is correlation state and ordered compensation.

The absence evidence is re-verified rather than assumed. A content sweep of the four repositories' Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga and InMemorySagaRepository still returns no match in any repo, PaymentReconciliationService (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Reconciliation/PaymentReconciliationService.cs:68) is still the only reconciliation sweep, and PeriodicBackgroundService still has exactly one production subclass (PaymentReconciliationService.cs:74).

Revision (2026-10-01)

No decision or rationale changed. Two current-state statements are refreshed. The MassTransit pin is 8.5.11 for all three packages, still v8 (MMCA.Common/Directory.Packages.props:124-126), so the licensing constraint stands unchanged. PeriodicBackgroundService no longer has exactly one production subclass: beside PaymentReconciliationService (PaymentReconciliationService.cs:75) it now has four MMCA.Common maintenance jobs (RefreshSessionCleanupService.cs:53, PermissionGrantRefreshService.cs:36, InternalCommandCleanupService.cs:46, OutboxCleanupService.cs:49). None of them is a reconciliation sweep or a workflow coordinator, so the absence evidence for this record's trigger holds. The 2026-09-11 Revision above is kept as written; its PaymentReconciliationService.cs:68/:74 anchors now sit at :69/:75, and the arm call it attributes to CheckOutHandler is a deadlineScheduler.ArmAsync call there (CheckOutHandler.cs:180) that delegates to CheckOutDeadlineScheduler, which schedules the ExpireUnpaidOrderInternalCommand (.../ShoppingCarts/UseCases/CheckOut/CheckOutDeadlineScheduler.cs:55-56).

Revision (2026-10-07)

Re-verified against current source. The deferral, its trigger, the coordinator's shape and the v8 licensing constraint are unchanged, and the absence evidence still holds. One statement in the Decision was wrong and is corrected in place: MassTransit is the transport for the two broker providers only, not for all three. The statements that depended on it (the v8 saga repository's capability, the coordinator's cost, one coordination technology) are qualified to match.

  1. The in-process provider is not MassTransit. AddBrokerMessaging returns early when the provider is InProcess, before AddMassTransit is reached (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Messaging.cs:52-55, AddMassTransit at :64, and the switch's InProcess arm notes the short-circuit at :342-344). In that mode the bus is InProcessMessageBus, which dispatches through IDomainEventDispatcher (.../Messaging/InProcessMessageBus.cs:19-26). A saga state machine therefore has a bus to ride only under RabbitMQ or Azure Service Bus; the modular-monolith deployment would need a broker provider or a new in-process MassTransit registration first. The Decision bullet now says so.
  2. The EF saga repository is not yet a dependency. The pin covers exactly three packages, MassTransit, MassTransit.RabbitMQ and MassTransit.Azure.ServiceBus.Core, all at 8.5.11 (MMCA.Common/Directory.Packages.props:124-126), and no MassTransit.EntityFrameworkCore version is declared there. Building the coordinator adds a fourth MassTransit package, and the build gate that holds the pin checks a fixed list of exactly those three ids (MMCA.Common/Source/Hosting/MMCA.Common.Testing.Architecture/Bases/Governance/DependencyVersionTestsBase.cs:17-22, loop at :27-35), so the new package is guarded only once its id is added to MassTransitPackageIds. Whether the v8 saga repository is sufficient is a library claim no source here exercises, so the Decision now states it as an assumption, and the Rationale bullets on cost and on one coordination technology are qualified for the InProcess provider.
  3. Anchors re-verified against current source: the 2026-09-11 Revision's CheckOutHandler.cs:178-184,226-229 is kept as written; the file now has 214 lines, the arm call is the single line CheckOutHandler.cs:180 (comment at :176-179, return at :182), and the scheduling it delegates to is CheckOutDeadlineScheduler.cs:55-58. The Context anchors hold: PaymentReconciliationService.cs:69 (class) and :75 (PeriodicBackgroundService base), RefreshSessionCleanupService.cs:53, PermissionGrantRefreshService.cs:36, InternalCommandCleanupService.cs:46, OutboxCleanupService.cs:49.

Revision (2026-10-21)

Re-verified against current source. No decision, rationale or trade-off changed: the deferral, its trigger, the coordinator's shape, the v8 licensing constraint and the absence evidence all hold. Only the build-gate anchors cited by the 2026-10-07 Revision moved; that Revision is kept as written.

  1. Anchors re-verified against current source: the pin gate's fixed list of exactly three ids, MassTransitPackageIds, now sits at MMCA.Common/Source/Hosting/MMCA.Common.Testing.Architecture/Bases/Governance/DependencyVersionTestsBase.cs:18-23 (the ids at :20-22), the test method at :26 and its loop at :28-37, replacing the 2026-10-07 Revision's :17-22 and :27-35. The gate runs in MMCA.Common through MMCA.Common/Tests/Architecture/MMCA.Common.Architecture.Tests/Governance/DependencyVersionTests.cs:9. The pin itself holds at 8.5.11 for all three packages (MMCA.Common/Directory.Packages.props:124-126), and the arm call holds at CheckOutHandler.cs:180, delegating to CheckOutDeadlineScheduler.cs:55 for the scheduling.

Revision (2026-10-26)

Re-verified against current source. The deferral, its trigger, the coordinator's shape, the v8 licensing constraint and the absence evidence are unchanged. What moved is the MassTransit surface the coordinator would ride: more broker providers and more pinned packages. The Decision is corrected in place; the 2026-10-07 and 2026-10-21 Revisions are kept as written.

  1. Every broker provider is MassTransit, and there are four. RabbitMQ and PostgreSQL are built in (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/DependencyInjection.Messaging.cs:190-198, documented at :26-29); Azure Service Bus and Amazon SQS are adapter IBrokerTransports (:32-36), registering UsingAzureServiceBus (MMCA.Common/Source/Hosting/MMCA.Common.Azure/Messaging/AzureServiceBusTransport.cs:33) and UsingAmazonSqs (MMCA.Common/Source/Hosting/MMCA.Common.Aws/Messaging/AmazonSqsTransport.cs:90). InProcess is still the one provider that is not MassTransit: AddBrokerMessaging returns at :57-60 before AddMassTransit at :83, the no-op is documented at :30-31, and the bus is InProcessMessageBus over IDomainEventDispatcher (.../Messaging/InProcessMessageBus.cs:19). The 2026-10-07 Revision's "not for all three" now reads as "not for all five providers"; the Decision bullet names the four broker providers.
  2. The pin covers five packages at 8.5.12. MassTransit, MassTransit.RabbitMQ and MassTransit.Azure.ServiceBus.Core sit at MMCA.Common/Directory.Packages.props:125-127, MassTransit.AmazonSQS at :130 and MassTransit.SqlTransport.PostgreSQL at :136, all still v8. The gate's MassTransitPackageIds lists those five ids (MMCA.Common/Source/Hosting/MMCA.Common.Testing.Architecture/Bases/Governance/DependencyVersionTestsBase.cs:18-25, ids at :20-24). MassTransit.EntityFrameworkCore is still declared nowhere, so the EF saga repository would be a sixth MassTransit package, guarded only once its id is added. The constraint paragraph in the Decision now says so.
  3. Anchors re-verified against current source: the gate's [Fact] at DependencyVersionTestsBase.cs:27, the method MassTransit_MustNotExceed_MajorVersion8 at :28 and its loop at :30-39, still run through MMCA.Common/Tests/Architecture/MMCA.Common.Architecture.Tests/Governance/DependencyVersionTests.cs:9; the 2026-10-07 Revision's DependencyInjection.Messaging.cs:342-344 switch anchor no longer exists (the file has 274 lines and no switch). In MMCA.Store the arm call is deadlineScheduler.ArmAsync at CheckOutHandler.cs:178 (scheduler injected at :45; the file has 212 lines, so the 2026-09-11 Revision's :226-229 is past its end), delegating to CheckOutDeadlineScheduler.cs:55. The Context anchors hold: PaymentReconciliationService.cs:69 (class) and :75 (base), RefreshSessionCleanupService.cs:53, PermissionGrantRefreshService.cs:36, InternalCommandCleanupService.cs:46, OutboxCleanupService.cs:49. A per-repo content sweep of the four Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga, InMemorySagaRepository and MassTransit.EntityFrameworkCore still returns no match.

Revision (2026-10-28)

Re-verified against current source. The deferral, its trigger, the coordinator's shape, the v8 licensing constraint and the absence evidence are unchanged. What moved is where MMCA.Store arms the unpaid-order deadline (now a component shared by both checkout flows) and the number of independent OrderCancelled handlers. The Context's compensation bullet is corrected in place; the earlier Revisions are kept as written.

  1. The deadline is armed by a shared finalizer, for both checkout flows. CheckOutHandler no longer injects the scheduler: it injects PlacedOrderFinalizer (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/ShoppingCarts/UseCases/CheckOut/CheckOutHandler.cs:47) and calls FinalizeAsync at :210, inside the WriteAsync delegate (:148) that ExecuteInTransactionAsync runs (:104). PlacedOrderFinalizer injects CheckOutDeadlineScheduler (.../CheckOut/PlacedOrderFinalizer.cs:22), saves an optional shipping label (:33-45), then calls deadlineScheduler.ArmAsync (:49). Guest checkout injects the same finalizer (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/UseCases/GuestCheckout/GuestCheckOutHandler.cs:31) and calls it at :122 inside its own ExecuteInTransactionAsync (:65), so both flows share one arm path. The scheduling itself is still CheckOutDeadlineScheduler.cs:55-58. Guest checkout is one synchronous handler whose state lives on Order, so it adds no workflow state outside an aggregate and does not meet the trigger.
  2. Two independent OrderCancelled handlers exist, not one. Beside OrderCancelledSagaHandler, which restores stock (.../Orders/Saga/OrderCancelledSagaHandler.cs:13-17, RestoreAsync at :64-160, IncrementAsync at :150), OrderCancelledHandler schedules the cancellation notice as an internal command (.../Orders/DomainEventHandlers/OrderCancelledHandler.cs:36-41, with runAt: null at :39), and its own documentation states that neither depends on the other (:13-15). The 2026-09-11 Revision's "the one independent OrderCancelled handler" now reads as two; the conclusion it supports (no compensation that must unwind in order) holds.
  3. Still exactly one per-instance wait. The only future-dated IInternalCommandScheduler.ScheduleAsync calls in the four Source trees are the unpaid-order deadline and its re-arm (CheckOutDeadlineScheduler.cs:57 and .../Orders/Saga/OrderPaymentFailedSagaHandler.cs:83); every other Store call passes runAt: null, MMCA.ADC's internal-command calls leave runAt at its default, and MMCA.Helpdesk makes none. (MMCA.ADC's device-side session reminders call the unrelated ILocalNotificationService.ScheduleAsync with a future time, at MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.UI/Services/HappeningNow/SessionReminderCoordinator.cs:315; that is a client notification, not a server-side workflow wait.) A per-repo content sweep of the four Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga, InMemorySagaRepository and MassTransit.EntityFrameworkCore still returns no match.
  4. Anchors re-verified against current source: the arm call is PlacedOrderFinalizer.cs:49, replacing CheckOutHandler.cs:178-184,226-229 (2026-09-11), :180 (2026-10-01, 2026-10-07, 2026-10-21) and :178 with the scheduler at :45 (2026-10-26); CheckOutHandler.cs now has 244 lines and :226-229 falls inside an unrelated inventory fetch.

Revision (2026-11-12): the deferral is revisited, and resolved for single-aggregate state

The deferral was revisited on 2026-11-12. For a flow whose state fits one aggregate it is resolved, not by the coordinator this record describes, but by the behaviour-only primitive recorded in ADR-143; for state that fits no aggregate it stands unchanged.

  1. What the primitive adds is behaviour, not state. ProcessManagerAggregateRoot<TIdentifierType> derives AuditableAggregateRootEntity<TIdentifierType> and declares no property and no field (MMCA.Common/Source/Core/MMCA.Common.Domain/ProcessManagers/ProcessManagerAggregateRoot.cs:10-11,17); its DecideTimeout answers not-applicable by default (:43-44). Timeouts are consumer-owned internal commands on ADR-114's queue, run by ProcessTimeoutHandlerBase (MMCA.Common/Source/Core/MMCA.Common.Application/ProcessManagers/ProcessTimeoutHandlerBase.cs:36-43), and each event step runs through ProcessDomainEventHandlerBase (.../ProcessManagers/ProcessDomainEventHandlerBase.cs:31-35). AddProcessManagers() registers only the scoped IProcessTimeoutScheduler and a fallback clock (MMCA.Common/Source/Core/MMCA.Common.Application/DependencyInjection.ProcessManagers.cs:26-27), and the primitive brings no table, no migration and no configuration key (MMCA.Common/UPGRADING.md:241). There is no correlation store and no new package.
  2. It is the case this record's Rationale already called correct for choreography. The state stays on the aggregate: Order derives the base (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Domain/Orders/Order.cs:47), still names Status plus InventoryRestored as the saga state (Order.cs:40-43), and decides its own payment deadline in DecideTimeout (Order.cs:984-1004). ExpireUnpaidOrderInternalCommandHandler derives the timeout base (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/Orders/InternalCommands/ExpireUnpaidOrderInternalCommandHandler.cs:39-48), OrderCancelledSagaHandler derives the step base (.../Orders/Saga/OrderCancelledSagaHandler.cs:49-52), and OrderPaymentFailedSagaHandler remains a plain IDomainEventHandler<OrderPaymentFailed> (.../Orders/Saga/OrderPaymentFailedSagaHandler.cs:23-25). Both arming sites construct new ProcessTimeoutScheduler(...) rather than resolving IProcessTimeoutScheduler: CheckOutDeadlineScheduler over its injected internal-command scheduler and clock, and OrderPaymentFailedSagaHandler over its scope's services (.../ShoppingCarts/UseCases/CheckOut/CheckOutDeadlineScheduler.cs:31-37, OrderPaymentFailedSagaHandler.cs:82-84). The 2026-09-11 Revision's handler anchor ExpireUnpaidOrderInternalCommandHandler.cs:61-74 no longer holds: the re-derivation is Order.cs:988-998.
  3. What stays deferred. The MassTransit v8 saga state machine, its correlation row and the trigger in the Decision are unchanged: they answer state that fits no aggregate, which the primitive does not cover. A per-repo content sweep of the four Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga, InMemorySagaRepository and MassTransit.EntityFrameworkCore still returns no match.

Revision (2026-11-23)

Re-verified against current source. The deferral, its trigger, the coordinator's shape, the v8 licensing constraint, the single-aggregate resolution of 2026-11-12 and the absence evidence are unchanged. What moved is how MMCA.Store arms and measures the unpaid-order deadline, plus anchors. The Context and Decision anchors are re-pointed in place; the earlier Revisions are kept as written.

  1. Both arming sites go through ProcessTimeoutScheduler, not a direct ScheduleAsync. The 2026-10-28 Revision's "future-dated IInternalCommandScheduler.ScheduleAsync calls" now read as ProcessTimeoutScheduler.ArmAsync calls: CheckOutDeadlineScheduler builds one over its injected internal-command scheduler and clock (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Application/ShoppingCarts/UseCases/CheckOut/CheckOutDeadlineScheduler.cs:31,37) and arms through it (ArmAsync declared at :55, the call at :63-66), and OrderPaymentFailedSagaHandler constructs one (.../Orders/Saga/OrderPaymentFailedSagaHandler.cs:83) and re-arms at :87. Every remaining direct ScheduleAsync in MMCA.Store passes runAt: null (for example .../Orders/DomainEventHandlers/OrderCancelledHandler.cs:37,39), so the unpaid-order deadline is the one per-instance wait in MMCA.Store. It is not the only one in the four Source trees: MMCA.ADC's roster import arms a backstop directly, StartTicketRosterImportHandler scheduling ExpireTicketRosterImportInternalCommand(runId) through the TimeSpan delay overload (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Application/Tickets/UseCases/StartRosterImport/StartTicketRosterImportHandler.cs:121-122, MMCA.Common/Source/Core/MMCA.Common.Application/InternalCommands/IInternalCommandScheduler.cs:59-62) at TicketImportRun.AbandonAfter, 30 minutes (MMCA.ADC/Source/Modules/Engagement/MMCA.ADC.Engagement.Domain/Tickets/TicketImportRun.cs:37). That wait carries only the run id and its handler loads and fails the one TicketImportRun (.../Tickets/UseCases/ExpireRosterImport/ExpireTicketRosterImportHandler.cs:26,36), so it is a single-aggregate deadline like the order's and does not meet the trigger. MMCA.Helpdesk Source has no ScheduleAsync call.
  2. The payment window has its own stored start. PlacedOrderFinalizer gains StartPaymentWindow (.../ShoppingCarts/UseCases/CheckOut/PlacedOrderFinalizer.cs:36), which both checkout flows call before finalizing (CheckOutHandler.cs:206, .../Orders/UseCases/GuestCheckout/GuestCheckOutHandler.cs:120), and Order.DecideTimeout (MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Domain/Orders/Order.cs:1115) re-derives the due instant from PaymentWindowStartedOn (Order.cs:69), falling back to the last transition when no window start is stored (Order.cs:1125): an older row, or an order whose StartPaymentWindow was refused because it was no longer PendingPayment (Order.cs:570), which the finalizer logs and continues past (PlacedOrderFinalizer.cs:40-44,77). The window start is a column on Order, so the state the deadline acts on still fits one aggregate and the trigger is still not met.
  3. Anchors re-verified against current source: the MassTransit pin, still five v8 packages at 8.5.12, is MMCA.Common/Directory.Packages.props:188-190,193,199, replacing :125-127,130,136; PaymentReconciliationService.cs:81 (class) and :87 (base), replacing :69/:75, and it is still the only MMCA.Store PeriodicBackgroundService subclass; OutboxCleanupService.cs:50, replacing :49, while RefreshSessionCleanupService.cs:53, PermissionGrantRefreshService.cs:36 and InternalCommandCleanupService.cs:46 hold, so the count of five holds and ADC and Helpdesk have none. UsingAzureServiceBus is at MMCA.Common/Source/Hosting/MMCA.Common.Azure/Messaging/AzureServiceBusTransport.cs:79 (2026-10-26 cited :33). InProcessMessageBus takes IDomainEventDispatcher at .../Messaging/InProcessMessageBus.cs:18 and dispatches at :24. In the 2026-11-12 Revision, Order derives the base at Order.cs:48 (was :47), the saga-state sentence is at :41-43, DecideTimeout spans :1115-1135 (was :984-1004) and the re-derivation is :1125-1129 (was :988-998); the process-manager upgrade note is MMCA.Common/UPGRADING.md:465-466 (was :241). In the 2026-10-28 Revision, PlacedOrderFinalizer injects the scheduler at :27 (was :22), FinalizeAsync is at :51, the label block at :55-67 (was :33-45) and the arm call at :71 (was :49); CheckOutHandler.cs injects the finalizer at :48 (was :47), runs ExecuteInTransactionAsync at :106, WriteAsync at :150 and FinalizeAsync at :213 (was :104, :148, :210); guest checkout's :31 and :65 hold and its FinalizeAsync is at :123 (was :122); OrderCancelledSagaHandler.cs no longer has a RestoreAsync member, and its IncrementAsync call is at :179. A per-repo content sweep of the four Source trees for MassTransitStateMachine, SagaStateMachineInstance, ISaga, InMemorySagaRepository and MassTransit.EntityFrameworkCore still returns no match.

ADR-054 (the accepted mechanism this record defers an alternative to: choreographed compensation, the persisted aggregate marker, and the reconciliation sweep that would remain underneath a process manager), ADR-003 (the at-least-once delivery, bounded retries and dead-lettering that make choreography sufficient today, and that a saga would sit on top of rather than replace), ADR-066 (the MassTransit transport abstraction the state machine would ride), ADR-016 (the v8 pin, its licensing reason and its build gate), ADR-006 (where the correlation state would live: the owning service's own database, beside its outbox and inbox), ADR-021 (consume-edge dedup, which a saga needs exactly as much as a handler does), ADR-052 (the hosted-service family the reconciliation sweep belongs to, and the in-process alternative a per-instance deadline is not), ADR-084 (the third-party ingress whose unreliability is the specific thing no coordinator can fix), ADR-114 (the durable internal-command queue that carries the first per-instance deadline, one aggregate id at a time, without a coordinator), ADR-143 (the process-manager primitive that resolves this deferral for a flow whose state fits one aggregate).