Orchestration and Choreography
Introduction
Using messages to drive Workflows leads to two quite different patterns.
In Choreography, services listen out for and react to events as they happen. A chain of reactions and notifications provides a distributed implementation of a Workflow. Choreography is useful for simple tasks invoked in response to some event (like sending an email) - but is not suited to complex Workflows.
In Orchestration, services provide a command interface. One service commands the other services to perform actions within a locally defined Workflow. Orchestration is useful for complex or multi-stage workflows - but is not required if a simple reaction is sufficient.
For illustration purposes only (this is not a design), consider the Pros and Cons of implementing a Payment Workflow using Choreography and Orchestration.
Choreographed Events

The example above illustrates a typical Event Chain implementing a payment process :
- The Disbursement Service publishes an event to initiate a payment.
- The Ledger Service is triggered by a payment initiation event, debits the account, and publishes a status (balance ok / not ok)
- The Anti Money Laundering (AML) Service is triggered by the ledger event, checks the AML status of the beneficiary and publishes a status (AML ok / not ok)
- The Payment Execution Service is triggered by the AML event, executes the payment and some time later publishes the payment execution status (payment execution ok / not ok)
The Workflow is distributed and encoded in the chain of events.
Changing a Choreographed Workflow

Assume we want to make a simple change to the workflow and we now want to do an AML check before debiting the ledger (not after).
This simple change involves coordinated updates to three services :
- The AML Service now needs to consume events from the Disbursement Service
- The Ledger Service now needs to consume events from the AML Service
- The Payment Execution Service now needs to consume events from the Ledger Service
Benefits of Choreography
- Services are loosely coupled and operate independently without a dependency on a central coordinator.
- Simple solution for simple tasks.
Downsides of Choreography
- Choreographed workflows span multiple services and are difficult to implement, understand, observe, test and debug.
- Small changes to a Choreographed workflow can involve many changes to many services at the same time.
- The implementation does not clearly document the workflow.
- A reacting service needs to know about the internals of other Domains and services. In the above example, the Payment Execution Service needs to know about the Ledger Service and the AML Service… and any other service that requires payment execution.
Orchestration and Command Events

The example above illustrates a Payment Service which Orchestrates other services to fulfil a Payment :
- The Disbursement Service publishes a Payment Command Event to initiate the Payment process.
- The Payment Service implements the Workflow by sending commands to the implementation services and waiting for
responses. It :
- Debits the Ledger
- Does an AML check
- Executes the Payment
The trigger for the Workflow uses Choreography - but the remainder of the Workflow process is defined and executed within the Payment Service.
Changing an Orchestrated Workflow
Changing the Workflow to do an AML check before debiting the ledger - is simple.
It is a small code change in one service.
Benefits of Orchestration
- Simpler to implement, understand, observe, test and debug.
- Much simpler to change.
- The implementation documents the Workflow.
- The orchestrator allows the use of higher level tools for defining workflows
- Services are encapsulated and do not need to know about the ‘outside’
Downsides of Orchestration
An additional service is required for the Orchestrator
Summary
Scenarios for using Choreography
When an Event triggers a simple related task that can be completed independently. For example, sending an email or replicating data into another database, etc.
For triggering orchestrated workflows.
Scenarios for using Orchestration
When implementing any workflow, especially a multi-stage workflow with decision points and error handling.
When implementing any process that may change over time.
References
- Practical Process Automation: Orchestration and Integration in Microservices and Cloud Native Architectures - Bernd Ruecker
- Orchestration vs Choreography