← Lessons

quiz vs the machine

Platinum1820

System Design

The Workflow Orchestration Engine

Coordinate multi step jobs with state, transitions, and compensation.

6 min read · advanced · beat Platinum to climb

Beyond a Single Job

A real process often chains steps: reserve inventory, charge a card, then ship. Wiring each step to enqueue the next becomes fragile and hard to observe. An orchestration engine owns the whole flow as one stateful entity.

Orchestration Versus Choreography

  • Orchestration uses a central coordinator that decides each next step. The flow is explicit and easy to inspect.
  • Choreography has each service react to events with no central brain. It is decoupled but the overall flow is implicit and hard to trace.

Orchestration is favored when you need clear visibility into multi step processes.

Durable State Machine

The engine records the current step and its result durably. After a crash it reloads the saved state and resumes from the right step rather than restarting from the beginning.

Compensation

Steps can have side effects that a later failure must undo. A compensating action reverses a completed step, such as refunding a charge if shipping fails. This is the saga approach to keeping a long flow consistent without one giant transaction.

Timeouts and Branching

The engine handles waits, conditional branches, and timeouts as first class concepts, so a step that stalls can route to an alternative path.

Key idea

An orchestration engine runs a multi step flow as a durable state machine with compensating actions, giving explicit visibility and recovery.

Check yourself

Answer to earn rating on the learn ladder.

1. How does orchestration differ from choreography?

2. What is a compensating action?

3. How does the engine recover after a crash?