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.
| Pattern | Definition | Maturity |
|---|---|---|
| Durable Execution | Durable 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 / Compensation | A 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 & Fallback | Retry & 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 |
| Checkpointing | Checkpointing 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.
| Pattern | Definition | Maturity |
|---|---|---|
| Router | A 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-in | Fan-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 Machine | A 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 |
| DAG | A 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.
| Pattern | Definition | Maturity |
|---|---|---|
| Supervisor | A 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 |
| Handoff | A 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-loop | Human-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 Choreography | Event 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.
| Pattern | Persistent execution state | Resume after failure | Automatic retries | Fallback paths | Compensating actions | Parallel execution | Result aggregation | Dependency ordering | Runtime branching | Explicit states and transitions | Central delegation | Control transfer | Wait for external input | Decoupled coordination |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Durable Execution | ● | ● | ● | no | no | no | no | no | no | no | no | no | ● | no |
| Saga / Compensation | ● | no | ● | no | ● | no | no | no | no | no | no | no | no | no |
| Supervisor | no | no | no | no | no | no | ● | no | ● | no | ● | no | no | no |
| Router | no | no | no | no | no | no | no | no | ● | no | no | no | no | no |
| Handoff | no | no | no | no | no | no | no | no | ● | no | no | ● | no | no |
| Fan-out / Fan-in | no | no | no | no | no | ● | ● | no | no | no | no | no | no | no |
| Retry & Fallback | no | no | ● | ● | no | no | no | no | no | no | no | no | no | no |
| Human-in-the-loop | ● | no | no | no | no | no | no | no | ● | no | no | no | ● | no |
| State Machine | ● | no | no | no | no | no | no | no | ● | ● | no | no | no | no |
| DAG | no | no | ● | no | no | ● | no | ● | no | no | no | no | no | no |
| Checkpointing | ● | ● | no | no | no | no | no | no | no | no | no | no | ● | no |
| Event Choreography | no | no | no | no | no | ● | no | no | no | no | no | no | no | ● |
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.