ADR-BW-020: Coordinate checkout workflows with Azure Durable Functions sagas
Use Azure Durable Functions in Order Orchestration keyed by OrderId with LIFO compensations instead of choreography or a custom state machine.
| Field | Value |
|---|---|
| Status | Accepted |
| Date | 2026-11-28 |
| Owners | Commerce Fulfillment TeamTeamCommerce Fulfillment TeamStream-Aligned team owning customer shopping baskets, checkout coordination, order lifecycle, and financial saga orchest...Open docs |
| Affected Resources | Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs |
| Related ADRs | ADR-BW-005: Use Kafka for configured asynchronous integrationDecision Recordv1.0.0ADR-BW-005: Use Kafka for configured asynchronous integrationRetain the shared Wolverine Kafka integration for asynchronous cross-capability messages where a broker is configured.Ownerplatform-engineering-teamOpen docs, ADR-BW-008: Persist configured broker handoffs with local inboxes and outboxesDecision Recordv1.0.0ADR-BW-008: Persist configured broker handoffs with local inboxes and outboxesUse the shared event framework's per-service durable message storage without claiming exactly-once business effects.Ownerplatform-engineering-teamOpen docs |
Context & Problem Statement
Customer checkout spans Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs, and Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs. Pure event choreography makes multi-step failure compensation (such as basket cleanup failure) hard to trace and reason about.
Decision & Consequences
Chosen Option: Implement Order OrchestrationServicev1.0.0Order OrchestrationMessage-driven Finance workflow service that coordinates post-checkout basket
cleanup and order notifications using Dura...PublishesPlaceOrderCommand, DeleteBasketCompleteCommand +3SubscribesUserCheckedOutIntegrationEvent, OrderStatusChangedToCompleteIntegrationEvent +3APIsAsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs as an Azure Durable Functions orchestrator keyed deterministically by OrderId. Upon receiving User checked outEventv1.0.0User checked outReports that an Order was placed and its checkout details are ready for
Finance coordination.
Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, it dispatches Place orderCommandv1.0.0Place orderShared Finance order-placement command consumed by Notification to render
and submit a new-order email.
Ownerplatform-engineering-teamSchemaDiagramOpen docs and awaits Basket deletion completedEventv1.0.0Basket deletion completedIndicates that Basket successfully deleted the submitted basket during
checkout cleanup.
Ownercommerce-fulfillment-teamSchemaDiagramOpen docs or Basket deletion failedEventv1.0.0Basket deletion failedIndicates that Basket could not delete the submitted basket during checkout
cleanup.
Ownercommerce-fulfillment-teamSchemaDiagramOpen docs, issuing LIFO compensations (Handle basket deletion failedCommandv1.0.0Handle basket deletion failedReports Finance's failed basket-cleanup outcome so Order API can
soft-delete the affected Order.
Ownercommerce-fulfillment-teamSchemaDiagramOpen docs) when cleanup fails.
- Positive: Deterministic per-order instance state, built-in Durable Task Hub history, and explicit compensation paths.
- Negative: Uses Azure Functions Kafka triggers rather than Wolverine’s Kafka transport, requiring Durable Task Hub inspection instead of a Kafka DLQ.