Agents can delegate to other agents. Sub-agents are just another type of tool.
Why Sub-Agents?
Complex tasks benefit from specialization:
code
1Main Agent2├── Research Agent (gathers information)3├── Writing Agent (creates content)4└── Editor Agent (reviews and polishes)Each focuses on what it does best.
How to Add a Sub-Agent
Sub-agents are added through the unified Tools tab:
- Open your agent's settings
- Go to the Tools tab
- Click Add Tool → Agent Tool
- Select another agent
The main agent can now delegate to it.
How Delegation Works
code
1You: Write a blog post about AI trends2 3Main Agent: I'll delegate this.4 [Calling research-agent: "Find AI trends 2024"]5 [Calling writing-agent: "Write post about these trends"]6 [Calling editor-agent: "Review and polish"]7 8 Here's your blog post!Each sub-agent:
- Receives the task from the parent
- Works independently using its own tools
- Returns results via the
finishtool
Sub-Agent Results
When a sub-agent completes, it calls finish with:
- status: succeeded, failed, or cancelled
- result: the output to send back
The parent agent receives this and continues.
Nested Agents
Sub-agents can have their own sub-agents:
code
1Orchestrator2└── Project Manager3 ├── Developer Agent4 │ └── Code Review Agent5 └── Designer AgentKeep nesting shallow for clarity.
When to Use Sub-Agents
- Complex workflows with distinct phases
- Specialized expertise for different tasks
- Reusable components across multiple agents
When NOT to Use Sub-Agents
- Simple tasks a single agent can handle
- When an app tool would suffice
- Over-engineering for its own sake
Start without sub-agents. Add them when you need specialization.