Automation library · Content

Verify Telegram channel subscriptions with Postgres

Started by an incoming Telegram message, and works across Google Drive, Postgres and Telegram. 41 steps, 8 branches: large, and worth reading before you trust it with anything live.

Large

41 stepsLarge: read it before trusting it with anything live
8Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 1Logic 11Service 29

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2Variables TGSetLogic
  3. 3InitializationSetLogic
  4. 4Is Admin?IfLogic
  5. 5Define TypeSwitchLogic
  6. 6ButtonsSwitchLogic
  7. 7Get Bot StatusPostgresService
  8. 8Update bot status on STARTPostgresService
  9. 9Define flowSwitchLogic
  10. 10SuccessTelegramService
  11. 11CommandsSwitchLogic
  12. 12Add ChannelPostgresService
  13. 13Get Channels PostgresService
  14. 14Referal?IfLogic
  15. 15Get Channels PostgresService
  16. 16Request Add ChannelTelegramService
  17. 17Request Delete ChannelTelegramService
  18. 18Request New Add ChannelTelegramService
  19. 19Channel ExistsTelegramService
  20. 20IfIfLogic
  21. 21Welcome message ReferalTelegramService
  22. 22Welcome message ManagerTelegramService
  23. 23Add Divide ChannelsSummarizeService
  24. 24Update bot status on CHECK SUBSCRIPTION REQUEST CHANNELPostgresService
  25. 25Update bot status on CHECK SUBSCRIPTION REQUEST CHANNEL1PostgresService
  26. 26Delete ChannelPostgresService
  27. 27Channel Not ExistsTelegramService
  28. 28Update bot status and referalPostgresService
  29. 29Upsert bot status on STARTPostgresService
  30. 30ChannelsTelegramService
  31. 31Request New Delete ChannelTelegramService
  32. 32Get ReferalPostgresService
  33. 33Get ChannelsPostgresService
  34. 34Get Subscription statusesTelegramService
  35. 35Union statusesAggregateLogic
  36. 36CheckIfLogic
  37. 37Get FileGoogle DriveService
  38. 38Check successTelegramService
  39. 39Check failedTelegramService
  40. 40Download FileGoogle DriveService
  41. 41Check success + FileTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
41, with 8 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Postgres, Telegram
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Google Drive, 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 41 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 41 steps before you point it at anything that matters.