Telegram Chat with Buffering
Configured with Agent, Aggregate, OpenAI Chat Model, Memory Postgres Chat, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Messaging
- Trigger
- Wait
- Data store
- Routing
- Transform
- AI & models
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Reply | Messaging | Telegram | See node parameters |
| Receive Message | Trigger | Telegram Trigger | See node parameters |
| Wait 10 Seconds | Wait | Wait | See node parameters |
| Add to Queued Messages | Data store | Supabase | See node parameters |
| No Operation, do nothing | Routing | No Op | See node parameters |
| Aggregate | Transform | Aggregate | See node parameters |
| Delete Queued Messages | Data store | Supabase | delete |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Sort by Message ID | Transform | Sort | See node parameters |
| Get Queued Messages | Data store | Supabase | getAll |
| Check Most Recent Message | Routing | If | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Postgres Chat Memory | Data store | Memory Postgres Chat | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApipostgressupabaseApitelegramApi
Workflow notes
Allow Users to Send a Sequence of Messages to an AI Agent in Telegram with Supabase
Allow Users to Send a Sequence of Messages to an AI Agent in Telegram with Supabase
Use Case
When creating chatbots that interface through applications such as Telegram and WhatsApp, users can often sends multiple shorter messages in quick succession, in place of a single, longer message. This workflow accounts for this behaviour.
What it Does
This workflow allows users to send several messages in quick succession, treating them as one coherent conversation instead of separate messages requiring individual responses.
How it Works
- When messages arrive, they are stored in a Supabase PostgreSQL table
- The system waits briefly to see if additional messages arrive
- If no new messages arrive within the waiting period, all queued messages are:
- Combined and processed as a single conversation
- Responded to with one unified reply
- Deleted from the queue
Setup
Setup
- Create a table in Supabase called message_queue. It needs to have the following columns: user_id (
uint8), message (text), and message_id (uint8) - Add your Telegram, Supabase, OpenAI, and PostgreSQL credentials
- Activate the workflow and test by sending multiple messages the Telegram bot in one go
- Wait ten seconds after which you will receive a single reply to all of your messages
Modification
Modification
Change the value of Wait Amount to vary the buffering window
Modification
Modification
Replace this sub-node to use a different language model
Modification
Modification
Add a System Message to tailor the chatbot to your use case
Telegram Chat with Buffering
Telegram Chat with Buffering
Purpose and structure
This folder contains the Telegram Chat with Buffering workflow. Its executable nodes use agent, aggregate, if, lmChatOpenAi, memoryPostgresChat, noOp, sort, supabase, telegram, telegramTrigger, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Receive Message
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1411_Telegram_Wait_Automation_Triggered.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- 1. Receive Message
- 3. AI Assistant
- 2. Buffer Incoming Messages
- 4. Send Reply