Automation library · Scheduling

Send multi-tenant reminders with Telegram and Postgres

Started by someone submitting a form, and works across Postgres and Telegram. 18 steps, 1 branch: a working afternoon to understand properly.

Medium

18 stepsMedium: a working afternoon
1Branch: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 3Logic 6Service 9

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

  1. 1Every minute - check due eventsSchedule triggerStarts it
  2. 2Receive event via webhookWebhookStarts it
  3. 3Tenant registration formForm triggerStarts it
  4. 4Fetch events due for reminderPostgresService
  5. 5Validate tenant tokenCodeLogic
  6. 6Organize form dataCodeLogic
  7. 7Render TemplateCodeLogic
  8. 8Fetch tenant configPostgresService
  9. 9Insert tenantPostgresService
  10. 10Route by channel typeIfLogic
  11. 11Map webhook fieldsSetLogic
  12. 12Insert tenant rulePostgresService
  13. 13Send reminder via TelegramTelegramService
  14. 14No events due - skipNo OpLogic
  15. 15Show registration successFormService
  16. 16Mark reminder as sentPostgresService
  17. 17Log success to databasePostgresService
  18. 18Log error to databasePostgresService

How it's built

Starts on
Someone submitting a form
Steps
18, with 1 branch
Size
Medium: a working afternoon
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 someone submitting a form.

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?

Plan an afternoon. 18 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 18 steps before you point it at anything that matters.