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.
Related Templates
AI SEO Readability Audit: Check Website Friendliness for LLMs
Who is this for? This workflow is designed for SEO specialists, content creators, marketers, and website developers who ...
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Text automations using Apple Shortcuts
Overview This workflow answers user requests sent via Mac Shortcuts Several Shortcuts call the same webhook, with a quer...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments