Order start and success processing

StartOrderRes returns at Created — reservation, authorization, and confirmation continue in the background

Order start and success processing StartOrderRes returns at Created — reservation, authorization, and confirmation continue in the background StartOrderReq Reserve idempotency mapping OrderId StartOrderWorkflowReq Replay OrderId stream Empty stream Append OrderStartedEvent Apply Created Confirm started mapping StartOrderWorkflowRes StartOrderRes(Created) ReserveInventoryReq ReserveInventoryRes(accepted) Append InventoryReservedEvent Apply InventoryReserved AuthorizePaymentReq AuthorizePaymentRes(accepted) Append PaymentAuthorizedEvent Apply PaymentAuthorized Append OrderConfirmedEvent Apply Confirmed GetOrderStateReq Read OrderState Confirmed GetOrderStateRes(Confirmed) Client · Sequence participant Client CommerceApi · Sequence participant CommerceApi Commerce State · Sequence participant Commerce State OrderWorkflow · / Order Spot · Sequence participant OrderWorkflow / Order Spot Order Event Store · Sequence participant Order Event Store Order Read Model · Sequence participant Order Read Model Inventory · Sequence participant Inventory Payment · Sequence participant Payment

Background continuation does not extend the HTTP reply boundary

  • • mermaid Note over Workflow (positioned right after StartOrderWorkflowRes/StartOrderRes, before ReserveInventoryReq): 'Background continuation does not extend the HTTP reply boundary.' StartOrderRes(Created) at step 11 does not wait for steps 12-21 (inventory reservation, payment authorization, confirmation) to complete.

Reading the flow

  • • CommerceApi performs mapping reservation and input validation, but doesn't record the event stream. OrderWorkflowSpot replays the stream to restore the aggregate, records OrderStartedEvent, then updates the projection.
  • • The client repeats GetOrderStateReq with bounded polling to confirm Confirmed or Failed.