How to Connect AI to Chat Apps Without Code Using n8n
Wire a chat webhook to an AI node and a reply node in n8n to auto-answer messages, no code required.
If you would rather not run a Node server, n8n lets you build the same auto-reply flow by dragging nodes. A Webhook node catches the incoming message, an AI node writes the answer, and an HTTP Request node sends it back. This works for Discord, Slack, Telegram, Viber, and any platform with a webhook.
What you need
- An n8n instance (n8n Cloud or a self-hosted Docker container)
- An AI provider credential (OpenAI, Anthropic, or similar)
- A chat platform that can call a webhook and a way to post replies
Step 1: Run n8n
The fastest local start is Docker. n8n opens at port 5678 with a visual editor in your browser.
Step 2: Add a Webhook trigger
Create a new workflow and drop in a Webhook node set to POST. n8n gives you a test URL and a production URL. Paste the appropriate one into your chat platform's webhook settings so messages arrive in n8n.
Step 3: Add the AI node
Connect an AI Agent or OpenAI Chat node after the webhook. Map the user's message from the incoming payload into the prompt using an expression. For most platforms the text lives somewhere like the message body in the JSON.
={{ $json.body.message.text }}Step 4: Send the reply back
Add an HTTP Request node pointed at your platform's send endpoint, for example the Discord channel webhook or the Viber send_message URL. Put the AI output into the message field with another expression.
{
"content": "={{ $node['AI Agent'].json.output }}"
}Result
You built a working AI auto-reply with zero code. Toggle the workflow to Active so it runs on the production webhook URL, and reuse the same three-node pattern for every chat platform you want to support.
Watch related tutorials
25:00
60:00
27:30
32:08
21:45
34:10