logo

Orchestration in Async Systems

Orchestration is a coordination pattern where a single central controller manages the execution of multiple service calls. The controller decides which services to call, in what order, and how to handle failures at each step. Every participant reports back to the controller, giving you full visibility into the workflow’s progress.

How It Works

  1. A central controller receives a request and breaks it into discrete steps
  2. The controller dispatches each step as an async task to the appropriate service
  3. Each service processes its task and returns a result to the controller
  4. The controller tracks state, decides the next step, and handles errors
  5. If any step fails, the controller can retry, skip, or trigger compensation logic
Controller
├── Step 1: Validate Input ──→ Service A ──→ Result
├── Step 2: Process Data ──→ Service B ──→ Result
├── Step 3: Store Output ──→ Service C ──→ Result
└── Step 4: Send Notice ──→ Service D ──→ Done

Orchestration vs. Choreography

In orchestration, one controller holds the blueprint for the entire workflow. In choreography, each service listens for events and decides independently what to do next. Orchestration gives you centralized control and easier debugging. Choreography offers looser coupling but makes end-to-end visibility harder to achieve.

When to Use Orchestration

  • Multi-step workflows where the order of operations matters
  • Payment flows that require rollback if any step fails
  • Data pipelines that need centralized error handling and retries
  • Onboarding sequences where each step depends on the previous result

Considerations

  • Keep the controller stateless by persisting workflow state externally
  • Use timeouts for each step so a single slow service cannot block the entire flow
  • Add idempotency to every step so retries are safe after partial failures