How to connect an agent to a chat channel
This guide shows you how to build a flow that receives a message, answers it with an Agent, and posts the reply back to a chat platform.
A conversational channel is a set of nodes around an agent:
- A trigger that starts the flow when a message arrives.
- An Agent that generates the reply, keeping conversation history through a Chat Thread memory node.
- A
Channel/*send node that posts the reply back to the platform, unless the workspace’s own bot answers itself (below).
Prerequisites
Section titled “Prerequisites”- A flow with an Agent node and a configured LLM provider.
- For the reply: an incoming webhook URL (Slack, Discord, Teams) or a bot token (Telegram), saved as a secret.
Channel support
Section titled “Channel support”What each platform supports today:
| Platform | Send a reply (outbound) | Receive a message (inbound) |
|---|---|---|
| Slack | Channel/Slack (incoming webhook) |
HTTP Webhook trigger, or a Webhook/Gateway trigger on a Slack bot that dials out (Socket Mode) |
| Discord | Channel/Discord (incoming webhook) |
HTTP Webhook trigger, or a Webhook/Gateway trigger on a Discord bot that dials out (the gateway) |
| Microsoft Teams | Channel/Teams (incoming webhook) |
HTTP Webhook trigger |
| Telegram | Channel/Telegram (bot token) |
HTTP Webhook trigger, registered as the bot’s webhook |
Channel/WhatsApp (Cloud API token) |
HTTP Webhook trigger |
Receive the message
Section titled “Receive the message”Add a trigger that starts the flow when a message arrives:
- For a generic integration, use the Webhook trigger and point your platform (or an automation that forwards messages) at its URL.
- For a chat-shaped payload, use the
Webhook / Chattrigger, which reads amessageand athreadIdfrom the request body. - For Telegram, use the Webhook trigger and register its URL as your bot’s webhook, as Connect a Telegram agent shows. The bot token comes from @BotFather.
- For a Discord or Slack bot that dials out, use a
Webhook/Gatewaytrigger node and set it to the bot. The gateway daemon starts this flow for every message the bot receives. See Connect a Slack agent and Connect a Discord agent.
The incoming request body is available downstream as $start. A webhook nests the posted body under $start->payload; a gateway message exposes its fields directly ($start->text, $start->externalConversationId, $start->externalUserId).
Run the agent with memory
Section titled “Run the agent with memory”Wire the trigger into an Agent node:
-
Set the agent’s
promptto the incoming message, for example{{ $start->payload->message }}. -
Add a Chat Thread node and connect its output to the agent’s MEMORY handle. Set its
conversationIdto a stable per-conversation value — for example thethreadIdthe trigger provides, or theexternalConversationIdfrom a gateway message. Setchannelto the platform name (slack,discord,telegram, etc.). Optionally setuserIdto{{ $start->externalUserId }}to scope history per user.

The agent emits its reply under content.
Send the reply
Section titled “Send the reply”Add the Channel/* send node for your platform and wire Agent → Channel/*. Set the message field to the agent’s reply:
Channel/Slack:text={{ $prev->content }}Channel/Discord:content={{ $prev->content }}Channel/Teams:text={{ $prev->content }}Channel/WhatsApp:text={{ $prev->content }}
For the webhook-based channels (Slack, Discord, Teams) set each node’s webhookUrl to your saved secret, for example {{ $secrets->slackWebhookUrl }}. Telegram takes a credential + chatId, and WhatsApp a credential + phoneNumberId + to — store the token as a secret and pick it in credential either way.
Verify it works
Section titled “Verify it works”- Send a message to the trigger (post to the webhook URL, or message your Telegram bot).
- Open the run under Runs and confirm the Agent node produced a reply and the
Channel/*node completed. - Check the channel for the posted reply.
Send a second message with the same conversation identity and confirm the agent’s reply reflects the earlier turn.
Troubleshooting
Section titled “Troubleshooting”- The agent prompt is empty. A webhook nests the posted body under
$start->payload. Reference the field as{{ $start->payload->message }}, not{{ message }}. - The reply doesn’t appear. Check that
webhookUrlresolves to a valid incoming webhook and that theChannel/*node completed without an error in the run report.
Related
Section titled “Related”- Webhooks — receive HTTP requests into a flow.
- Llm / Agent — the agent node reference.
- Chat Threads — the memory node that stores conversation history.
- Expressions — reference incoming data in node fields.