Sub-agents Node
Sub-agents are specialized agents that handle delegated tasks.Overview
Purpose: Delegate tasks to expert agents with different configurations Connection: Bottom center handle of main agent card Color: Purple Icon: π Required: Optional (0 to many)What are Sub-agents?
Sub-agents are independent agents with their own:- System prompts
- Model selection (Opus/Sonnet/Haiku)
- Skills and capabilities
- Permissions
When to Use Sub-agents
Use Case 1: Specialized Expertise
Example: Main coordinator agent + specialized sub-agents- Each sub-agent optimized for specific task
- Different system prompts per specialty
- Different model per task (Opus for code, Haiku for simple tasks)
Use Case 2: Different Models
Example: Fast triage + deep analysis- Fast initial processing
- Expensive model only when needed
- Cost optimization
Use Case 3: Isolated Permissions
Example: Read-only coordinator + write-enabled worker- Coordinator canβt accidentally modify files
- Write operations isolated and controlled
Sub-agent Structure
Sub-agents are defined as markdown files with YAML frontmatter:Creating Sub-agents
Via Settings β Node Managers β Sub-agents:- Click βAdd New Sub-agentβ
- Enter name (e.g., βSecurity Scannerβ)
- Choose model (Opus/Sonnet/Haiku)
- Write system prompt
- Configure permissions
- Save to workspace library
Configuration
When clicked on canvas:- Edit system prompt
- Change model selection
- Configure permissions
- Add skills (specific to this sub-agent)
- Set temperature and max tokens
Real-World Examples
Example 1: Multi-Stage Code Review
Main Agent (Coordinator):Example 2: Research Pipeline
Main Agent:- Web Researcher (Haiku) - Fast web scraping
- Fact Checker (Opus) - Deep verification
- Report Writer (Sonnet) - Balanced writing
Example 3: Customer Service Router
Main Agent:- Billing Specialist - Trained on billing policies
- Tech Support - Access to troubleshooting database
- General Support - Broad FAQ knowledge
Sub-agent Patterns
Pattern 1: Coordinator + Specialists
Structure:Pattern 2: Pipeline
Structure:Pattern 3: Parallel Processing
Structure:Best Practices
β Do:- Give sub-agents focused responsibilities
- Use appropriate models per task
- Clearly define sub-agent roles in system prompts
- Test sub-agents independently first
- Monitor costs (multiple agents = higher usage)
- Create too many sub-agents (complexity)
- Give overlapping responsibilities
- Use Opus for all sub-agents (cost)
- Skip testing coordination logic
Cost Optimization
Strategy:- Triage with Haiku (cheap, fast)
- Deep work with Opus (expensive, accurate)
- Balanced tasks with Sonnet (medium cost/quality)
Troubleshooting
Sub-agent not being called
Check:- Sub-agent connected to main agent card
- Main agent prompt mentions delegating to sub-agent
- Sub-agent name matches in prompt
Sub-agent gives unexpected results
Check:- Sub-agent system prompt is clear
- Sub-agent has necessary skills/permissions
- Sub-agent model appropriate for task