Orchestration
Orchestration coordinates distributed workflows via a central orchestrator that invokes each service and handles branching and compensation. It gives central visibility for complex sagas at the cost of a coupling point.
Orchestration coordinates a multi-service workflow using a central component, the orchestrator, that holds the process definition and tells each service what to do and when. Unlike choreography, where the flow emerges from events, orchestration makes the process explicit and centrally controlled, like a conductor directing an ensemble. It is the other primary way to coordinate sagas and complex business processes.
How It Works
The orchestrator runs the workflow step by step. It invokes the first service, waits for the result, decides the next step based on that result, invokes the next service, and so on. It contains the branching logic, handles failures, and triggers compensating actions to undo earlier steps when something fails partway through. Communication can be synchronous request/reply or asynchronous via commands and reply events.
Because one component owns the process, the workflow's state and current position are visible in a single place, which simplifies monitoring and recovery. Workflow engines and frameworks (for example Camunda, Temporal, or AWS Step Functions) often implement this role.
Durable workflow engines persist the orchestrator's state after every step, so a crash resumes exactly where it left off rather than restarting or losing progress. They also handle timers, retries, and human-approval steps, and expose the current state of every running instance, which makes orchestration the natural fit for long-running, auditable business processes.
When to Use It
Use orchestration for complex workflows with many steps, conditional branches, and compensation logic, when you need central visibility into process state, or when explicit, centralized error handling matters. It makes intricate sagas tractable and observable.
For simple, linear flows where decoupling is paramount, choreography may be lighter and avoid a central dependency.
It is also the better choice when a process must be auditable end to end, because the orchestrator records each decision and transition in one authoritative place.
Trade-offs
Orchestration centralizes the workflow, making it easy to understand, monitor, and modify, but the orchestrator becomes a critical component and a potential coupling point and bottleneck that must be made resilient. It can drift toward holding too much business logic. Services become somewhat dependent on the orchestrator's commands. The benefit is clarity and control for complex processes. The discipline that keeps orchestration healthy is to let the orchestrator own sequencing and compensation while the services keep their own business rules, so the orchestrator stays a coordinator rather than a monolith.
Related Patterns
Orchestration is the alternative to Choreography for coordinating workflows, including the Saga pattern. It often uses a Transactional Outbox for reliable command/event delivery and resembles API Composition when it also aggregates results. Durable workflow engines implement it, and the Transactional Outbox makes its commands and replies reliable.
Example
An order saga is run by an orchestrator. It commands the payment service to charge; on success it commands inventory to reserve stock; on success it commands shipping to schedule delivery. If stock reservation fails, the orchestrator issues a compensating command to refund the payment and marks the order failed. The entire process, including its current step and outcome, is visible in the orchestrator.