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.