Skip to content
Docs

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:

  1. A trigger that starts the flow when a message arrives.
  2. An Agent that generates the reply, keeping conversation history through a Chat Thread memory node.
  3. A Channel/* send node that posts the reply back to the platform, unless the workspace’s own bot answers itself (below).
  • 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.

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
WhatsApp Channel/WhatsApp (Cloud API token) HTTP Webhook trigger

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 / Chat trigger, which reads a message and a threadId from 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/Gateway trigger 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).

Wire the trigger into an Agent node:

  1. Set the agent’s prompt to the incoming message, for example {{ $start->payload->message }}.

  2. Add a Chat Thread node and connect its output to the agent’s MEMORY handle. Set its conversationId to a stable per-conversation value — for example the threadId the trigger provides, or the externalConversationId from a gateway message. Set channel to the platform name (slack, discord, telegram, etc.). Optionally set userId to {{ $start->externalUserId }} to scope history per user.

    An Answer the support channel flow, Live: v1, with a Gateway trigger reading On wired into Start, a Support agent, and a Conversation Chat Thread node wired into the agent's memory handle
    An Answer the support channel flow, Live: v1, with a Gateway trigger reading On wired into Start, a Support agent, and a Conversation Chat Thread node wired into the agent's memory handle

The agent emits its reply under content.

Add the Channel/* send node for your platform and wire Agent → Channel/*. Set the message field to the agent’s reply:

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.

  1. Send a message to the trigger (post to the webhook URL, or message your Telegram bot).
  2. Open the run under Runs and confirm the Agent node produced a reply and the Channel/* node completed.
  3. 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.

  • 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 webhookUrl resolves to a valid incoming webhook and that the Channel/* node completed without an error in the run report.
  • 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.