Sub-Agent Orchestrator:
The Agent That Decides
In the parallel workshop, the fan-out was fixed โ all 3 agents always ran. In this workshop, the main agent reads the situation first and decides which sub-agents are needed. A $5k SMB lead gets 2 sub-agents. A $200k enterprise lead gets 5.
โ What is AI Agent Type 7 โ Sub-Agent Orchestrator?
A main orchestrating agent reads the input, classifies it, and dynamically spawns only the sub-agents the task actually requires. The branching is a runtime decision โ not pre-defined. Each sub-agent is a specialist; the orchestrator is the strategist that decides who to call.
Type 4 โ Parallel
Fan-out defined at build time. All 3 agents always run. Good when every task has identical structure.
Type 7 โ Orchestrator
Main agent decides at runtime. A simple lead gets 2 sub-agents. An enterprise deal gets 5. Only pays for what it needs.
When a new lead comes in, the orchestrator reads the lead data and decides how deep to research โ saving time and cost on low-value leads, while doing full due diligence on high-value ones.
| Sub-Agent | What It Does | When It Spawns |
|---|---|---|
| ICP Fit Agent | Score 0โ100 against your ideal customer profile definition | Always |
| Company Intel Agent | Funding stage, headcount, tech stack, growth signals | Deal > $10k |
| Buyer Persona Agent | LinkedIn role, tenure, past companies, recent posts | Title is VP+ |
| Competitor Usage Agent | Detect current tooling from job posts and tech signals | Enterprise flag |
| Email Draft Agent | Write personalised first email using all other agents' output | Always last |
- Claude Code installed โ run
npm install -g @anthropic-ai/claude-code - A terminal open and ready in a working directory
- You completed Type 4 (parallel workshop) โ or are ready to build fresh
Stage 1: Main Orchestrator Agent
Read the Lead, Decide the Depth
This is the brain of the system. It reads the lead data, classifies the deal tier, then writes a spawn plan โ a JSON file that tells the next stage exactly which sub-agents to run and why.
- Open your terminal and create a working directory:
cd ~/Desktop && mkdir lead-orchestrator && cd lead-orchestrator - Launch Claude Code:
claude - Copy the Stage 1 prompt below โ it includes a sample lead to analyse. Paste into Claude Code and hit Enter.
- Watch the orchestrator reason about the lead and produce a
spawn_plan.jsonwith its decision.
- Claude Code saved spawn_plan.json
- The terminal shows which agents were activated and why
- The spawn plan shows agents_to_run and agents_skipped lists
- Each agent has context_for_each_agent tailored to this specific lead
Stage 2: Sub-Agent Execution
Each Specialist Does Its Job
The sub-agents now execute based on the spawn plan from Stage 1. This prompt tells Claude Code to read the spawn plan, run each activated agent, and save their individual outputs โ ready for the email draft agent in Stage 3.
- output_icp_fit.json saved โ you can see a score and tier
- output_company_intel.json saved with Meridian Health data
- output_buyer_persona.json saved with Sarah Chen research
- output_competitor_usage.json saved with tool signals
- Terminal confirms each agent with a one-sentence key finding
Stage 3: Lead Brief & Email Agent
Assemble All Outputs Into One Deliverable
The email draft agent is the last to run โ it reads every sub-agent's output and synthesises them into a lead brief card and a personalised first email, ready to send from your CRM.
- lead_brief.html saved โ open in browser and confirm the orchestrator decision box is visible
- The brief shows which agents ran vs which were skipped and the reason
- first_email.txt saved โ subject line references Meridian's specific situation
- The email does not start with "Hope this email finds you well"
Workshop Complete!
Your Type 7 Sub-Agent Orchestrator qualified a lead adaptively โ spawning only the agents that deal warranted.
- In your terminal:
open lead_brief.htmlโ review the orchestrator decision box to confirm which agents ran and which were skipped - Open
first_email.txtโ check that the subject line and opening reference Sarah's specific context, not generic language - Now try changing the lead: edit the title to "Marketing Coordinator" and company size to "12 employees" in Stage 1. Re-run all 3 stages. The orchestrator should spawn fewer agents.
Connect to HubSpot
Trigger the orchestrator automatically when a new contact is created in your CRM via webhook.
Add a Scoring Rubric
Store your ICP definition in Notion and have the ICP agent fetch it dynamically โ so your scoring updates without code changes.
Auto-send the Email
Add a Stage 4 Gmail agent that sends the drafted email with a 2-hour delay and logs the send in CRM.
Multi-lead Batch
Wrap in a loop: feed 10 leads, the orchestrator decides depth per lead, all run in parallel per-lead, results saved to a sheet.
๐ Type 3 โ Sequential Pipeline
cal.com GitHub โ Analysis โ HTML Dashboard. Each stage hands off to the next.
โ Type 4 โ Parallel Execution
3 competitor agents run simultaneously. Merge + dashboard. Wall-clock time = slowest branch.
โ Type 7 โ Sub-Agent Orchestrator (this workshop)
Main agent reads lead, decides which sub-agents to spawn. Adaptive fan-out. Different leads get different depth.