ORCHCRAFT

Orchestration patterns

12 patterns for coordinating work across processes, services, agents and people. Each pattern page lists when to use it, when to avoid it, tradeoffs, failure modes and implementations.

Reliability

Keep work correct and progressing when processes crash, calls fail or transactions span services.

PatternDefinitionMaturity
Durable ExecutionDurable execution records every step of a workflow in a persistent log so that the workflow survives process crashes, restarts and deploys, and resumes from the last completed step as if nothing happened.Established
Saga / CompensationA saga splits a business transaction that spans several services into a sequence of local transactions, each paired with a compensating action that semantically undoes it if a later step fails.Established
Retry & FallbackRetry & fallback re-attempts a failed step under a declared policy of attempts and backoff, and switches to an alternative path when retries are exhausted or the error is not retryable.Established
CheckpointingCheckpointing saves a snapshot of execution state at defined points, so that after a failure, pause or inspection the run can be restored from the latest snapshot rather than restarted from the beginning.Established

Control flow

Decide what runs next, in what order and in parallel.

PatternDefinitionMaturity
RouterA router inspects each incoming request or intermediate state and sends it to exactly one of several downstream paths, based on rules, a classifier or a model decision.Established
Fan-out / Fan-inFan-out / fan-in splits work into independent parts that run in parallel, then waits at a join point to collect and combine their results before the workflow continues.Established
State MachineA state machine models a process as a finite set of named states and the allowed transitions between them, so that at any moment the process is in exactly one known state and only valid moves are possible.Established
DAGA DAG orchestrates tasks as a directed acyclic graph of dependencies: each task runs once its upstream tasks have succeeded, and independent branches can run in parallel.Established

Coordination

Divide responsibility between services, agents and people.

PatternDefinitionMaturity
SupervisorA supervisor is a central coordinator that breaks a task into sub-tasks, delegates each to a specialised worker, inspects the results and decides the next action until the task is done.Established
HandoffA handoff transfers ownership of an ongoing task or conversation from one agent or service to another, together with the context it needs, so that the receiver continues the work directly.Emerging
Human-in-the-loopHuman-in-the-loop pauses an automated workflow at a defined point until a person approves, rejects, edits or supplies input, then resumes with that decision as part of the workflow state.Established
Event ChoreographyEvent choreography coordinates services without a central controller: each service reacts to events it subscribes to and publishes new events, and the overall workflow emerges from these reactions.Established

Capability matrix

Which capabilities each pattern provides. Capabilities are the bridge between a requirement and a pattern.

PatternPersistent execution stateResume after failureAutomatic retriesFallback pathsCompensating actionsParallel executionResult aggregationDependency orderingRuntime branchingExplicit states and transitionsCentral delegationControl transferWait for external inputDecoupled coordination
Durable Execution●●●nonononononononono●no
Saga / Compensation●no●no●nonononononononono
Supervisornononononono●no●no●nonono
Routernononononononono●nonononono
Handoffnononononononono●nono●nono
Fan-out / Fan-innonononono●●nonononononono
Retry & Fallbacknono●●nononononononononono
Human-in-the-loop●nonononononono●nonono●no
State Machine●nonononononono●●nononono
DAGnono●nono●no●nononononono
Checkpointing●●nononononononononono●no
Event Choreographynonononono●nonononononono●
Capability definitions
Persistent execution state
Progress, variables and position in the workflow are stored outside process memory, so a crash does not lose where execution was.
Resume after failure
A stopped or crashed run continues from its last recorded point instead of starting over.
Automatic retries
Failed steps are re-attempted according to a declared policy (attempts, backoff, retryable errors) rather than ad hoc code.
Fallback paths
When a step keeps failing, execution switches to a declared alternative (another provider, model, cache or degraded answer).
Compensating actions
Each completed step has a declared undo action that is run in reverse order when a later step fails.
Parallel execution
Independent units of work run concurrently instead of one after another.
Result aggregation
Outputs from concurrent branches are collected and merged at a defined join point.
Dependency ordering
Steps start only when the steps they depend on have finished, as declared in an explicit dependency graph.
Runtime branching
The next step is chosen at runtime from the current state, input or classification result.
Explicit states and transitions
The set of valid states and the allowed transitions between them are declared up front and enforced.
Central delegation
One coordinator assigns sub-tasks to specialised workers and decides what happens with their results.
Control transfer
Ownership of the conversation or task moves from one agent or service to another, together with the context it needs.
Wait for external input
Execution pauses until an outside signal arrives (an approval, a callback, a human edit) without holding compute while it waits.
Decoupled coordination
Participants coordinate by publishing and reacting to events, with no single component owning the end-to-end flow.