Give your Telegram bot the power to answer like a person, even when users send many short messages in a row. The flow groups rapid messages from the same user, builds one clear prompt, and returns a single helpful reply. Great for customer support and FAQ help where speed and clarity matter.
Here is how it runs. A Telegram trigger listens for new messages. Each message is saved to a Supabase table with the user ID and message ID. A short wait window collects more messages from the same user. After the wait, the flow pulls that user’s queue, sorts by message ID to keep the right order, checks if newer messages arrived, and if not, merges the text into one prompt. An OpenAI chat model generates the answer and a Postgres Chat Memory keeps context across chats. The reply is sent back to Telegram and the queue is cleared.
Setup is simple. Create the message_queue table in Supabase and connect your Telegram bot, Supabase keys, OpenAI key, and Postgres connection in n8n. Expect fewer split replies, clearer answers, and faster support. Teams that get message bursts or voice-to-text streams will see a direct increase in agent efficiency and user satisfaction.