Mindket

Telegram chatbot with AI replies and a short memory

Newversion 1 · updated

Overview

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.

At a glance

Runs in
  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps, once the server has a public HTTPS address
  • Another AI: swap Chat Model for any other chat model node of n8n

Platform

Connects 2 apps

How it works

Trigger

A Telegram message

It starts each time someone sends a message to your bot, and there is no form:

  • The text of the message

Actions

  1. The text of the message goes to an AI Agent on OpenAI
  2. The agent reads the last ten exchanges of the same chat from its memory
  3. The model writes a reply that follows the rules in the system message
  4. The reply is sent back to the same Telegram chat

Result

A Telegram reply in the chat that the message came from

Integrations

What you need before you start.

Telegram

Chat app

Delivers each message to the workflow and sends the reply back.

NeedsA bot token from BotFather, as a Telegram credential

OpenAI

AI model

Writes the replies.

NeedsAn OpenAI API key and some credit

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
3 steps, starting on a Telegram event
AI
1 step calls an AI model: AI Agent
Sign-ins
Signs in to: Telegram and OpenAI
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 3 of its step types

Read from the workflow’s file, not from a run.

About

What it is

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.

Who it suits

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.

Who uses it, and how
IndustryWho uses itHow they use itExample
RetailShop ownersAnswer the common questions about hours and deliveryA customer asks at night whether a bag is in stock, and the bot says the team will check in the morning.
ServicesSalons and clinicsGive a first reply to people who want to bookThe bot tells a new customer the opening hours and asks which day suits.
EducationTutorsLet students ask short questions between lessonsA student asks about a grammar rule at midnight, and the bot explains it and asks for an example.
CommunityClub organizersWelcome and guide new membersThe 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.

Where to use it

Any n8n with a public HTTPS address can run it, because Telegram sends each message to that address.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps, once the server has a public HTTPS address
  • Another AI: swap Chat Model for any other chat model node of n8n

Setup

Download 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.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server with a public HTTPS address
TelegramA bot and its token, which you get from BotFather inside Telegram
OpenAIAn API key and some credit
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. In Telegram Trigger, add a Telegram credential with your bot token. Select the same credential in Send Reply.
  3. In Chat Model, add an OpenAI credential with your API key.
  4. In AI Agent, open Options and rewrite the system message to describe your business, the tone you want and what the bot must never promise.
  5. Press Test workflow, then send a message to your bot in Telegram. The reply arrives in the same chat.
  6. Turn the workflow on, so that the bot keeps answering when you are away.

How to use it

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.

What to change for a different result
To changeWhere
The behavior of the botThe system message in AI Agent
The modelThe model name in Chat Model
The length of the memoryContext Window Length in Chat Memory
The footer lineThe option Append n8n Attribution in Send Reply
Who may use the botRestrict to User IDs in Telegram Trigger

Example

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.

For newcomers and experts

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.

Where to look closer
NodeWhat it doesWhat to know
Telegram TriggerStarts a run for each new messageIt listens for messages only, and Restrict to User IDs limits who can use the bot
AI AgentTakes the text of the message as the prompt and holds the system messageA message with no text ends the run with an error
Chat ModelCalls OpenAIThe model is named gpt-5.6-terra, which also works if you add tools later
Chat MemoryKeeps the last ten exchangesThe chat number is the key, and the memory is lost when n8n restarts
Send ReplySends the answer to the same chatThe n8n footer line is off

Good to know

The original copy named a model that OpenAI is retiring, and it added a footer line to every reply.

  • Model: the original copy asked for 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 tokens
  • Cheaper model: gpt-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 fail
  • Footer: n8n adds the line “This message was sent automatically with n8n” to a message when the option is unset on node version 1.1 and later. This copy turns it off
  • Open bot: anyone who finds the bot can write to it and spend your OpenAI credit. Add Restrict to User IDs in Telegram Trigger to limit it, which works on node version 1.2 and later
  • Text only: a photo, a sticker or a voice message has no text, so AI Agent stops that run and the sender gets no reply
  • Memory: it lives in n8n’s own process, so every chat starts again after a restart
  • Markdown: n8n sends replies in Telegram’s Markdown mode, so a lone _ or * in an answer can make Telegram refuse the message
  • Your data: each message goes to OpenAI and back through Telegram
  • Not run: Mindket did not call Telegram or OpenAI to test this file, and ran it in a test runner with stand-in answers
  • Credentials: the JSON holds none

README and files

README

Telegram chatbot with AI replies and a short memory

An 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.

What is inside

  • workflow.json: the workflow as n8n exports it, five nodes and no sticky notes. It holds no credential.
  • README.md: these notes.

What we changed from the original copy

  • Chat Model asked for gpt-4o-mini. OpenAI's deprecations page, read on 12 November 2026, lists that model for shutdown
    on 14 January 2027. This copy names gpt-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.
  • Every credential reference is removed, so you pick your own.

Before you start

  • An n8n instance with a public HTTPS address. Telegram delivers updates by an HTTPS POST to the webhook address, so an
    n8n that only runs on your own computer will not receive messages. n8n Cloud has such an address.
  • A Telegram bot and its token. You make one by chatting with BotFather inside Telegram.
  • An OpenAI API key with some credit.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. In Telegram Trigger, add a Telegram credential with your bot token. Select the same credential in Send Reply.
  3. In Chat Model, add an OpenAI credential with your API key.
  4. In AI Agent, open Options and read the system message. Rewrite it to describe your business, the tone you want and the
    things the bot must never promise.
  5. Press Test workflow, then send a message to your bot in Telegram. The reply arrives in the same chat.
  6. Turn the workflow on, so that the bot keeps answering when you are away.

How a run goes

  1. Telegram Trigger starts the run when someone sends a message to your bot.
  2. AI Agent takes the text of that message and asks Chat Model for a reply, with the system message as its rules.
  3. Chat Memory hands the agent the last ten exchanges of the same chat, and stores the new one. The chat number is the key,
    so each person has a memory of their own.
  4. Send Reply sends the agent's answer to the chat the message came from.

Change the look

  • The behavior: 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: see the first item under Good to know.

Good to know

  • Anyone who finds the bot can write to it and spend your OpenAI credit. To limit it, open Telegram Trigger, add the field
    Restrict to User IDs under Additional Fields and list the Telegram user numbers that may use it. Messages from other
    people are then dropped with no error. The field works on node version 1.2 and later, and this file uses 1.2.
  • The model costs money. On OpenAI's model page, gpt-5.6-terra costs 2 US dollars per million
    input tokens and 12 per million output tokens. The cheaper gpt-6-luna is not used here, because OpenAI says Chat
    Completions calls tools with it only when reasoning effort is none, and n8n's OpenAI Chat Model never sends that value.
    An agent that gets a tool later would then fail.
  • The bot reads text only. A photo, a sticker or a voice message has no text, so AI Agent stops that run with an empty text
    error and the sender gets no reply.
  • The memory lives inside n8n's own process. When n8n restarts, every chat starts again with an empty memory.
  • Replies go out in Telegram's Markdown mode, which is the n8n default. A lone _ or * in an answer can make Telegram
    refuse the message. If that happens, add a line to the system message that asks for plain text without those characters.
  • Your data: each message goes to OpenAI and back through Telegram.
  • Not run: we did not call Telegram or OpenAI to test this file. We ran it in a test runner with stand-in answers. A text
    message went in and one reply came out, and a message with no text stopped at AI Agent.
  • Credentials: the JSON holds none.
Files
NOTICE.md  600 B
README.md  4 KB
workflow.json  3 KB

3 files, 8 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

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…

New

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…

New

ACE-Step 1.5 XL SFT

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…

New

Similar in Business

See all in Business

pplx-decider-v1.1-27b

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…

New

NuExtract3

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…

New

Drex DLM

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…

New