Back to Blog

How OpenClaw Routes Messages Across Channels

March 10, 20267 min readMichael Ridland

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

When you're building AI agents that need to talk to people across multiple messaging platforms, routing is one of those problems that seems simple until you actually try to build it. A message comes in from WhatsApp. Which agent should handle it? Where does the reply go? What happens if the same person messages on Telegram too? What about group chats versus direct messages?

OpenClaw's channel routing system handles all of this, and having worked with it across several client deployments, I can say the design is genuinely well thought out. The official channel routing documentation covers the technical specifics, but let me walk through how it works in practice and what you need to know when setting it up.

The Basic Principle

OpenClaw's routing follows one straightforward rule: replies go back to the channel where the message came from. The model doesn't get to choose which channel to respond on. If someone messages your agent on WhatsApp, the reply goes to WhatsApp. If they message on Slack, the reply goes to Slack.

This sounds obvious, but it's actually a deliberate design choice. Some multi-channel frameworks try to let the AI decide where to respond, which creates all sorts of weird edge cases. Someone asks a question on Telegram and the bot replies on Discord because it thinks that's where the user "usually" is. OpenClaw avoids that entirely. Routing is deterministic and controlled by configuration, not by the model.

The channels OpenClaw supports out of the box are WhatsApp, Telegram, Discord, Slack, Signal, iMessage, and webchat. That covers the vast majority of what Australian businesses actually use for communication.

How Agent Selection Works

The more interesting question is: which agent handles an incoming message? OpenClaw supports multiple agents, each with their own workspace and session store, and the routing system matches inbound messages to agents using a priority-based set of rules.

Here's the order, from most specific to least specific:

  1. Exact peer match - You've configured a specific binding for a particular chat or user. "Messages from this WhatsApp number go to the support agent."
  2. Parent peer match - Thread inheritance. If a message is in a thread that started with a matched peer, it stays with the same agent.
  3. Guild + roles match - Discord-specific. Match based on the server and user's roles.
  4. Guild match - Discord server match without role filtering.
  5. Team match - Slack team matching.
  6. Account match - Match based on the channel account.
  7. Channel match - Any account on that channel type.
  8. Default agent - Fallback to the configured default, or the first agent in the list.

In practice, most setups only use a few of these levels. A typical configuration might look like: "Slack messages from our company workspace go to the internal-support agent, WhatsApp messages go to the customer-support agent, everything else goes to the general agent."

The config for this is clean. Here's a simplified example:

{
  "agents": {
    "list": [
      { "id": "internal-support", "name": "Internal Support" },
      { "id": "customer-support", "name": "Customer Support" },
      { "id": "general", "name": "General", "default": true }
    ]
  },
  "bindings": [
    { "match": { "channel": "slack", "teamId": "T123ABC" }, "agentId": "internal-support" },
    { "match": { "channel": "whatsapp" }, "agentId": "customer-support" }
  ]
}

When multiple match fields are present in a binding (say, both a channel and a team ID), all of them must match for that binding to apply. This prevents accidental routing when you have specific configurations for different contexts.

Sessions and Context Management

Each agent maintains its own session store, and OpenClaw uses a key-based system to keep conversations separated. The session key format varies by context:

  • Direct messages collapse into the agent's main session: agent:main:main
  • Group chats get isolated: agent:main:telegram:group:-1001234567890
  • Threads extend the parent key: agent:main:discord:channel:123456:thread:987654
  • Telegram forum topics have their own format: agent:main:telegram:group:-1001234567890:topic:42

This is important because it determines what context the agent has when responding. In a group chat, the agent sees the history of that specific group. In a direct message, it sees the DM history. Threads inherit from their parent context.

One subtle feature worth knowing about is DM route pinning. When you configure an agent to use a single main session for direct messages (dmScope: main), there's a risk that different people's DMs could overwrite each other's routing information. OpenClaw handles this by inferring a pinned owner from the allowFrom configuration. If you've configured the agent to only allow messages from one specific user, OpenClaw won't let other users' DMs overwrite the session's reply route. It's the kind of edge case that you'd only discover after deploying to production, so it's good that it's handled automatically.

Broadcast Groups - Running Multiple Agents on the Same Message

This feature is one of my favourites, and it's something most other frameworks don't support natively. Broadcast groups let you run multiple agents against the same incoming message.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

The practical use case: you have a WhatsApp group for customer support. You want your support agent to respond to questions, but you also want a logging agent to record every conversation for compliance purposes. Or you want a primary agent to handle the response and a secondary agent to flag any messages that need human escalation.

{
  "broadcast": {
    "strategy": "parallel",
    "[email protected]": ["support", "logger"],
    "+15555550123": ["primary", "escalation-checker"]
  }
}

The parallel strategy runs both agents at the same time. This is cleaner than trying to chain agents together or building custom middleware to duplicate messages.

We've used this pattern for a client who needed every customer interaction logged and analysed for sentiment, while still providing immediate automated responses. The support agent handled the reply; the analytics agent processed the message in the background without the customer ever knowing.

WebChat and Cross-Channel Context

WebChat in OpenClaw attaches to a selected agent and defaults to that agent's main session. What makes this useful is that it shows cross-channel context - you can see what's been happening with that agent across all channels in one place.

For support teams, this means you can open the webchat interface and see the full history of an agent's interactions, regardless of whether they came from WhatsApp, Telegram, or Slack. It's a simple but practical operational feature.

Reply Context Across Channels

When someone replies to a specific message (quoting it), OpenClaw preserves that context across all supported channels. The inbound message includes ReplyToId, ReplyToBody, and ReplyToSender, and the quoted content is appended to the message body as a [Replying to ...] block.

This consistency matters because reply context is how people naturally reference previous parts of a conversation. Without it, the agent would see a message that says "Yes, do that" with no idea what "that" refers to. With it, the agent can see the full context of what's being confirmed or discussed.

Practical Setup Advice

Having deployed OpenClaw across several organisations, here are things that trip people up:

Start simple. Don't try to configure bindings for every possible channel combination on day one. Start with one channel and one agent, get it working, then add complexity. The default agent fallback means any unconfigured channels still get handled.

Be explicit with multi-account setups. If you have multiple accounts on the same channel (say, two different WhatsApp numbers for different business units), set an explicit defaultAccount. Without it, OpenClaw falls back to the first normalised account ID, which might not be what you expect.

Test thread inheritance. If you're using Discord or Slack where threads are common, make sure you understand how thread sessions relate to their parent. A thread inherits the parent's agent binding, which is usually correct, but can surprise you if the thread drifts into a different topic area.

Monitor session storage. Sessions are stored as JSON under ~/.openclaw/agents/<agentId>/sessions/. For busy deployments, these files can grow. Have a plan for archiving or rotating old session data.

Where This Fits for Australian Businesses

Multi-channel communication is becoming standard for Australian organisations. Your customers are on WhatsApp, your team is on Slack or Teams, your community might be on Discord. Having AI agents that can operate across all of these channels with consistent routing and context management is genuinely valuable.

We've been deploying OpenClaw for clients through our managed service offering, and the channel routing system is one of the features that makes it practical for real business use. If you're exploring how AI agents could work across your communication channels, our AI agent development team can help you design and implement a setup that fits your specific requirements. For organisations just getting started with AI agents, our agentic automations service is a good place to begin understanding what's possible.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.