---
title: "Chat with an OpenAI model through a Telegram bot"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/c5d24bcb-2228-4704-93ca-fe1b3bce2957"
updated: "2026-11-12"
---

# Chat with an OpenAI model through a Telegram bot

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that turns a Telegram bot into a chat assistant. Each message goes to an OpenAI model through an AI agent that is told to answer helpfully with emojis, and the answer comes back to the same chat.

Chat with an OpenAI model through a Telegram bot is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow connects a Telegram bot to an OpenAI model. Someone sends the bot a message, and the text goes to an AI agent that is asked to answer helpfully with emojis. The agent’s reply goes back to the same chat. Four nodes do the work. It is a small base that you can grow into a fuller chatbot.

### Who it suits

Beginners who want a first Telegram bot that answers questions, and builders who want a base to extend with tools or memory. Skip it if you need the bot to remember a conversation, since each message is answered on its own.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Education | Teachers | Give a class a bot that explains topics | A teacher shares the bot and students ask it to explain fractions. |
| Personal | Hobbyists | Chat with a model from a phone without a new app | A user asks for a recipe idea and gets it with a few emojis. |
| Software | Builders | Start a bot project and add tools later | A builder adds a calendar tool to the agent. |
| Writing | Writers | Brainstorm names and titles in a chat | A writer asks for ten titles for a post. |

You need a little n8n: import a file, add two credentials and make a Telegram bot.

### Where to use it

Any n8n that Telegram can reach over HTTPS and that can reach OpenAI will run it. The bot answers in the chat the message came from.

- n8n Cloud: import the file, publish it and message your bot
- Your own n8n server: the same steps, with the server open to Telegram over HTTPS
- Another model: replace \`OpenAI Chat Model\` with another chat model node, such as Gemini or Claude
- A fuller bot: add tools or a memory node to \`AI Agent\`

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Setup is a Telegram bot, an OpenAI key and a model choice.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own, open to Telegram over HTTPS |
| Telegram | A bot and its token from BotFather |
| OpenAI | An API key |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add a Telegram credential with your bot’s token and select it in `Telegram Trigger` and `Telegram`.
3. Add an OpenAI credential with your key and select it in `OpenAI Chat Model`.
4. In `OpenAI Chat Model`, pick a model. The file sets none, so the node falls back to `gpt-5-mini`, which OpenAI lists for shutdown on 11 December 2026.
5. Press Execute workflow, send your bot a message in Telegram and check the reply.
6. Publish the workflow so the bot answers all day.

### How to use it

Open the chat with your bot in Telegram and write a message. The bot answers in a few seconds. The instruction in front of your text asks for a helpful answer with emojis, so replies come with a few.

What to change for a different result

| To change | Where |
| --- | --- |
| The bot’s style | The prompt in \`AI Agent\` |
| The model | \`OpenAI Chat Model\` |
| Whether it remembers | Add a memory node to \`AI Agent\` |
| What gets sent back | \`Telegram\` |

### Example

A user writes, Give me three names for a bakery.

The bot replies in the chat with three name ideas and a few emojis. Check facts in a reply before you rely on them, since a model wrote it.

### 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. A Telegram bot is an account that a program controls. Telegram hands each message sent to it over to n8n, and n8n answers through the bot. An AI agent is a model with instructions that can also use tools. Here it uses none, so it works as a plain chat assistant.

**For experts.** `Telegram Trigger` listens for `message` updates only. `AI Agent` builds its prompt from the message text with an instruction in front. It has no system message, no memory and no tools. `Telegram` reads the answer from the agent’s `output` field and the chat id from the trigger, and it turns off n8n’s attribution line.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Telegram Trigger\` | Takes each new message | Edited messages and channel posts are ignored |
| \`OpenAI Chat Model\` | Supplies the model | The file sets none, so the node falls back to its default |
| \`AI Agent\` | Answers the message | The prompt asks for a helpful answer with emojis |
| \`Telegram\` | Sends the answer to the chat the message came from | n8n’s attribution line is off |

### Good to know

The bot answers anyone who finds it, has no memory and runs on a model that is close to retirement.

- Model: n8n’s source gives \`OpenAI Chat Model\` the default \`gpt-5-mini\`, and the file sets none. OpenAI’s deprecations page, read on 12 November 2026, lists \`gpt-5-mini\` for shutdown on 11 December 2026 with \`gpt-5.6-terra\` as the replacement. Pick a model in the node before you publish
- Open bot: nothing checks who writes to the bot, so anyone who finds its username can use it and spend your OpenAI credit. Telegram Trigger version 1.2 and later offers Restrict to User IDs under Additional Fields, and the file’s trigger is version 1.1. To limit it, swap in a current Telegram Trigger and fill that field in
- No memory: each message is answered on its own, so the bot forgets what you said before
- Markdown: \`Telegram\` sends in Telegram’s Markdown mode, where an unmatched \`\_\` or \`\*\` makes Telegram refuse the message, and the user gets no reply. Telegram also refuses text over 4,096 characters
- Other messages: a photo or a sticker carries no text, so there is nothing for the model to answer
- Your data: every message goes to OpenAI
- Not run: nothing here was run against Telegram or OpenAI. The notes come from n8n’s source and the vendors’ pages
- Credentials: the JSON holds none

## README

```markdown
# Chat with an OpenAI model through a Telegram bot

An n8n workflow that turns a Telegram bot into a chat assistant. Someone sends the bot a message, an AI agent asks an OpenAI
model for a helpful answer with emojis, and the answer comes back to the same chat.

## What is inside

- `workflow.json`: the workflow as n8n exports it, 4 nodes, no sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The Telegram nodes and the OpenAI node were linked to credentials in their author's n8n. The links are gone, so select your
  own.
- The Telegram Trigger's webhook id is gone, and n8n makes a new one when you import the file.
- The export's instance id is gone.
- Nothing else. The file holds no key, id or address of its author's, so no node needed a placeholder.

## Before you start

- An n8n instance that Telegram can reach over HTTPS, on n8n Cloud or on your own server.
- A Telegram bot and its token, made by messaging BotFather in Telegram.
- An OpenAI API key.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a Telegram credential with your bot's token. Select it in `Telegram Trigger` and `Telegram`.
3. Add an OpenAI credential with your key and select it in `OpenAI Chat Model`.
4. In `OpenAI Chat Model`, pick a model. The file sets none, so the node falls back to `gpt-5-mini`, which OpenAI lists for
   shutdown on 11 December 2026.
5. Press Execute workflow, send your bot a message in Telegram and check the reply.
6. Publish the workflow so the bot answers all day.

## How a run goes

1. `Telegram Trigger` takes a new message. It listens for `message` updates only.
2. `AI Agent` builds its prompt from the message text, with an instruction in front that asks for a helpful answer with emojis.
   It sends the prompt to `OpenAI Chat Model`.
3. `Telegram` sends the agent's answer to the chat the message came from, with n8n's attribution line turned off.

## Change the look

- The bot's style: the prompt in `AI Agent`.
- The model: `OpenAI Chat Model`. To use Gemini or Claude, put that provider's chat model node in its place.
- Memory: the agent has none. To give it some, add a memory node, such as Simple Memory, to the agent's memory input.
- What gets sent back: `Telegram`.

## Good to know

- Model: n8n's source gives `OpenAI Chat Model` the default `gpt-5-mini`, and the file sets none. OpenAI's deprecations page, read
  on 12 November 2026, lists `gpt-5-mini` for shutdown on 11 December 2026 with `gpt-5.6-terra` as the replacement. Pick a model
  in the node before you publish.
- Nothing checks who writes to the bot, so anyone who finds its username can use it and spend your OpenAI credit. Telegram Trigger
  version 1.2 and later offers Restrict to User IDs under Additional Fields, and the file's trigger is version 1.1. To limit it,
  swap in a current Telegram Trigger and fill that field in.
- Each message is answered on its own, so the bot forgets what you said before.
- `Telegram` sends in Telegram's Markdown mode. Telegram's Bot API page says `_`, `*`, a backtick and `[` outside an entity need a
  backslash in that mode, and an unmatched one makes Telegram refuse the message, so the user gets no reply. Telegram also
  refuses text over 4,096 characters.
- A photo or a sticker carries no text, so there is nothing for the model to answer.
- Your data: every message goes to OpenAI.
- Not run: nothing here was run against Telegram or OpenAI. These notes come from n8n's source and the vendors' pages, read on 12
  November 2026.
```

## What is in it

3 files, 6 KB, downloaded as a zip.

```text
NOTICE.md  621 B
README.md  4 KB
workflow.json  2 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- 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

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/c5d24bcb-2228-4704-93ca-fe1b3bce2957)
- [Its page on Mindket](https://mindket.com/p/c5d24bcb-2228-4704-93ca-fe1b3bce2957)
