Choreography coordinates distributed behavior through facts published by participants. Each service decides its own reaction; no central component sends every next-step command or owns the complete workflow state. This preserves service autonomy, but the end-to-end process emerges from subscriptions and event contracts.

Order Workflow

flowchart LR
    O[Order Service] -->|OrderPlaced| B[(Event Broker)]
    B -->|OrderPlaced| P[Payment Service]
    P -->|PaymentCharged| B
    B -->|PaymentCharged| I[Inventory Service]
    I -->|InventoryRejected| B
    B -->|InventoryRejected| P
    P -->|PaymentRefunded| B
    B -->|PaymentRefunded| O

The order service publishes OrderPlaced; payment reacts and publishes PaymentCharged; inventory then attempts a reservation. If inventory publishes InventoryRejected, payment reacts with a refund and the order service cancels the order. No participant alone owns the whole sequence, so event contracts, subscription ownership, and the allowed state transitions form the process definition.

Where It Fits

Choreography suits independent reactions and modest workflows: OrderPlaced can trigger email, analytics, and search indexing without introducing a coordinator. Its advantages are local ownership, natural fan-out, and the absence of a central workflow throughput dependency.

The costs appear as the graph grows. Cycles and hidden dependencies become difficult to reason about; an added subscriber can change load and timing; and no single record necessarily answers “where is order 42?” Duplicate, delayed, and reordered delivery require idempotent handlers, per-aggregate ordering rules where necessary, and durable outbox/inbox boundaries.

Observability must reconstruct a flow from event IDs, correlation and causation IDs, broker offsets, consumer lag, and domain state. Compensation is also choreographed: failure events trigger compensating handlers, so ownership and escalation for a failed refund or poison message must be explicit. Periodic reconciliation detects workflows whose expected successor event never arrived.

Boundary with Orchestration

Orchestration centralizes the state machine and next-step decisions. Move toward it when ordered branching, deadlines, compensation progress, or an operator-visible workflow status can no longer be recovered reliably from distributed state. Keep choreography when reactions are independent and no business invariant requires one owner of the sequence. Mixing the styles is normal: orchestrate the transaction, then choreograph reactions to its completed facts.

Questions

References