Skip to content
FlowHubFluxonLab
A
AI Automationfree

Allow Users to Send a Sequence of Messages to an AI Agent in Telegram

by Chris Carradapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentOpenAI Chat ModelOpenAI Chat ModelPostgres Chat MemoryPostgres Chat MemorySupabaseSupabaseTelegramTelegram
Share Post Share
ReplyReceive MessageWaWait 10 SecondsAdd to Queued MessagesAdd to Queued M…NONo Operation, do nothingNo Operation, d…AgAggregateDelete Queued MessagesDelete Queued M…OpenAI Chat ModelOpenAI Chat Mod…SoSort by Message IDSort by Message…Get Queued MessagesGet Queued Mess…IfCheck Most Recent MessageCheck Most Rece…AgAI AgentMPPostgres Chat MemoryPostgres Chat M…123456789101112
1/5
STEPS · 12
Starts on a Telegram event

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 Create a table in Supabase called message_queue.

Tags

n8nreference-onlyagentlm-chat-open-aimemory-postgres-chatsupabasetelegram
Connects
AAI AgentopenaichatmodelOpenAI Chat ModelpostgreschatmemoryPostgres Chat MemorysupabaseSupabasetelegramTelegram
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes13
AddedFeb 16, 2025

Related workflows

See all AI Automation
ACDgmail
free

AI: Summarize podcast episode and enhance using Wikipedia

The workflow automates the process of creating a summarized and enriched podcast digest, which is then sent via email. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
AopenaichatmodelserpapigooglesearchS
free

Slack chatbot powered by AI

This workflow offers an effective way to handle a chatbot's functionality, making use of multiple tools for information retrieval, conversation context storage, and message sending. It's a setup tailored for a Slack environment, aiming to offer an interactive, AI-driven chatbot experience. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
ACDembeddingsopenai
free

Answer Slack knowledge base questions with Notion, Pinecone, and OpenAI

Quick overview This workflow syncs an internal Notion knowledge base to Pinecone on a daily schedule, then runs a Slack bot that answers questions in a specific channel using Pinecone retrieval and an OpenAI chat model, replying in a thread with citations back to the source Notion pages. How it works Runs on a daily schedule to sync your Notion knowledge base into a Pinecone vector index. Fetches all pages from a specified Notion database and then pulls each page’s full block content (including nested blocks). Combines each page’s blocks into a single document and attaches metadata such as the Notion title, URL, and last edited time. Splits each document into overlapping text chunks, generates OpenAI embeddings, and inserts them into Pinecone while clearing and rebuilding the target namespace. Triggers when a new message is posted in the configured Slack channel and ignores bot/system messages to prevent reply loops. Uses an OpenAI-powered agent that always queries Pinecone for relevant chunks (including source metadata) and generates an answer in the user’s language. Posts the response back to Slack as a threaded reply, including cited Notion sources. Setup Create a Notion interna

by DigitalCube.AI