Send subscription renewal reminders via Telegram with Supabase
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (7)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Supabase
n8n-nodes-base.supabase - Code
n8n-nodes-base.code - Telegram
n8n-nodes-base.telegram - Respond to Webhook
n8n-nodes-base.respondToWebhook
What it does
Subscription Renewal Reminder – Telegram & Supabase This workflow tracks upcoming subscription expiry dates stored in Supabase and automatically sends personalized renewal-reminder messages to each customer via Telegram. It is designed to be triggered by an HTTP Webhook (manually or on a schedule) and ensures that customers are notified a configurable number of days before their subscription lapses. > Community Template Disclaimer > This is a community-contributed n8n workflow template. It is provided “as-is” without official support from n8n GmbH. Always test thoroughly before using in production. Pre-conditions/Requirements Prerequisites - n8n instance (self-hosted or n8n.cloud) - Supabase project with a subscriptions table (id, customername, expirationdate, telegramchatid, notified) - A Telegram Bot created via @BotFather - Outbound HTTPS access from n8n to api.telegram.org and your Supabase project REST endpoint Required Credentials - Supabase Service Role Key – Full access for reading/writing the subscriptions table - Telegram Bot Token – To send messages from your bot - n8n Webhook URL – Auto-generated when you activate the workflow (ScrapeGraphAI API Key is not required for this non-scraping workflow.) Specific Setup Requirements | Environment Variable | Example Value | Purpose | |----------------------|--------------|---------| | SUPABASEURL | https://xyzcompany.supabase.co | Base URL for Supabase REST API | | SUPABASEKEY | eyJhbGciOiJI... | Service Role Key | | TELEGRAMTOKEN | 609012345:AA... | Bot token obtained from BotFather | | REMINDERDAYS | 3 | Days before expiry to notify | How it works This workflow tracks upcoming subscription expiry dates stored in Supabase and automatically sends personalized renewal-reminder messages to each customer via Telegram. It is triggered by an HTTP Webhook (manually or via external scheduler) and ensures that customers are notified a configurable number of days before their subscription lapses. Key Steps: - Receive Trigger (Webhook): External call fires the workflow or an internal Cron node can be added. - Set Static Parameters: The Set node calculates “today + REMINDERDAYS”. - Query Supabase: Fetch all subscriptions expiring on or before the calculated date and not yet notified. - Branch Logic (If node): Check if any subscriptions were returned. - Loop & Dispatch (Code + Telegram nodes): Iterate over each customer row, compose a message, and send via Telegram. - Flag as Notified (Supabase Update): Update each processed row to prevent duplicate reminders. - Respond to Webhook: Return a concise JSON summary for logging or downstream integrations. Set up steps Setup Time: 15–20 minutes 1. Create Telegram Bot a. Open Telegram and talk to @BotFather → /newbot b. Copy the given bot token; paste it into n8n Telegram credentials. 2. Prepare Supabase a. Create a table named subscriptions with columns: id (uuid), customername (text), expirationdate (date), telegramchatid (text), notified (bool, default false) b. Obtain the Service Role Key from Project Settings → API. 3. Import the Workflow a. In n8n, click Templates → Import and select “Subscription Renewal Reminder – Telegram & Supabase”. b. Replace placeholder credentials in the Supabase and Telegram nodes. 4. Define Environment Variables (Optional but recommended) Add SUPABASEURL, SUPABASEKEY, TELEGRAMTOKEN, and REMINDERDAYS in Settings → Environment Variables for easy maintenance. 5. Activate the Workflow Copy the production webhook URL and (optionally) set up a cron job or n8n Cron node to hit it daily. Node Descriptions Core Workflow Nodes: - Webhook – Entry point; triggers the workflow via HTTP request. - Set (Calculate Target Date) – Defines targetDate = today + REMINDERDAYS. - Supabase (Select) – Retrieves expiring subscriptions that haven’t been notified. - If (Rows > 0?) – Determines whether to continue or exit early. - Code (For-Each Loop) – Iterates through each returned row to send messages and update status. - Tele