# Automate testing and collect responses with Telegram: n8n workflow

> Started by an incoming Telegram message, and works across Postgres and Telegram. 32 steps, 6 branches, 1 loop or waits: large, and worth reading before you...

Source: https://millionrounds.com/workflow/automate-testing-and-collect-responses-with-telegram (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)

# Automate testing and collect responses with Telegram

Started by an incoming Telegram message, and works across Postgres and Telegram. 32 steps, 6 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large

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

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

**6** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 1 Logic 14 Service 17

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

- 1 **Telegram Trigger** Telegram trigger *Starts it*
- 2 **Variables TG** Set *Logic*
- 3 **Initialization** Set *Logic*
- 4 **Is Start?** If *Logic*
- 5 **Welcome Message** Telegram *Service*
- 6 **Switch** Switch *Logic*
- 7 **Buttons** Switch *Logic*
- 8 **Commands** Switch *Logic*
- 9 **Main Menu** Telegram *Service*
- 10 **For Tests** Switch *Logic*
- 11 **Get Tests** Postgres *Service*
- 12 **Error** Telegram *Service*
- 13 **Update Bot Status on start** Postgres *Service*
- 14 **Get Test** Postgres *Service*
- 15 **Update Answer** Postgres *Service*
- 16 **Union Number with Question** Set *Logic*
- 17 **Test** Telegram *Service*
- 18 **Get Non-Answered Questions** Postgres *Service*
- 19 **Union list** Summarize *Service*
- 20 **Get Questions AND Answers** Postgres *Service*
- 21 **Any questions?** If *Logic*
- 22 **List tests** Telegram *Service*
- 23 **Randomize questions** Sort *Logic*
- 24 **Calculate answers** Postgres *Service*
- 25 **Code** Code *Logic*
- 26 **Variables** Set *Logic*
- 27 **Result Test** Telegram *Service*
- 28 **Merge** Merge *Logic*
- 29 **Upsert pred Answer** Postgres *Service*
- 30 **Question** Telegram *Service*
- 31 **Wait** Wait *Logic*
- 32 **Delete message** Telegram *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 32, with 6 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Postgres, Telegram
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Postgres and Telegram accounts. 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?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 32 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 32 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%2Fautomate-testing-and-collect-responses-with-telegram)
- **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.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

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

- [**Convert YouTube videos to shorts with Klap** 32 steps · Google Sheets, Telegram](https://millionrounds.com/workflow/convert-youtube-videos-to-shorts-with-klap)
- [**Create daily industry news avatar videos with Perplexity** 32 steps · Google Drive, Telegram](https://millionrounds.com/workflow/create-daily-industry-news-avatar-videos-with-perplexity)
- [**Govern AI agent responses with OpenAI and Postgres** 32 steps · Gmail, Postgres](https://millionrounds.com/workflow/govern-ai-agent-responses-with-openai-and-postgres)
- [**Automate LinkedIn content from Twitter AI posts** 32 steps · calls a model · Google Sheets, LinkedIn](https://millionrounds.com/workflow/automate-linkedin-content-from-twitter-ai-posts)
- [**Create WordPress posts and Telegram updates from links** 32 steps · calls a model · Telegram, WordPress](https://millionrounds.com/workflow/create-wordpress-posts-and-telegram-updates-from-links)
- [**Translate RSS news and publish** 31 steps · Discord, Gmail](https://millionrounds.com/workflow/translate-rss-news-and-publish)
