New here? Start this series at Day 43: Hierarchy helps only where authority really has layers
- Day 43: Hierarchy helps only where authority really has layers
- Day 44: Dynamic dispatch needs visible routing and one final owner
- Day 45: Pipelines make AI handoffs inspectable, so start there
- Day 46: Peer agents need protocols, not vibes
- Day 47: Shared state needs structure, attribution and versions
- Day 48: AI debate is only as good as its judge
Some workloads refuse to be planned in advance. You cannot know whether a request needs three subtasks or thirty until you are inside it.
That is what the orchestrator-worker pattern is for. The orchestrator reads the request, invents the subtasks at runtime, and dispatches each to whichever qualified worker is free. The same architecture handles ten documents today and three hundred tomorrow.
Dispatching is the easy half
The engineering lives in the bookkeeping, and this is where implementations quietly fail:
- Orphaned tasks. A worker dies mid-task and nothing notices. Every dispatched task needs an owner of record and a lease (a timeout the worker renews with a heartbeat), or work simply evaporates and the orchestrator waits forever for a result that is never coming.
- Duplicate execution. Retries, and leases that expire on workers that were merely slow, make execution at-least-once. At-least-once plus non-idempotent tasks equals the email sent twice, the refund issued twice. Design tasks to be safely re-runnable, with an idempotency key on every side-effecting call, before you scale the fan-out.
- Reconciliation. Results arrive out of order, partially failed, occasionally contradicting each other. Integrating that into one coherent outcome is the orchestrator's actual job, and it is where the real engineering time goes.
- Spec drift. Dynamically generated task descriptions degrade under unusual inputs in ways static pipelines never do. Sample them and read them periodically. A task spec that made sense for the last thousand requests can be nonsense for the next one.
Make routing explainable
The failure that hurts most in production is the unexplainable dispatch. Nobody can say why worker C was chosen, so nobody can fix it when C was the wrong choice.
Log the routing decision and the signal behind it alongside the outcome. "Routed to the SQL worker because the query mentioned an order ID" is debuggable. "Routed to the SQL worker" is a black box that will cost you an afternoon every time it misroutes.
Choose it deliberately
As a rule of thumb, if you can enumerate the stages on a whiteboard, build a pipeline. Static structure is easier to trace, cheaper to run, and far easier to reason about.
Reach for dynamic dispatch when the work genuinely refuses enumeration, as with variable-size batches, unpredictable subtask types, or load that fluctuates enough that fixed workers are either idle or overwhelmed.
Kill a worker on purpose
Runtime dispatch arrives bundled with distributed-systems problems a fixed pipeline does not have, so test for them directly. In staging, kill one worker mid-task and stall another past its lease, then check whether both tasks finished and whether any side effect fired twice. An unfinished task is an orphan; a refund issued twice means your retries are not idempotent.
Terms in this piece
About this explainer
- Format
- Explainer
- Level
- Practitioner
- Read
- 2 min read
- Published
- Jul 5, 2026
- Disciplines
Short mental models: one idea, why it matters, what to do about it.
More on these topics
Deep dive · · 7 min read
Adding a second agent does not add intelligence, it adds a contract
Six posts on multi-agent systems, and the failures were never inside an agent. They were between two of them.
Deep dive · · 7 min read
Six ways to wire agents together, and the same three things break every time
The topology gets all the design attention. Ownership, termination and traceability are what decide whether it survives contact with production.
Deep dive · · 7 min read
Most agent controls do not actually control anything
Six days of notes on supervising autonomous systems, and the same failure shape kept turning up: the control exists, it is documented, and nothing in the running system is bound by it.
Discussion