# Telegram messaging agent for text/audio/images with OpenAI: n8n workflow

> Started by another system calling it, and works across Telegram. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/telegram-messaging-agent-for-text-audio-images-with-openai (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)

# Telegram messaging agent for text/audio/images with OpenAI

Started by another system calling it, and works across Telegram. It hands the judgement calls to OpenAI. 29 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ftelegram-messaging-agent-for-text-audio-images-with-openai)

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

**2** Branches: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 6 Logic 6 Service 16

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

- 1 **Listen for Telegram Events** Webhook *Starts it*
- 2 **gpt-4o-mini** Lm Chat Open Ai *Model*
- 3 **gpt-4o-mini1** Lm Chat Open Ai *Model*
- 4 **Telegram Token & Webhooks** Set *Logic*
- 5 **Validation** Set *Logic*
- 6 **Text Classifier Audio** Text Classifier *Model*
- 7 **Text Classifier** Text Classifier *Model*
- 8 **Set Webhook Production URL** Http Request *Service*
- 9 **Set Webhook Test URL** Http Request *Service*
- 10 **Get Telegram Webhook Info** Http Request *Service*
- 11 **Check User & Chat ID** If *Logic*
- 12 **Audio Task Message** Telegram *Service*
- 13 **Audio Other Message** Telegram *Service*
- 14 **Text Task Message** Telegram *Service*
- 15 **Text Other Message** Telegram *Service*
- 16 **Production Webhook Status** Telegram *Service*
- 17 **Test Webhook Status** Telegram *Service*
- 18 **Get Webhook Status** Telegram *Service*
- 19 **Message Router** Switch *Logic*
- 20 **Error message** Telegram *Service*
- 21 **Get Audio File** Telegram *Service*
- 22 **Edit Fields** Set *Logic*
- 23 **Image Schema** Set *Logic*
- 24 **Transcribe Recording** Open Ai *Model*
- 25 **Get Image** Telegram *Service*
- 26 **Extract from File to Base64** Extract From File *Service*
- 27 **Convert to Image File** Convert To File *Service*
- 28 **Analyze Image** Open Ai *Model*
- 29 **Image Message** Telegram *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 29, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Telegram
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 29 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 29 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%2Ftelegram-messaging-agent-for-text-audio-images-with-openai)
- **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)

## Workflows like it

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

- [**Instagram reels into viral content with Mistral and AssemblyAI** 29 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/instagram-reels-into-viral-content-with-mistral-and-assembly)
- [**Multi platform content generator from YouTube with RSS** 29 steps · calls a model · Google Sheets, RSS](https://millionrounds.com/workflow/multi-platform-content-generator-from-youtube-with-rss)
- [**Create a RAG Telegram bot with Google Drive and PostgreSQL** 29 steps · Google Drive, Postgres](https://millionrounds.com/workflow/create-a-rag-telegram-bot-with-google-drive-and-postgresql)
- [**Auto create video Sora with Gemini and OpenAI** 30 steps · calls a model · Google Drive, Telegram](https://millionrounds.com/workflow/auto-create-video-sora-with-gemini-and-openai)
- [**Auto-create TikTok videos with VEED.io AI and ElevenLabs** 28 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/auto-create-tiktok-videos-with-veed-io-ai-and-elevenlabs)
- [**Auto-generate social media videos with OpenAI and Blotato** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/auto-generate-social-media-videos-with-openai-and-blotato)
