[{"data":1,"prerenderedAt":366},["ShallowReactive",2],{"page-\u002Fv1\u002Fcore\u002Forchestration":3},{"id":4,"title":5,"body":6,"description":359,"extension":360,"meta":361,"navigation":218,"path":362,"seo":363,"stem":364,"__hash__":365},"content\u002Fv1\u002Fcore\u002Forchestration.md","Orchestration (saga-lite)",{"type":7,"value":8,"toc":353},"minimark",[9,13,26,44,49,96,100,162,166,274,289,293,331,338,349],[10,11,5],"h1",{"id":12},"orchestration-saga-lite",[14,15,16,17,21,22,25],"p",{},"ACL vs Event covers most bridges. Some product flows need ",[18,19,20],"strong",{},"several steps"," across modules (reserve → pay → confirm → ship). Core allows a thin ",[18,23,24],{},"orchestration"," pattern without collapsing module boundaries.",[14,27,28,29,34,35,34,39,43],{},"Related: ",[30,31,33],"a",{"href":32},"\u002Fv1\u002Fcore\u002Ftransactions-and-failures","Transactions"," · ",[30,36,38],{"href":37},"\u002Fv1\u002Fcore\u002Fcross-module-events","Events",[30,40,42],{"href":41},"\u002Fv1\u002Fcore\u002Fdecision-tree","Decision tree",".",[45,46,48],"h2",{"id":47},"when-you-need-it","When you need it",[50,51,52,65],"table",{},[53,54,55],"thead",{},[56,57,58,62],"tr",{},[59,60,61],"th",{},"Signal",[59,63,64],{},"Prefer",[66,67,68,77,85],"tbody",{},[56,69,70,74],{},[71,72,73],"td",{},"One peer answer in the same request",[71,75,76],{},"Sync ACL",[56,78,79,82],{},[71,80,81],{},"One side effect after success",[71,83,84],{},"Domain Event",[56,86,87,90],{},[71,88,89],{},"Multiple modules, multiple steps, compensations",[71,91,92,95],{},[18,93,94],{},"Orchestration"," (this page)",[45,97,99],{"id":98},"rules-mandatory","Rules (mandatory)",[101,102,103,110,116,137,147],"ol",{},[104,105,106,109],"li",{},[18,107,108],{},"No peer Application\u002FDomain imports"," — orchestration still uses ACL + Events only.",[104,111,112,115],{},[18,113,114],{},"Orchestrator is not a second Domain"," — it coordinates; business invariants stay in owning modules.",[104,117,118,121,122],{},[18,119,120],{},"Placement options"," (pick one per flow):\n",[123,124,125,131],"ul",{},[104,126,127,130],{},[18,128,129],{},"Owning module Application"," — a first-level Use Case that sequences local work + ACL + dispatches events (simplest).",[104,132,133,136],{},[18,134,135],{},"Infrastructure process manager \u002F saga"," — listens to events, calls inbound Use Cases \u002F ACL ports, records step state (for long-running flows).",[104,138,139,142,143,146],{},[18,140,141],{},"State of the saga"," (step reached, reservation ids) lives in ",[18,144,145],{},"Infrastructure"," of the orchestrating side — not in Shared business tables.",[104,148,149,152,153,157,158,161],{},[18,150,151],{},"Compensations"," are explicit Use Cases \u002F façade methods (",[154,155,156],"code",{},"ReleaseReservation",", ",[154,159,160],{},"MarkPaymentFailed","), not silent DB rollbacks across modules.",[45,163,165],{"id":164},"sketch-place-order-with-reservation","Sketch — place order with reservation",[167,168,173],"pre",{"className":169,"code":170,"language":171,"meta":172,"style":172},"language-mermaid shiki shiki-themes github-light github-dark","sequenceDiagram\n    autonumber\n    participant UC as Ordering PlaceOrderUseCase\n    participant W as Warehouse ACL port\n    participant R as Ordering repository\n    participant E as EventDispatcher\n\n    UC->>W: reserve(qty) \n    alt cannot reserve\n        W-->>UC: fail → abort\n    else reserved\n        W-->>UC: reservationCode\n        UC->>R: persist order + code\n        UC->>E: OrderPlaced (rich payload)\n        Note over UC: Payment \u002F Warehouse confirm via later events or ACL\n    end\n","mermaid","",[154,174,175,183,189,195,201,207,213,220,226,232,238,244,250,256,262,268],{"__ignoreMap":172},[176,177,180],"span",{"class":178,"line":179},"line",1,[176,181,182],{},"sequenceDiagram\n",[176,184,186],{"class":178,"line":185},2,[176,187,188],{},"    autonumber\n",[176,190,192],{"class":178,"line":191},3,[176,193,194],{},"    participant UC as Ordering PlaceOrderUseCase\n",[176,196,198],{"class":178,"line":197},4,[176,199,200],{},"    participant W as Warehouse ACL port\n",[176,202,204],{"class":178,"line":203},5,[176,205,206],{},"    participant R as Ordering repository\n",[176,208,210],{"class":178,"line":209},6,[176,211,212],{},"    participant E as EventDispatcher\n",[176,214,216],{"class":178,"line":215},7,[176,217,219],{"emptyLinePlaceholder":218},true,"\n",[176,221,223],{"class":178,"line":222},8,[176,224,225],{},"    UC->>W: reserve(qty) \n",[176,227,229],{"class":178,"line":228},9,[176,230,231],{},"    alt cannot reserve\n",[176,233,235],{"class":178,"line":234},10,[176,236,237],{},"        W-->>UC: fail → abort\n",[176,239,241],{"class":178,"line":240},11,[176,242,243],{},"    else reserved\n",[176,245,247],{"class":178,"line":246},12,[176,248,249],{},"        W-->>UC: reservationCode\n",[176,251,253],{"class":178,"line":252},13,[176,254,255],{},"        UC->>R: persist order + code\n",[176,257,259],{"class":178,"line":258},14,[176,260,261],{},"        UC->>E: OrderPlaced (rich payload)\n",[176,263,265],{"class":178,"line":264},15,[176,266,267],{},"        Note over UC: Payment \u002F Warehouse confirm via later events or ACL\n",[176,269,271],{"class":178,"line":270},16,[176,272,273],{},"    end\n",[14,275,276,277,280,281,284,285,288],{},"Long-running variant: after ",[154,278,279],{},"OrderPlaced",", a ",[18,282,283],{},"Warehouse or Ordering Infrastructure"," process manager waits for ",[154,286,287],{},"PaymentCaptured"," \u002F timeouts and calls inbound Use Cases accordingly.",[45,290,292],{"id":291},"anti-patterns","Anti-patterns",[50,294,295,305],{},[53,296,297],{},[56,298,299,302],{},[59,300,301],{},"Smell",[59,303,304],{},"Fix",[66,306,307,315,323],{},[56,308,309,312],{},[71,310,311],{},"“Shared OrderWorkflow entity” with everyone’s enums",[71,313,314],{},"Keep steps as events + local state",[56,316,317,320],{},[71,318,319],{},"Orchestrator calling peer Use Cases by class name",[71,321,322],{},"ACL façade or inbound Use Case via listener only",[56,324,325,328],{},[71,326,327],{},"God Use Case that imports three modules’ Domains",[71,329,330],{},"Split; only Infrastructure may see foreign contracts",[14,332,333,334,337],{},"Orchestration is ",[18,335,336],{},"optional complexity",". Default to ACL + Event until a real multi-step failure mode forces it.",[14,339,340,341,34,345,43],{},"Next: ",[30,342,344],{"href":343},"\u002Fv1\u002Fcore\u002Freads-and-reporting","reads & reporting",[30,346,348],{"href":347},"\u002Fv1\u002Fcookbook\u002Fordering-warehouse","cookbook Ordering ↔ Warehouse",[350,351,352],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":172,"searchDepth":185,"depth":185,"links":354},[355,356,357,358],{"id":47,"depth":185,"text":48},{"id":98,"depth":185,"text":99},{"id":164,"depth":185,"text":165},{"id":291,"depth":185,"text":292},"Multi-step cross-module flows without peer Use Case imports — process managers stay at the edge.","md",{},"\u002Fv1\u002Fcore\u002Forchestration",{"title":5,"description":359},"v1\u002Fcore\u002Forchestration","tmuXUObhAASbnBQv4vQR9SrobOQDCyQ_er3betBEQU4",1786241412262]