Skip to main content

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
Main agent delegates tasks → Sub-agent executes → Returns results

When to Use Sub-agents

Use Case 1: Specialized Expertise

Example: Main coordinator agent + specialized sub-agents
Benefits:
  • 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
Benefits:
  • Fast initial processing
  • Expensive model only when needed
  • Cost optimization

Use Case 3: Isolated Permissions

Example: Read-only coordinator + write-enabled worker
Benefits:
  • 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:
  1. Click “Add New Sub-agent”
  2. Enter name (e.g., “Security Scanner”)
  3. Choose model (Opus/Sonnet/Haiku)
  4. Write system prompt
  5. Configure permissions
  6. Save to workspace library
Sub-agent appears in sidebar → drag to canvas.

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):
Sub-agent 1 (Security):
Sub-agent 2 (Performance):
Sub-agent 3 (Style):

Example 2: Research Pipeline

Main Agent:
Sub-agents:
  • Web Researcher (Haiku) - Fast web scraping
  • Fact Checker (Opus) - Deep verification
  • Report Writer (Sonnet) - Balanced writing

Example 3: Customer Service Router

Main Agent:
Sub-agents:
  • 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:
Use case: Complex tasks requiring multiple specialties

Pattern 2: Pipeline

Structure:
Use case: Sequential processing with different models

Pattern 3: Parallel Processing

Structure:
Use case: Process multiple items simultaneously

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)
❌ Don’t:
  • Create too many sub-agents (complexity)
  • Give overlapping responsibilities
  • Use Opus for all sub-agents (cost)
  • Skip testing coordination logic

Cost Optimization

Strategy:
  1. Triage with Haiku (cheap, fast)
  2. Deep work with Opus (expensive, accurate)
  3. Balanced tasks with Sonnet (medium cost/quality)
Example:
Savings: 50-70% vs. using Opus for everything

Troubleshooting

Sub-agent not being called

Check:
  1. Sub-agent connected to main agent card
  2. Main agent prompt mentions delegating to sub-agent
  3. Sub-agent name matches in prompt

Sub-agent gives unexpected results

Check:
  1. Sub-agent system prompt is clear
  2. Sub-agent has necessary skills/permissions
  3. Sub-agent model appropriate for task

Next Steps