My supervisor-worker agent pattern fixed the dumbest bug in my automation stack at 1:13 AM
Description and use
The supervisor-worker pattern fixed the refund bug, improved traceability, and simplified the automation stack.
Problem
A single, monolithic agent performed multiple tool calls in a chaotic order, causing a refund email to be drafted before Stripe eligibility checks completed, leading to failures and hard-to-debug sequencing bugs.
Outcome
The supervisor-worker pattern eliminated the refund bug, improved traceability, and made the automation stack easier to reason about under pressure.
Workflow
- 1. Supervisor receives task and checks state
- 2. If not enriched, hand off to enrichment worker
- 3. Enrichment worker fetches Stripe/CRM data and marks state as enriched
- 4. Supervisor routes to validation worker
- 5. Validation worker checks refund policy, sets eligibility and approved_for_execution flags
- 6. Supervisor routes to drafting worker
- 7. Drafting worker generates email if eligible, else drafts explanation
- 8. Supervisor routes to execution worker
- 9. Execution worker sends email or updates CRM
- 10. Supervisor ends workflow
Evidence
That change fixed more than the refund bug. It made the whole automation stack easier to reason about.
One giant tool‑calling agent works just long enough to feel smart.
- Record date: 2026-09-19T21:15:24.930Z