When running multiple agents in a single OpenClaw gateway, the routing system decides which agent handles each incoming message. Agent bindings define these rules through an eight-tier priority hierarchy evaluated from most specific (peer) to least specific (default). This lets you build sophisticated routing topologies -- a triage agent that classifies and forwards, role-based routing within a Discord server, or region-specific agents bound to different WhatsApp numbers.
Master openclaw multi-agent routing
Take the OpenClaw for Production & Advanced Use course with hands-on lessons and challenges.
Three agents with different binding types. A message from a developer in the Discord engineering server matches the guild+roles binding (tier 3), routing to code-reviewer. A message from the WhatsApp support line matches the account binding (tier 6), routing to support-bot. Everything else falls through to the default binding (tier 8).
The triage agent receives all messages (default binding) and uses a cheap, fast model for classification. It routes billing questions to the billing specialist and technical issues to the technical specialist. Specialists use more powerful models with domain-specific tools. This pattern is cost-effective and produces better responses than a single generic agent.
Team Alpha uses Discord with the coder agent. Team Beta uses Slack with the support agent. Workspaces ensure that Team Alpha's messages, sessions, and agent memory are completely isolated from Team Beta's. Both operate within the same Gateway process but cannot see each other's data.
The eight tiers are evaluated top-to-bottom. Peer bindings are the most specific because they represent direct agent-to-agent communication. Default is the catch-all. If a message matches a guild+roles binding at tier 3, account and channel bindings at tiers 6-7 are never checked.
Routing rules are evaluated top-to-bottom with first-match-wins semantics. Discord admins get the admin-bot, other Discord users get the general-bot, and WhatsApp users get the support-bot. Order matters: if the two Discord rules were swapped, admins would match the general rule first and never reach the admin-specific rule.
Forgetting to define a default binding, causing messages that do not match any specific binding to be silently dropped
Always define at least one agent with a default binding. This acts as a catch-all and ensures no message goes unanswered. Even a simple 'I can't help with that, try asking a specific agent' is better than silence.
Creating overlapping bindings at the same tier without realizing that the first-defined binding wins silently
Audit your bindings for overlaps within the same tier. If two agents bind to the same guild without roles, the first one wins and the second is silently ignored. Use roles or more specific binding types to differentiate.
Assuming agents share memory or sessions in a multi-agent setup when they are actually fully isolated
Each agent has its own workspace, memory, and sessions. If you need shared knowledge between agents, set up explicit shared paths or use a shared knowledge base tool.
Using a powerful expensive model for the triage agent when it only needs to classify message intent
The triage agent does simple classification -- it does not need Claude Sonnet. Use GPT-4o-mini or a similar lightweight model for triage. Reserve powerful models for specialist agents that do the real work.
OpenClaw's multi-agent routing directs messages to specialized agents via an eight-tier priority hierarchy. Bindings map message context (peer, guild, account, channel) to specific agents. The triage pattern uses a cheap classifier agent to route to expensive specialists. Workspaces provide logical isolation for multi-tenant setups. Each agent has a fully isolated workspace. Always define a default binding, use the most specific binding types, and document your routing topology.
Interactive lessons and challenges on Stanza, practice in VS Code, Cursor, or the web.
Interactive lessons and challenges, right in your code editor.
Check the free courses. No credit card.