Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory
Needs changesNeeds 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 to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Conversation 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 (10)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - If
n8n-nodes-base.if - Telegram
n8n-nodes-base.telegram - OpenAI
@n8n/n8n-nodes-langchain.openAi - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Wikipedia
@n8n/n8n-nodes-langchain.toolWikipedia - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - Google Sheets
n8n-nodes-base.googleSheets
What it does
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 1. Triggers when a new Telegram message is received by your bot. 2. Sends the message text to an AI chatbot agent configured with a system prompt to respond concisely in the user’s language. 3. 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. 4. Posts the generated reply back to the originating Telegram chat. Setup 1. Create a Telegram bot with BotFather, then add your Telegram bot credentials to the Telegram Trigger and Telegram reply nodes. 2. Add your OpenAI credentials and select the desired model in the OpenAI chat model node. 3. Ensure the workflow has access to store conversation context and adjust the memory window length or system message if needed.