anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
An n8n workflow that answers Telegram messages with an AI model on OpenAI. It remembers the last ten exchanges of each chat, so a follow-up question makes sense, and it sends every reply back to the same chat.
Telegram chatbot with AI replies and a short memory is an n8n workflow in the Business category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
A Telegram message
It starts each time someone sends a message to your bot, and there is no form:
A Telegram reply in the chat that the message came from
What you need before you start.
Chat app
Delivers each message to the workflow and sends the reply back.
NeedsA bot token from BotFather, as a Telegram credential
AI model
Writes the replies.
NeedsAn OpenAI API key and some credit
Checked by Mindket on 13 Nov 2026
This n8n workflow turns a Telegram bot into an AI helper. When a person writes to your bot, an AI Agent on OpenAI reads the message and writes a reply, and the bot sends the reply back to the same chat. A memory node keeps the last ten exchanges of each chat. Five nodes do the work, and there are no sticky notes.
Small shops, clinics, tutors and club organizers who want a first answer on Telegram at any hour. You write the rules in one system message. Skip it if you need a bot that books, searches or reads files, because this one only talks.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Retail | Shop owners | Answer the common questions about hours and delivery | A customer asks at night whether a bag is in stock, and the bot says the team will check in the morning. |
| Services | Salons and clinics | Give a first reply to people who want to book | The bot tells a new customer the opening hours and asks which day suits. |
| Education | Tutors | Let students ask short questions between lessons | A student asks about a grammar rule at midnight, and the bot explains it and asks for an example. |
| Community | Club organizers | Welcome and guide new members | The bot greets a new member and points to the club rules. |
You need some n8n: import a file, add two credentials and edit one text.
Any n8n with a public HTTPS address can run it, because Telegram sends each message to that address.
Chat Model for any other chat model node of n8nDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. You need a Telegram bot token and an OpenAI API key.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server with a public HTTPS address |
| Telegram | A bot and its token, which you get from BotFather inside Telegram |
| OpenAI | An API key and some credit |
workflow.json.Telegram Trigger, add a Telegram credential with your bot token. Select the same credential in Send Reply.Chat Model, add an OpenAI credential with your API key.AI Agent, open Options and rewrite the system message to describe your business, the tone you want and what the bot must never promise.Once the workflow is on, it answers by itself. Each message that someone sends to the bot starts a run, and one reply goes back. Press Test workflow to try it before you turn it on.
| To change | Where |
|---|---|
| The behavior of the bot | The system message in AI Agent |
| The model | The model name in Chat Model |
| The length of the memory | Context Window Length in Chat Memory |
| The footer line | The option Append n8n Attribution in Send Reply |
| Who may use the bot | Restrict to User IDs in Telegram Trigger |
A salon owner runs a small hair salon.
The owner writes a system message with the opening hours and the price list. At 22:00 a new customer asks whether the salon is open on Sunday. The bot gives the hours and asks which day suits. An hour later the customer asks “and the price?”, and the bot answers from the memory of the same chat. Check what the bot says about prices and bookings before you rely on it, because the answers come from a model.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Telegram is a chat app, and a bot is an account that a program runs. This workflow takes each message sent to your bot, has an AI write an answer and sends it back. Press Test workflow and write to the bot before you turn it on.
For experts. The agent has no tools, so it only talks, and its memory is a window of the last ten exchanges that is kept for each chat number.
| Node | What it does | What to know |
|---|---|---|
Telegram Trigger | Starts a run for each new message | It listens for messages only, and Restrict to User IDs limits who can use the bot |
AI Agent | Takes the text of the message as the prompt and holds the system message | A message with no text ends the run with an error |
Chat Model | Calls OpenAI | The model is named gpt-5.6-terra, which also works if you add tools later |
Chat Memory | Keeps the last ten exchanges | The chat number is the key, and the memory is lost when n8n restarts |
Send Reply | Sends the answer to the same chat | The n8n footer line is off |
The original copy named a model that OpenAI is retiring, and it added a footer line to every reply.
gpt-4o-mini. OpenAI’s deprecations page, read on 12 November 2026, lists it for shutdown on 14 January 2027. This copy names gpt-5.6-terra, which costs 2 US dollars per million input tokens and 12 per million output tokensgpt-6-luna costs less, but OpenAI says it calls tools only with reasoning effort none, and n8n’s OpenAI Chat Model never sends that value. An agent that gets a tool later would failTelegram Trigger to limit it, which works on node version 1.2 and laterAI Agent stops that run and the sender gets no reply_ or * in an answer can make Telegram refuse the messageAn n8n workflow that answers Telegram messages with an AI model. Your bot receives a text message, an AI Agent on OpenAI
writes the reply, and the bot sends it back to the same chat. Each chat keeps its last ten exchanges as memory, so a
follow-up question makes sense.
workflow.json: the workflow as n8n exports it, five nodes and no sticky notes. It holds no credential.README.md: these notes.Chat Model asked for gpt-4o-mini. OpenAI's deprecations page, read on 12 November 2026, lists that model for shutdowngpt-5.6-terra, a current OpenAI model that also works under an AI Agent with tools.Send Reply left the option "Append n8n Attribution" unset. On node version 1.1 and later, n8n's source then adds the line "This message was sent automatically with n8n" under every message. This copy turns the option off, so a customer sees only the answer.workflow.json.Telegram Trigger, add a Telegram credential with your bot token. Select the same credential in Send Reply.Chat Model, add an OpenAI credential with your API key.AI Agent, open Options and read the system message. Rewrite it to describe your business, the tone you want and theTelegram Trigger starts the run when someone sends a message to your bot.AI Agent takes the text of that message and asks Chat Model for a reply, with the system message as its rules.Chat Memory hands the agent the last ten exchanges of the same chat, and stores the new one. The chat number is the key,Send Reply sends the agent's answer to the chat the message came from.AI Agent.Chat Model.Chat Memory.Send Reply.Telegram Trigger, add the fieldgpt-5.6-terra costs 2 US dollars per milliongpt-6-luna is not used here, because OpenAI says ChatAI Agent stops that run with an empty text_ or * in an answer can make TelegramAI Agent.NOTICE.md 600 B README.md 4 KB workflow.json 3 KB
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
perplexity-ai · Kit
Picks the best option for a decision from text and images, such as which team should handle a request, with a probability for each choice, for developers who b…
numind · Kit
Reads documents as text or images and fills a JSON template with the fields you ask for, or converts the pages to Markdown. A 4B model for teams that process s…
nace-ai · Kit
Scores yes or no, multiple choice and rating questions about a document in one pass, with a probability for every option. An 8B decision model from Nace.AI tha…