# Chat with OpenAI and Telegram: n8n workflow template

> Started by an incoming Telegram message, and works across Telegram and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/chat-with-openai-and-telegram-2 (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Chat with OpenAI and Telegram

Started by an incoming Telegram message, and works across Telegram and in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 22 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fchat-with-openai-and-telegram-2)

**22 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 10 Logic 6 Service 5

The steps in the order they run, from what starts it.

- 1 **VLM Agent2** Lm Chat Open Ai *Model*
- 2 **VLM Agent3** Lm Chat Open Ai *Model*
- 3 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 4 **Default Data Loader** Document Default Data Loader *Model*
- 5 **Listen to Telegram for Link** Telegram trigger *Starts it*
- 6 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 7 **VLM Run Highlighter** Agent *Model*
- 8 **Structured Output Parser1** Output Parser Structured *Model*
- 9 **Insert Data to Store** Vector Store In Memory *Model*
- 10 **Query Data Tool** Vector Store In Memory *Model*
- 11 **Check Whether URL** If *Logic*
- 12 **AI Agent** Agent *Model*
- 13 **Covert to Text File** Convert To File *Service*
- 14 **Check URLs Validity** If *Logic*
- 15 **Rename Link Field** Set *Logic*
- 16 **Send a Reply** Telegram *Service*
- 17 **Send a document** Telegram *Service*
- 18 **Split Out** Split Out *Logic*
- 19 **No Operation, do nothing1** No Op *Logic*
- 20 **Code** Code *Logic*
- 21 **Start Asking** Telegram *Service*
- 22 **HTTP Request1** Http Request *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 22, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Telegram, in-memory vectors
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Telegram and in-memory vectors accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 22 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 22 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fchat-with-openai-and-telegram-2)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**Analyze YouTube comments and generate video ideas with Gemini** 22 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/analyze-youtube-comments-and-generate-video-ideas-with-gemin)
- [**Auto-Generate & Approve Social Media Posts from RSS Feeds** 22 steps · calls a model · LinkedIn, NocoDB](https://millionrounds.com/workflow/auto-generate-and-approve-social-media-posts-from-rss-feeds)
- [**Automated AI product photography** 22 steps · calls a model · Telegram](https://millionrounds.com/workflow/automated-ai-product-photography)
- [**Generate UGC videos from product images with OpenAI and Fal.AI** 22 steps · calls a model · Telegram](https://millionrounds.com/workflow/generate-ugc-videos-from-product-images-with-openai-and-fal-)
- [**Triage cleanroom particle excursions with Gmail and OpenAI** 22 steps · calls a model · Gmail, Telegram](https://millionrounds.com/workflow/triage-cleanroom-particle-excursions-with-gmail-and-openai)
- [**AI image generation & editing with Gemini and Telegram Bot** 22 steps · Airtable, Google Drive](https://millionrounds.com/workflow/ai-image-generation-and-editing-with-gemini-and-telegram-bot)
