Send multi-tenant reminders via Telegram from webhooks and schedule with Postgres logging
Ready for 3.0What this workflow does
This workflow has 18 nodes and runs when an HTTP POST request hits its webhook URL (plus 2 other triggers). Along the way it connects Postgres and Telegram.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 2 other triggers).
- Validate tenant token (Code): runs custom JavaScript code
- Fetch events due for reminder (Postgres): run a query
- Organize form data (Code): runs custom JavaScript code
- Fetch tenant config (Postgres): run a query
- Render Template (Code): runs custom JavaScript code
- Insert tenant (Postgres): run a query
- Map webhook fields (Edit Fields (Set)): sets 9 fields: tenants_id, rule_id, channel…
- Route by channel type (If): checks a condition and branches into true / false
- Insert tenant rule (Postgres): run a query
- Send reminder via Telegram (Telegram): uses Telegram
…plus 4 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (10)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - Telegram
n8n-nodes-base.telegram - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - n8n Form Trigger
n8n-nodes-base.formTrigger - n8n Form
n8n-nodes-base.form - No Operation, do nothing
n8n-nodes-base.noOp - If
n8n-nodes-base.if
From the author
How it works - Any external system triggers a reminder via webhook with a tenant token — the workflow validates the token, fetches the tenant's channel config and message template from PostgreSQL, renders the message with event variables, and sends it…