Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory

Quick Overview This workflow listens for incoming Telegram messages, sends each message to an OpenAI chat model via an AI agent with per-chat memory, and replies in the same Telegram conversation with a concise, language-matched response.

How it works Triggers when a new Telegram message is received by your bot. Sends the message text to an AI chatbot agent configured with a system prompt to respond concisely in the user’s language. Uses the OpenAI GPT-4o-mini chat model to generate the response and a per-chat memory buffer keyed by Telegram chat ID to retain recent context. Posts the generated reply back to the originating Telegram chat.

Setup Create a Telegram bot with BotFather, then add your Telegram bot credentials to the Telegram Trigger and Telegram reply nodes. Add your OpenAI credentials and select the desired model in the OpenAI chat model node. Ensure the workflow has access to store conversation context and adjust the memory window length or system message if needed.

0
Downloads
0
Views
8.23
Quality Score
intermediate
Complexity
Author:TakatoYamada(View Original →)
Created:6/10/2026
Updated:6/10/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments