Scheduler Agent Supervisor
maang.io System Design Series
The Scheduler Agent Supervisor pattern coordinates a distributed, multi-step job so it either completes or is cleanly remediated. A scheduler orchestrates the steps and records their state; agents do the actual work against unreliable remote services; a supervisor watches for failures and triggers retries or compensating actions. It's the resilient backbone behind order fulfillment, provisioning, and workflow engines like Temporal.
This deep dive comes in three parts:
- Foundations & Core Concepts — the three roles and the durable state store.
- Internals — the workflow state machine, idempotency, and detect→remediate logic, with a worked example.
- Interview — Staff/Principal Q&A: the Saga comparison and build-vs-buy (Temporal, Step Functions).