Schematex
sequence·OMG UML 2.5.1 §17 (Interactions)·software, business·complexity 3/3

Microservices order saga

A distributed order-processing saga showing the parts of UML sequence notation that generic tools omit — a ref interaction-use frame, a par fragment for concurrent service calls, asynchronous event-bus messages, and an alt fragment with a compensating rollback on payment failure.

For the distributed-systems engineer

Open in Playground →
sequence·§
↘ preview
100%
Sequence Diagram — Order processing (saga) 6 participants, 13 messages, 2 combined fragments. Order processing (saga) Customer API Gateway Order Service Payment Service Inventory Service «queue» Event Bus par alt [payment captured && stock reserved] [payment failed] ref Validate cart & price POST /orders createOrder() charge(card) reserve(items) paid reserved OrderConfirmed 201 Created confirmation release(items) OrderCancelled 402 Payment Required declined
UTF-8 · LF · 30 lines · 879 chars✓ parsed·8.1 ms·10.3 KB SVG

This is the case that separates a real UML engine from a flowchart with stick figures. A saga is concurrent, asynchronous, and has a compensating path — and Schematex has dedicated notation for each.

ref keeps the diagram composable. "Validate cart & price" is its own interaction; inlining it here would bury the saga in detail. The ref over Orders, Bus : … frame references it instead — notation most text-to-diagram tools simply don't have.

par shows true concurrency. The order service charges the card and reserves stock at the same time. The par fragment's two operands say these run concurrently, not in sequence — a distinction a top-to-bottom message list cannot express.

Async vs. reply arrows are not cosmetic. ->> (open head) marks fire-and-forget calls and event-bus publishes; --> (dashed) marks the replies that come back. Reading the arrowheads tells you which steps block and which don't.

The compensation lives in the alt. When payment fails, the second operand releases the previously reserved inventory and emits OrderCancelled — the saga's rollback, drawn right beside the happy path instead of in a separate diagram.

Sequence diagram syntax