Orchestration vs Choreography Explained
On this page
Learning Objective
Distinguish orchestrated from choreographed coordination, choose between them on the basis of workflow complexity and organizational boundaries rather than aesthetics, and recognize the failure modes each produces as a system grows.
Concept Explanation
Once a workflow spans several services, there are exactly two ways to coordinate it. In choreography, each service listens for events and decides independently what to do next; the workflow is an emergent property of everyone's subscriptions and exists in no single place. In orchestration, a coordinator holds the workflow definition, calls each participant in turn or sends it a command, and tracks progress centrally; the workflow is an explicit artifact you can read.
Choreography is genuinely decentralized and that is both its strength and its cost. Adding a participant means writing a subscriber and deploying it, with no change to anything else, which is the maximal expression of team autonomy. But nobody can answer the question of what the order process actually is without reading the subscriptions of every service involved, and nobody can answer where a given order is stuck without correlating logs across all of them. The hardest problem is that there is no natural place to put the compensation logic for a failure at step four, since step one's service has no idea that step four exists.
Orchestration puts the workflow in one place, which makes it visible, testable, and modifiable as a unit. The orchestrator knows which step each instance is on, which makes monitoring and operator intervention straightforward, and it is the natural home for compensation, timeouts, and retry policy. The objection raised against it is that it is a central point of coupling and of failure. The coupling objection has force when the orchestrator is written to know the internals of each participant; it has much less force when the orchestrator sends commands to a service's public interface, which is a normal dependency of the sort every system has. The failure objection is largely answered by modern durable execution engines, which persist workflow state and resume after a crash.
The practical decision rule is about the number of steps and about who owns them. Two or three steps with no compensation, all of them simple reactions to a fact, are well served by choreography and an orchestrator would be ceremony. Five or more steps with conditional branching, timeouts, and compensations are unmanageable as choreography, because the workflow exists only in the aggregate of everyone's subscriptions and cannot be reasoned about. A useful test is whether you can draw the current workflow on a whiteboard from memory: if you cannot, and no single piece of code contains it, the workflow has become emergent and is already difficult to change safely.
The organizational dimension matters as much as the technical one. Choreography suits a workflow entirely inside one team's boundary, or a genuine fan-out where each consumer reacts independently to a fact and no coordination is needed. Orchestration suits a workflow that crosses team boundaries and has a business owner, because the orchestrator becomes the artifact that expresses the process the business cares about, in a place that can be versioned and reviewed. The common mature pattern is a hybrid: orchestrate the core transactional workflow with explicit steps and compensations, and let peripheral concerns, analytics, notifications, search indexing, recommendations, choreograph freely off the events the workflow emits.
| Dimension | Choreography | Orchestration |
|---|---|---|
| Where the workflow lives | Distributed across every subscriber | In one explicit, readable definition |
| Adding a participant | Deploy a subscriber; nothing else changes | Change the workflow definition |
| Answering where an instance is stuck | Correlate traces across every service | Query the orchestrator for the current step |
| Compensation logic | No natural home; must be spread around | Naturally belongs to the coordinator |
| Coupling | Everyone couples to the event schema | Participants couple to the orchestrator contract |
| Failure concentration | No central point; failures are local | Orchestrator is central, mitigated by durable execution |
| Sweet spot | Two or three steps, fan-out, one team | Five or more steps, branching, timeouts, compensation |
Worked Example: The Same Workflow Both Ways
The choreographed version reads cleanly with three steps and becomes unreadable at seven. The orchestrated version states the process in one place, including what happens when it fails.
// ===== CHOREOGRAPHY: the workflow exists nowhere and everywhere. =====
// payment-service.js
onEvent('OrderPlaced', (e) => capturePayment(e).then(() => publish('PaymentCaptured', ...)));
// inventory-service.js
onEvent('PaymentCaptured', (e) => reserveStock(e).then(() => publish('StockReserved', ...)));
// shipping-service.js
onEvent('StockReserved', (e) => dispatch(e).then(() => publish('ShipmentDispatched', ...)));
// Now the questions that have no good answer:
// - What is the order workflow? Read four repositories and infer it.
// - Stock reservation failed. Who refunds the payment? The inventory service
// must now know that a payment happened, which couples it to a step it is
// not part of, or a new subscriber must exist solely to compensate.
// - Order 9f12 is stuck. Which step is it on? Correlate logs across services.
// - A timeout is needed on step three. Where does that timer live?
// ===== ORCHESTRATION: the workflow is an artifact you can read and test. =====
const orderWorkflow = defineWorkflow('PlaceOrder', {
steps: [
{ name: 'reserveInventory',
command: (c) => inventory.reserve(c.orderId, c.items),
compensate: (c) => inventory.release(c.orderId),
timeout: '30s', retries: 3 },
{ name: 'capturePayment',
command: (c) => payments.capture(c.customerId, c.totalCents),
compensate: (c) => payments.refund(c.orderId, c.totalCents),
timeout: '60s', retries: 5 },
{ name: 'dispatchShipment', pivot: true,
command: (c) => shipping.dispatch(c.orderId, c.address),
timeout: '5m', retries: 10, onExhausted: 'escalate' },
],
onCompensated: (c) => notifications.orderFailed(c.customerId, c.orderId),
});
// Everything the choreographed version could not answer is now a property of
// one definition: the sequence, the timeouts, the retry counts, who compensates
// what, and what happens when compensation is impossible. And the peripheral
// consumers still choreograph freely off the events this workflow emits:
// analytics, search indexing, and recommendations all subscribe to
// ShipmentDispatched without the orchestrator knowing they exist.Real-World Examples
- Uber built Cadence, later continued as the open-source Temporal project by its original authors, specifically to solve the problem of long-running, multi-step workflows that were being implemented as ad hoc choreography and becoming impossible to operate. Their stated motivation was the inability to answer where a given workflow instance was and why it had stalled, which is precisely the operational failure mode of choreography at scale, and durable execution answers it by persisting workflow state so the process survives crashes and remains inspectable.
- Netflix Conductor was open-sourced in 2016 for much the same reason: the company had many multi-step processes spanning services, and the team described the difficulty of tracking progress, handling failures, and modifying a flow when the flow existed only as an implicit chain of event subscriptions. Both projects are direct evidence for the rule in this lesson, that choreography degrades as step count and failure handling requirements grow, and that the degradation shows up first in operations rather than in development.
Review Questions & Answers
Because compensation requires knowledge of steps that have already completed, and in choreography no participant has that knowledge. If inventory reservation fails at step three, someone has to refund the payment taken at step two, but the inventory service has no reason to know that a payment occurred, and the payment service has no reason to know that inventory reservation exists or that it failed. The available options are all poor: make participants aware of steps they are not part of, which destroys the decoupling that motivated choreography, or introduce a separate compensation subscriber that tracks the whole flow, which is an orchestrator that has not been named as one.
The strongest argument is that the orchestrator becomes a central point of coupling and failure: every workflow change goes through it, it must know about every participant, it becomes a bottleneck for team autonomy, and if it is down no workflow progresses. The strongest answer has two parts. On coupling, an orchestrator that sends commands to participants' public interfaces depends on them exactly as any client does, which is an ordinary dependency rather than a special one, and the alternative, participants knowing about each other's steps, is more coupling rather than less. On failure, durable execution engines persist workflow state so a crashed orchestrator resumes from its last recorded step rather than losing in-flight work.
Because the cost of choreography grows nonlinearly with the number of steps while its benefit does not. At two or three steps the workflow is still comprehensible from the event names alone, no compensation chain is needed, and autonomy is a real gain. At seven steps with branching and timeouts, the number of interactions a reader must hold in mind grows far faster than the step count, failure handling requires knowledge that no single participant has, and nobody can determine the state of an instance without cross-service correlation. Decentralization as a value does not change that arithmetic; it just makes teams slower to admit they have crossed the line.
Orchestrate the core transactional workflow, the steps that must happen in order, that can fail, and that require compensation, in an explicit definition owned by the team that owns the business process. Let everything peripheral choreograph off the events that workflow emits: analytics, search indexing, notifications, recommendations, data warehouse loading, and any future consumer nobody has thought of. It is the right end state because the two halves have genuinely different requirements. The core needs visibility, ordering, timeouts, and compensation, which orchestration provides. The periphery needs to be added and removed without anyone coordinating, which choreography provides, and those consumers neither participate in the transaction nor need compensating.