Automation library · Content

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

32 stepsLarge: read it before trusting it with anything live
6Branches: places the flow splits
1Loop or waits
2Services it connects to

The flow

Starts it 1Logic 14Service 17

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2Variables TGSetLogic
  3. 3InitializationSetLogic
  4. 4Is Start?IfLogic
  5. 5Welcome MessageTelegramService
  6. 6SwitchSwitchLogic
  7. 7ButtonsSwitchLogic
  8. 8CommandsSwitchLogic
  9. 9Main MenuTelegramService
  10. 10For TestsSwitchLogic
  11. 11Get TestsPostgresService
  12. 12ErrorTelegramService
  13. 13Update Bot Status on startPostgresService
  14. 14Get TestPostgresService
  15. 15Update AnswerPostgresService
  16. 16Union Number with QuestionSetLogic
  17. 17TestTelegramService
  18. 18Get Non-Answered QuestionsPostgresService
  19. 19Union listSummarizeService
  20. 20Get Questions AND AnswersPostgresService
  21. 21Any questions?IfLogic
  22. 22List testsTelegramService
  23. 23Randomize questionsSortLogic
  24. 24Calculate answersPostgresService
  25. 25CodeCodeLogic
  26. 26VariablesSetLogic
  27. 27Result TestTelegramService
  28. 28MergeMergeLogic
  29. 29Upsert pred AnswerPostgresService
  30. 30QuestionTelegramService
  31. 31WaitWaitLogic
  32. 32Delete messageTelegramService

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.