SequenceDiagrams

Examples

Microservices Saga Sequence Diagram

This microservices saga sequence diagram shows the happy path and compensation path in one flow. The conditional branch makes it clear when inventory success leads to shipping and when failure triggers a payment refund.

Microservices Sagaif stock availableout of stockOrdersPaymentsInventoryShippingReserve fundsReservedReserve stockReservedSchedule deliveryScheduledUnavailableRefund

Diagram source

Use this text as a starting point or open it in the editor to make changes.

title: Microservices Saga
Orders -> Payments: Reserve funds
Payments --> Orders: Reserved
Orders -> Inventory: Reserve stock
if: stock available
  Inventory --> Orders: Reserved
  Orders -> Shipping: Schedule delivery
  Shipping --> Orders: Scheduled
else: out of stock
  Inventory --> Orders: Unavailable
  Orders ->> Payments: Refund
end