Automation library · Content

Automate Telegram channel posts with Postgres

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

Large

43 stepsLarge: read it before trusting it with anything live
7Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 1Logic 9Service 33

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. 6Get Bot StatusPostgresService
  7. 7ButtonsSwitchLogic
  8. 8Define flowSwitchLogic
  9. 9Upsert bot status on START PostgresService
  10. 10Request Post Image TextTelegramService
  11. 11Request Post TextTelegramService
  12. 12CommandsSwitchLogic
  13. 13Add ChannelPostgresService
  14. 14Get Channels PostgresService
  15. 15Update bot status on START PostgresService
  16. 16Update bot status on POST IMAGE REQUEST IMAGEPostgresService
  17. 17Update bot status on START PostgresService
  18. 18Update bot status on POST IMAGE REQUEST TEXTPostgresService
  19. 19Update bot status on POST TEXT REQUESTPostgresService
  20. 20Welcome MessageTelegramService
  21. 21Request Add ChannelTelegramService
  22. 22Request Delete ChannelTelegramService
  23. 23Get Channels PostgresService
  24. 24Request New Add ChannelTelegramService
  25. 25Channel ExistsTelegramService
  26. 26IfIfLogic
  27. 27Select ChannelsPostgresService
  28. 28Request Post Image ImageTelegramService
  29. 29Select Channels PostgresService
  30. 30Upsert bot status on STARTPostgresService
  31. 31Update bot status on ADD CHANNELPostgresService
  32. 32Update bot status on DELETE CHANNELPostgresService
  33. 33Add Divide ChannelsSummarizeService
  34. 34Delete ChannelPostgresService
  35. 35Channel Not ExistsTelegramService
  36. 36Send Posts (4922)TelegramService
  37. 37If1IfLogic
  38. 38ChannelsTelegramService
  39. 39Request New Delete ChannelTelegramService
  40. 40Success Send PostTelegramService
  41. 41Send Posts Image (4922)TelegramService
  42. 42Send Posts Image (4922) TelegramService
  43. 43Success Send Post ImageTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
43, with 7 branches
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 43 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 43 steps before you point it at anything that matters.