Agent team (router)
The Agent team (router) lets you run several specialist agents in a single chat — for example Sales, Workshop and Admin — instead of one agent that must know everything. One agent answers by default and, when the user’s request belongs to another area, it hands off to the right specialist. The user never loses the thread: everyone shares the same conversation and memory; each one answers with its own context (its system prompt, its RAG and its tools).
How handoff works
Section titled “How handoff works”The answering agent is offered, on top of its own tools, some handoff tools (one per teammate). When the model detects the topic is not its own, it calls the matching handoff; the router switches agents and answers the same message again with the right specialist (a real answer, not a “transferring you”). The active agent is remembered across messages until another handoff happens. There’s a cap on hops per turn to avoid infinite bouncing.
Where it goes in the workflow
Section titled “Where it goes in the workflow”telegramReceive → Agent team (router) → telegram (send)The specialist AI Agents live in the same workflow but loose (not wired into the flow), just like the Brain/RAG/Tools nodes. The router discovers them on its own.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| input | text | No | User message. If empty, uses data.content / data.message from the channel trigger. |
| session_key | text | No | Key to isolate memory per user. On Telegram use `{{data.chatId}}`; on WhatsApp the phone number. If empty, derived from the channel automatically. |
| default_agent | text | No | Alias of the default AI Agent. If empty, the one flagged “Default agent” or the first one is used. |
Output: data.reply (and data.response) with the answer, data.agent (which specialist answered) and data.session_id.
Configuring each specialist
Section titled “Configuring each specialist”Each AI Agent in the team is configured as usual (its brain, RAG and tools), plus three fields that define its role in the team:
| Field | Purpose |
|---|---|
| Agent name | How it’s referred to on handoff, e.g. Sales, Workshop, Admin. |
| Purpose / when to use | When this agent should handle the chat. This is what the others read to decide the handoff, e.g. “invoices, payments and tax data”. |
| Default agent | Flag only one per team: the one that answers first. |
Example — Sales + Workshop + Admin
Section titled “Example — Sales + Workshop + Admin”- Build the channel workflow:
telegramReceive→ Agent team (router) →telegram. - On the router,
session_key:`{{data.chatId}}`(so each customer gets their own memory). - Add three loose AI Agents, each with its Brain:
- Sales — Purpose: “advice and selling of projects”. Flag it as Default agent.
- Workshop — Purpose: “repair status, appointments and technical support”.
- Admin — Purpose: “invoices, payments, tax data”.
- (Optional) Wire a RAG with the catalog to Sales, and their tools to the others.
Result: the customer writes and Sales attends. If they ask “can you send me this month’s invoice?”, Sales hands off to Admin, which answers and keeps attending until the topic changes again.
Troubleshooting
Section titled “Troubleshooting”- Everyone shares memory / users get mixed up:
session_keyis missing. Set it to`{{data.chatId}}`(Telegram) or the phone number (WhatsApp). - It never hands off: check each specialist’s Purpose; if they’re empty or vague, the model can’t tell when to hand off.
- It hands off too much: tune the Purposes so they don’t overlap, and reinforce in each system prompt that it should answer only about its area.
- Credential error on handoff: the receiving specialist also needs its Brain with the client’s credential.