Skip to content

Multi-Agent Routing: One Bot Per Channel

By default, OpenClaw runs a single agent. Every message from every channel goes to the same brain, the same workspace, the same personality. That works fine — until it doesn’t.

Maybe you want:

  • A professional assistant on WhatsApp and a casual bot on Discord
  • A family bot in the family group that’s sandboxed and limited
  • Multiple people sharing one Gateway with isolated agents
  • A fast model for daily chat and Opus for deep work

Multi-agent routing lets you run multiple isolated agents in one Gateway process. Each agent gets its own workspace, sessions, auth, and personality.

An agent is a fully isolated brain with:

  • Workspace — its own SOUL.md, AGENTS.md, USER.md, tools, and notes
  • State directory (agentDir) — auth profiles, model registry, per-agent config
  • Session store — separate chat history, no cross-talk
  • Skills — per-agent via workspace skills/ folder, plus shared skills from ~/.openclaw/skills

Auth profiles are per-agent. The main agent’s API keys aren’t shared automatically. If you want to share credentials, copy auth-profiles.json into the other agent’s agentDir.

Bindings are deterministic. OpenClaw picks one agent per inbound message using most-specific-wins:

  1. Exact peer match (specific DM/group/channel)
  2. Parent peer (thread inheritance)
  3. Guild + roles (Discord role routing)
  4. Guild (Discord)
  5. Team (Slack)
  6. Account (channel account ID)
  7. Channel (any account, accountId: "*")
  8. Default agent (first in list or default: true)

When multiple match fields are set on a binding, all must match (AND semantics).

Terminal window
openclaw agents add work
openclaw agents add home

Each agent gets its own workspace (~/.openclaw/workspace-<name>) with fresh SOUL.md, AGENTS.md, and USER.md.

Each agent typically needs its own bot account:

  • Telegram: Create one bot per agent via @BotFather
  • Discord: Create one application/bot per agent at discord.com/developers
  • WhatsApp: Link one phone number per agent

Edit ~/.openclaw/openclaw.json:

{
agents: {
list: [
{
id: "home",
default: true,
workspace: "~/.openclaw/workspace-home",
},
{
id: "work",
workspace: "~/.openclaw/workspace-work",
},
],
},
bindings: [
{ agentId: "home", match: { channel: "telegram", accountId: "default" } },
{ agentId: "work", match: { channel: "telegram", accountId: "work" } },
],
channels: {
telegram: {
accounts: {
default: { botToken: "HOME_BOT_TOKEN" },
work: { botToken: "WORK_BOT_TOKEN" },
},
},
},
}
Terminal window
openclaw gateway restart
openclaw agents list --bindings
openclaw channels status --probe

Pattern 1: WhatsApp Daily + Telegram Deep Work

Section titled “Pattern 1: WhatsApp Daily + Telegram Deep Work”

Route WhatsApp to a fast model for everyday chat, and Telegram to Opus for serious work.

{
agents: {
list: [
{
id: "chat",
name: "Everyday",
workspace: "~/.openclaw/workspace-chat",
model: "anthropic/claude-sonnet-4-5",
},
{
id: "deep",
name: "Deep Work",
workspace: "~/.openclaw/workspace-deep",
model: "anthropic/claude-opus-4-6",
},
],
},
bindings: [
{ agentId: "chat", match: { channel: "whatsapp" } },
{ agentId: "deep", match: { channel: "telegram" } },
],
}

Each agent has its own personality. The chat agent is snappy and short. The deep work agent is thorough and analytical. Different SOUL.md files, different vibes.

Two Discord bots in the same guild, each handling different channels:

{
agents: {
list: [
{ id: "main", workspace: "~/.openclaw/workspace-main" },
{ id: "coding", workspace: "~/.openclaw/workspace-coding" },
],
},
bindings: [
{ agentId: "main", match: { channel: "discord", accountId: "default" } },
{ agentId: "coding", match: { channel: "discord", accountId: "coding" } },
],
channels: {
discord: {
groupPolicy: "allowlist",
accounts: {
default: {
token: "MAIN_BOT_TOKEN",
guilds: {
"YOUR_GUILD_ID": {
channels: {
"GENERAL_CHANNEL_ID": { allow: true, requireMention: false },
},
},
},
},
coding: {
token: "CODING_BOT_TOKEN",
guilds: {
"YOUR_GUILD_ID": {
channels: {
"DEV_CHANNEL_ID": { allow: true, requireMention: false },
},
},
},
},
},
},
},
}

Remember: each Discord bot needs Message Content Intent enabled.

A dedicated agent for a family WhatsApp group, with restricted tools and sandboxing:

{
agents: {
list: [
{
id: "family",
name: "Family Bot",
workspace: "~/.openclaw/workspace-family",
identity: { name: "Family Bot" },
groupChat: {
mentionPatterns: ["@family", "@familybot"],
},
sandbox: {
mode: "all",
scope: "agent",
},
tools: {
allow: ["exec", "read", "sessions_list", "sessions_history"],
deny: ["write", "edit", "browser", "canvas", "nodes", "cron"],
},
},
],
},
bindings: [
{
agentId: "family",
match: {
channel: "whatsapp",
peer: { kind: "group", id: "YOUR_GROUP_ID@g.us" },
},
},
],
}

This agent:

  • Only activates when mentioned (@family)
  • Can’t write files, control browsers, or schedule cron jobs
  • Runs in a sandboxed container
  • Is bound to one specific WhatsApp group

Route different DMs to different agents on the same WhatsApp number:

{
agents: {
list: [
{ id: "alex", workspace: "~/.openclaw/workspace-alex" },
{ id: "mia", workspace: "~/.openclaw/workspace-mia" },
],
},
bindings: [
{
agentId: "alex",
match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551230001" } },
},
{
agentId: "mia",
match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551230002" } },
},
],
channels: {
whatsapp: {
dmPolicy: "allowlist",
allowFrom: ["+15551230001", "+15551230002"],
},
},
}

Note: both people share the same WhatsApp number, but each gets a completely isolated agent. DM access control is global per WhatsApp account (not per agent).

Pattern 5: Override One Peer to a Different Agent

Section titled “Pattern 5: Override One Peer to a Different Agent”

Keep WhatsApp on the fast agent, but route one specific DM to Opus:

{
bindings: [
// Peer bindings always win — keep them above channel-wide rules
{
agentId: "deep",
match: { channel: "whatsapp", peer: { kind: "direct", id: "+15551234567" } },
},
// Everything else on WhatsApp goes to the chat agent
{ agentId: "chat", match: { channel: "whatsapp" } },
],
}

Peer matches always win over channel-wide rules. Order matters only within the same tier.


When any agent has a heartbeat block, only those agents run heartbeats:

{
agents: {
defaults: {
heartbeat: { every: "30m", target: "last" },
},
list: [
{ id: "main", default: true }, // no heartbeat block → no heartbeats
{
id: "ops",
heartbeat: {
every: "1h",
target: "whatsapp",
to: "+15551234567",
},
},
],
},
}

Each agent can have different security postures:

{
agents: {
list: [
{
id: "personal",
sandbox: { mode: "off" }, // full host access
},
{
id: "shared",
sandbox: { mode: "all", scope: "agent" }, // sandboxed
tools: {
allow: ["read"],
deny: ["exec", "write", "edit"],
},
},
],
},
}
{
agents: {
list: [
{ id: "fast", model: "anthropic/claude-sonnet-4-5" },
{ id: "deep", model: "anthropic/claude-opus-4-6" },
],
},
}

Sometimes you want multiple agents to respond to the same group. Broadcast groups make this possible:

{
broadcast: {
strategy: "parallel",
"GROUP_ID@g.us": ["agent1", "agent2"],
},
}

Both agents run in parallel when a message comes into that group. Use this for logging agents alongside response agents, or when you want multiple perspectives.


Sharing agentDir across agents: Never reuse agentDir. Each agent needs its own state directory or you’ll get auth/session collisions.

Forgetting auth profiles: Each agent reads from ~/.openclaw/agents/<agentId>/agent/auth-profiles.json. If you want a new agent to use the same API keys, copy the auth profile file.

Binding order confusion: Within the same specificity tier, first match wins. Put specific bindings (peer matches) above general ones (channel matches).

Missing Message Content Intent: Discord bots need this enabled. Without it, your bot sees events but can’t read message content.


Terminal window
# Add a new agent (interactive wizard)
openclaw agents add <name>
# List agents with their bindings
openclaw agents list --bindings
# Check channel status
openclaw channels status --probe

Multi-agent routing is where OpenClaw stops being a chatbot and starts being infrastructure.