đź§ľ Send subscription renewal reminders via Telegram with Supabase

⚡ 27 views · 🧾 Invoice Processing

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

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

Required Credentials

(ScrapeGraphAI API Key is not required for this non-scraping workflow.)

Specific Setup Requirements

Environment VariableExample ValuePurpose
SUPABASE_URLhttps://xyzcompany.supabase.coBase URL for Supabase REST API
SUPABASE_KEYeyJhbGciOiJI...Service Role Key
TELEGRAM_TOKEN609012345:AA...Bot token obtained from BotFather
REMINDER_DAYS3Days 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:

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), customer_name (text), expiration_date (date),
    telegram_chat_id (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 SUPABASE_URL, SUPABASE_KEY, TELEGRAM_TOKEN, and REMINDER_DAYS 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:

Data Flow:

  1. Webhook → Set → Supabase (Select) → If → Code → Telegram → Supabase (Update) → Respond to Webhook

Customization Examples

Send Slack Notifications Instead of Telegram

// Replace Telegram node with Slack node
const message = `Hi ${item.customer_name}, your subscription expires on ${item.expiration_date}.`;
return [{ text: message, channel: item.slack_channel_id }];

Notify 7 Days & 1 Day Before Expiry

// In Set node
items[0].json.reminderOffsets = [7, 1]; // days
return items;

Data Output Format

The workflow outputs structured JSON data:

{
  "totalSubscriptionsChecked": 42,
  "remindersSent": 13,
  "timestamp": "2024-05-27T09:15:22.000Z"
}

Troubleshooting

Common Issues

  1. No messages sent – Check the If node; ensure REMINDER_DAYS is set correctly and the Supabase query returns rows.
  2. Telegram error 403 – The user hasn’t started a chat with your bot. Ask the customer to click “Start” in Telegram.

Performance Tips

Pro Tips:

đź”— Nodes Used

Webhook, Telegram, Supabase

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup