# AI-powered Telegram bot for data extraction: n8n workflow

> Started by another system calling it, and works across Telegram. It puts OpenRouter behind a retrieval step, so answers are drawn from documents you supply...

Source: https://millionrounds.com/workflow/ai-powered-telegram-bot-for-data-extraction (Millionrounds; every figure on the page links to its filing or article)

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

# AI-powered Telegram bot for data extraction

Started by another system calling it, and works across Telegram. It puts OpenRouter behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 16 steps, 2 branches, 1 loop or waits: a working afternoon to understand properly.

Medium Calls a model: OpenRouter Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-powered-telegram-bot-for-data-extraction)

**16 steps** Medium: a working afternoon

**2** Branches: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 3 Model 4 Logic 4 Service 5

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

- 1 **Simple Memory** Memory Buffer Window *Model*
- 2 **OpenRouter Chat Model** Lm Chat Open Router *Model*
- 3 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 4 **Receive Message Trigger from Telegram** Webhook *Starts it*
- 5 **MCP Client** Mcp Client Tool *Model*
- 6 **Trigger by the main workflow** Execute Workflow trigger *Starts it*
- 7 **AI Agent** Agent *Model*
- 8 **Set Telegram Webhook** Http Request *Service*
- 9 **Sub-workflow to trigger Typing Action** Execute Workflow *Logic*
- 10 **Typing action** Telegram *Service*
- 11 **Send AI’s output to the user via Telegram** Telegram *Service*
- 12 **Wait for the typing action to finish by 10 seconds** Wait *Logic*
- 13 **Check if the execution in N8N is finished** N8n *Service*
- 14 **If the N8N execution is finished** If *Logic*
- 15 **Check if the N8N status is success** If *Logic*
- 16 **Reply Error Message** Telegram *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 16, with 2 branches, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Telegram
- **Model:** OpenRouter
- **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 account, and a key for OpenRouter. 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 OpenRouter. 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?

Plan an afternoon. 16 steps is enough that you should read each one before running it.

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 16 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%2Fai-powered-telegram-bot-for-data-extraction)
- **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 data collection, with the same services where possible, closest in size first.

- [**Automate job applications with Gemini and Notion** 15 steps · calls a model · Google Drive, Notion](https://millionrounds.com/workflow/automate-job-applications-with-gemini-and-notion)
- [**Log meal nutrients from Telegram to Google Sheets with OpenAI** 15 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/log-meal-nutrients-from-telegram-to-google-sheets-with-opena)
- [**Trading journal: log trades into Google Sheets with Telegram** 15 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/trading-journal-log-trades-into-google-sheets-with-telegram)
- [**Find jobs with Telegram and Indeed** 15 steps · Airtable, Google Sheets](https://millionrounds.com/workflow/find-jobs-with-telegram-and-indeed)
- [**Track DTDC shipments with Telegram** 17 steps · Telegram](https://millionrounds.com/workflow/track-dtdc-shipments-with-telegram-2)
- [**Track DTDC shipments with Telegram** 17 steps · Telegram](https://millionrounds.com/workflow/track-dtdc-shipments-with-telegram)
