Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory
Needs changesWhat this workflow does
This AI workflow has 11 nodes and runs on Telegram events (message). Along the way it connects Telegram, OpenAI, OpenAI Chat Model and Wikipedia and 1 more.
How it runs
Trigger: On Telegram events (message).
- If: checks a condition and branches into true / false
- Download Telegram Voice (Telegram): work with file
- AI Conversation Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 2 tools (Perform Calculations, Fetch Information from Wikipedia); memory: Manage Conversation Memory
- Transcribe Voice with OpenAI (OpenAI): transcribe (audio)
- Send Response via Telegram (Telegram): uses Telegram
- Append Log to Sheets (Google Sheets): append
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Conversation Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| 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
From the author
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.…