Skip to content
Weave templates

Event-Driven Saga (choreography)

Choreographed saga across order / payment / inventory / shipping with events on the bus.

Template previewWeave
Rendering…

Make it your own.

{
  "nodes": [
    { "id":"o","type":"server","label":"Order svc","x":40,"y":120 },
    { "id":"p","type":"server","label":"Payment svc","x":40,"y":260 },
    { "id":"i","type":"server","label":"Inventory svc","x":40,"y":400 },
    { "id":"s","type":"server","label":"Shipping svc","x":40,"y":540 },
    { "id":"bus","type":"container","label":"Event bus","x":240,"y":80,"w":120,"h":520,"locked":true },
    { "id":"e1","type":"note","label":"OrderCreated","x":260,"y":120,"fill":"#fed7aa" },
    { "id":"e2","type":"note","label":"PaymentCaptured","x":260,"y":220,"fill":"#fed7aa" },
    { "id":"e3","type":"note","label":"StockReserved","x":260,"y":340,"fill":"#fed7aa" },
    { "id":"e4","type":"note","label":"ShipmentScheduled","x":260,"y":480,"fill":"#fed7aa" },
    { "id":"comp","type":"server","label":"Compensator","x":460,"y":340,"fill":"#fee2e2" },
    { "id":"ec","type":"note","label":"PaymentFailed","x":620,"y":220,"fill":"#fecaca" }
  ],
  "edges": [
    { "id":"a","source":"o","target":"e1" },
    { "id":"b","source":"e1","target":"p","label":"react" },
    { "id":"c","source":"p","target":"e2" },
    { "id":"d","source":"e2","target":"i","label":"react" },
    { "id":"e","source":"i","target":"e3" },
    { "id":"f","source":"e3","target":"s","label":"react" },
    { "id":"g","source":"s","target":"e4" },
    { "id":"h","source":"p","target":"ec","style":"dashed" },
    { "id":"i2","source":"ec","target":"comp","style":"dashed","label":"compensate" },
    { "id":"j","source":"comp","target":"o","style":"dashed","label":"cancel","curve":"step" }
  ]
}