Debounce Telegram support messages and aggregate replies with OpenAI
Needs changesWhat this workflow does
This AI workflow has 16 nodes and runs when an HTTP GET request hits its webhook URL (plus 1 other trigger). Along the way it connects Postgres, OpenAI Chat Model and Telegram.
How it runs
Trigger: When an HTTP GET request hits its webhook URL (plus 1 other trigger).
- Extract User Data (Edit Fields (Set)): sets 3 fields: user_id, message, timestamp
- Check Active Session (Postgres): run a query
- If: checks a condition and branches into true / false
- Create New Session (Postgres): run a query
- Append Message (Postgres): run a query
- Store Resume URL (Postgres): run a query
- Respond to Webhook: sends the response back to the webhook caller
- Wait: waits 60 seconds
- Fetch All Messages (Postgres): run a query
- Format All Messages (Code): runs custom JavaScript code
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (11)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Postgres
n8n-nodes-base.postgres - AI Agent
@n8n/n8n-nodes-langchain.agent - Respond to Webhook
n8n-nodes-base.respondToWebhook - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Telegram Trigger
n8n-nodes-base.telegramTrigger - If
n8n-nodes-base.if - Telegram
n8n-nodes-base.telegram - Code
n8n-nodes-base.code - Wait
n8n-nodes-base.wait
From the author
This workflow prevents your AI support bot from responding to every single message by intelligently aggregating rapid-fire messages from users before generating a comprehensive response. Who's it for Support teams and bot developers who want to provide better…