Templates / Debounce Telegram support messages and aggregate replies with OpenAI

Debounce Telegram support messages and aggregate replies with OpenAI

Needs changes

by Naveen Choudhary ✓ · 209 views · created 2026-01-28 · Support Chatbot, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What 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).

  1. Extract User Data (Edit Fields (Set)): sets 3 fields: user_id, message, timestamp
  2. Check Active Session (Postgres): run a query
  3. If: checks a condition and branches into true / false
  4. Create New Session (Postgres): run a query
  5. Append Message (Postgres): run a query
  6. Store Resume URL (Postgres): run a query
  7. Respond to Webhook: sends the response back to the webhook caller
  8. Wait: waits 60 seconds
  9. Fetch All Messages (Postgres): run a query
  10. Format All Messages (Code): runs custom JavaScript code

…plus 3 more steps. See the full node list below.

Services it uses

PostgresOpenAI Chat ModelTelegram

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.
Removed in 3.0Replace 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)

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…

Excerpt from Naveen Choudhary's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.