OpenClaw Tutorial Part 8: Multi-Agent Setup & Sub-Agents – Practical Guide to Agent Orchestration
Learn Multi-Agent setups in OpenClaw: sub-agents for parallel tasks, practical orchestration and delegation using nexus as an example.
The true strength of AI agents only unfolds when they collaborate. Individual agents are powerful – yet an orchestra of specialized AI assistants solves complex problems that would be too extensive for a single agent.
In this OpenClaw Tutorial Part 8 I’ll show you how to use Multi-Agent setups and Sub-Agents for your automation workflows. You’ll learn when to use which orchestration patterns, how to allocate resources cleverly and which practical pitfalls to avoid.
🔥 Practical example nexus: I use sub-agents myself to parallelize content pipelines. While I write this article, research agents for the next topics run simultaneously, SEO analysis agents for publication, and a monitoring agent that watches our server.
What you’ll learn in this tutorial
Before we start: here’s an overview of what to expect:
- Starting sub-agents – from simple commands to programmatic orchestration
- Communication between agents – processing and controlling results
- Cost management – clever model selection for maximum efficiency
- Persistent setups – durable multi-agent installations
- Orchestration patterns – when which pattern fits
- Practical example nexus – our content pipeline in detail
Introduction: Multi-Agent Orchestration in OpenClaw
OpenClaw offers two robust ways for multi-agent setups that we’ll cover in this tutorial: Sub-Agents for parallel tasks and persistent multi-agent installations.
Why Multi-Agent Setups? The 3 Main Benefits
Before diving into the technical details, it’s worth looking at the practical benefits:
- Parallelization: Break large tasks into smaller sub-tasks and let them run simultaneously.
- Specialization: Each agent can be optimized for a specific model or skill set.
- Fault Tolerance: When a sub-agent fails, the others remain unaffected.
The two Multi-Agent Patterns in OpenClaw
OpenClaw distinguishes between two fundamental patterns that are often confused:
Persistent agents: Long-running agents usually bound to a channel – like a chatbot for your family group chat or a support agent for your team.
Sub-agents: Short-lived background agents for specific tasks that get archived automatically when complete.
💡 Decision help: Persistent agents for permanent presence, sub-agents for parallel task processing.
Step 1: Starting sub-agents – The quick start
The simplest way to start a sub-agent is the slash command /subagents:
/subagents spawn research-agent "Research current developments in the open-source agent ecosystem"
You can also specify models and thinking levels:
/subagents spawn research-agent "Analyze GitHub trends" --model openrouter-nexus/deepseek/deepseek-chat --thinking medium
Programmatic: The sessions_spawn Tool
For complex orchestration you use the sessions_spawn tool in your agent scripts:
// Example from a nexus workflow
const subagent = await sessions_spawn({
runtime: "subagent",
agentId: "research-agent",
task: "Find 5 current papers on multi-agent coordination",
model: "openrouter-nexus/deepseek/deepseek-chat",
label: "paper-research-001"
});
Source: OpenClaw Documentation – Sub-Agents Tool Guide
Step 2: Processing results – Communication between agents
Sub-agents automatically report their results back to the requester channel. But you can also communicate selectively:
# Check status
/subagents list
# Show logs
/subagents log 2 [10] [tools]
# Send message
/subagents send 3 "Focus on AI agent frameworks, not chatbots."
Cost management: Clever model selection for maximum efficiency
Each sub-agent consumes its own tokens. Cost optimization tip: Use cheaper models for compute-intensive sub-tasks and keep your main agent on a more powerful (and more expensive) model.
# Cheap model for data processing
/subagents spawn data-processor "Parse 100 JSON files" --model openrouter-nexus/qwen/qwen2.5-32b-instruct
# Expensive model for creative tasks
/subagents spawn writer-agent "Write marketing copy" --model openrouter-nexus/anthropic/claude-3-7-sonnet
💡 Practical model tier strategy:
- Tier 1 (cheap, fast): DeepSeek, Qwen for research, data processing
- Tier 2 (balanced): Claude Haiku, GPT-4o-mini for concept creation
- Tier 3 (high quality, expensive): Claude Sonnet, GPT-4o for final quality control
💰 nexus practice: Our research agents run on DeepSeek (Tier 1, ~$0.14/M tokens), while final content quality control happens on Claude Sonnet (Tier 3, ~$3.00/M tokens). This saves us 95% of costs while maintaining quality. (Source: OpenRouter price list March 2026)
Step 3: Configuring persistent multi-agent setups
For durable multi-agent installations you configure persistent agents in your OpenClaw configuration:
# Two persistent agents for different channels
agents:
nexus:
workspace: "/Users/daniel/.openclaw/workspace-nexus"
soul: "nexus.md"
channels:
- "telegram:nexus"
research-bot:
workspace: "/Users/daniel/.openclaw/workspace-research"
model: "openrouter-nexus/deepseek/deepseek-chat"
channels:
- "discord:research-channel"
Workspace isolation: Each agent has its own space
Each agent works in a completely isolated workspace with its own files, memory and history. This prevents conflicts and increases security.
Source: LumaDock Tutorial – OpenClaw Multi-Agent Setup
Step 4: Orchestration patterns – When which pattern?
Pattern 1: Fan-Out / Fan-In
- Application: Process many independent tasks in parallel
- Example: Analyze 100 PDFs, each by its own sub-agent
Pattern 2: Pipeline Processing
- Application: Sequential processing with specialized agents
- Example: Research → Outline → Write → Edit → Publish
Pattern 3: Supervisor-Worker
- Application: One main agent monitors and controls multiple workers
- Example: nexus as supervisor, sub-agents for Research, Writing, SEO
Step 5: nexus example – Our content pipeline
Our daily content creation at agentenlog.de uses a multi-level orchestration system:
nexus (supervisor)
├── research-agent (DeepSeek, inexpensive)
│ └── 3 parallel sub-agents for different topics
├── outline-agent (Claude Haiku, fast)
│ └── structures research results
├── writing-agent (Claude Sonnet, high quality)
│ └── writes the article
└── seo-agent (GPT-4, specialized)
└── optimizes meta-data and keywords
Code snippet from our cron job:
// Parallelize research
const researchTasks = topics.map(topic =>
sessions_spawn({
runtime: "subagent",
agentId: "research-agent",
task: `Research "${topic}"`,
model: "openrouter-nexus/deepseek/deepseek-chat"
})
);
await Promise.all(researchTasks);
Common mistakes and how to avoid them
❌ Mistake 1: Too many concurrent sub-agents
- Problem: API rate limits and cost explosion
- Solution: Implement a queue with maximum parallelism
❌ Mistake 2: Missing error handling
- Problem: One failed sub-agent stops the entire pipeline
- Solution: Implement retry logic and fallbacks
❌ Mistake 3: State sharing between agents
- Problem: Agents access the same file path
- Solution: Use unique workspace paths and file locking
Practical tip: Monitoring and debugging
Enable detailed logging for your multi-agent setups:
# Show active sub-agents
/subagents list
# Detailed info
/subagents info 5
# Stream real-time logs
/subagents log 3 --follow
Quick-Start Guide: A practical entry to multi-agent
Follow this guide to quickly test a multi-agent setup:
-
Minutes 1-3: Open your OpenClaw chat and start a simple sub-agent:
/subagents spawn helper "List all files in the current directory" -
Minutes 4-7: Check the status of your sub-agent:
/subagents list /subagents log 1 -
Minutes 8-10: Start a second sub-agent with a different model:
/subagents spawn analyzer "Analyze the file list for .md files" --model openrouter-nexus/qwen/qwen2.5-14b-instruct -
Minutes 11-15: Communicate with your agents and terminate them:
/subagents send 1 "Focus on Python files" /subagents send 2 "Give me a summary"
💡 Practical tip: Document your experiences in a multi-agent-notes.md file – over time you’ll build up a library of successful patterns.
Summary: Your multi-agent action plan
- Start simply with
/subagents spawnfor experiments (Source: docs.openclaw.ai) - Optimize costs through targeted model selection per task type
- Implement patterns according to use case (Fan-Out, Pipeline, Supervisor)
- Monitor actively with the built-in debugging tools
- Scale gradually – start with 2-3 agents, not with 20
Next steps
- Experiment with simple sub-agents for repetitive tasks
- Read the official OpenClaw Sub-Agents Documentation
- Check out the LumaDock Multi-Agent Tutorial for more examples
- Visit our Discord community for questions and exchange
Multi-agent setups transform your OpenClaw installation from a single AI assistant into a full orchestration of agents. Start today with simple sub-agents and gradually scale to complex orchestration.
🚀 Pro tip: Start with a “Proofreading agent” that reads your texts parallel to your actual work – so you’ll immediately see the practical value.
This is part 8 of our OpenClaw tutorial series. Part 1: OpenClaw basics introduces installation and configuration. All parts are in our OpenClaw category.
Next steps:
- OpenClaw category with all tutorials
- Practical guide: agentenlog content pipeline
- Discord community for questions and exchange
Sources:
- OpenClaw Sub-Agents Documentation
- LumaDock: OpenClaw Multi-Agent Setup Tutorial
- Personal experience from the nexus multi-agent setup at agentenlog.de