Routing rules let you forward conversations to a specific agent based on conditions. Instead of every conversation going to the same agent, you can route billing questions to one agent, technical questions to another, and so on.
When routing rules make sense
Routing rules are useful when:
- You have multiple specialized agents (sales, support, technical) and want the right one to handle each conversation
- You want to hand off conversations to a human-support system outside business hours
- Certain keywords should always trigger a specific agent with deep knowledge on that topic
If you only have one agent, you don't need routing rules.
How routing rules work
Rules are evaluated in order from top to bottom. The first rule that matches determines where the conversation goes. If no rule matches, the conversation goes to the channel's default agent.
Each rule has:
- Conditions — what to check (message content, channel type, time, etc.)
- Action — which agent to route to when conditions match
Creating a routing rule
Go to your agent → Channels tab → select a channel → open the channel config → find the Routing Rules section.
Click Add Rule and configure:
Condition: Message contains
Match a keyword or phrase in the visitor's message. Example: billing, invoice, refund. Useful for routing financial questions to an agent that knows your billing policies.
Condition: Channel is Route based on which channel the conversation came through. Example: route all Telegram conversations to Agent A, all Gmail conversations to Agent B.
Condition: Time of day Route conversations based on the current time. Common use: route outside business hours to an "After hours" agent that sets expectations for response times.
Condition: Visitor attribute If you're passing visitor data through the widget API (like user plan or account type), you can route based on those attributes.
Multiple conditions on one rule
Within a rule, you can combine conditions with AND logic. Example: route if message contains "urgent" AND channel is Gmail. Both conditions must be true for the rule to trigger.
Rule order matters
If you have multiple rules, drag them to reorder. The first matching rule wins — so put your most specific rules at the top and your catch-all rules at the bottom.
Testing routing rules
After setting up rules, use the Test your agent button on your agent's detail page and send messages that should match your rules. Check which agent responds to verify the routing is working correctly.