Manage subscription renewals with Supabase, Gmail, and a payment API
Go to WorkflowDescription
Quick overview
This workflow runs daily to check subscription records in Supabase, email renewal reminders via Gmail for subscriptions expiring within three days, post payment details to an HTTP API, and then update the subscription and send either a renewal confirmation or a payment failure email.
How it works
Runs every day at 09:00 using a schedule trigger.
Gets the current date/time and fetches all records from the Supabase subscriptions table.
Filters to subscriptions with status set to active and whose end_date falls between now and the next three days.
Sends a renewal reminder email to the subscription owner using Gmail.
Sends the subscription and payment identifiers to an external HTTP endpoint for payment processing and flags the response as successful when an id is present.
If the payment response indicates success, updates the Supabase subscription record with active status, a new start/end date, and last_payment_date, then emails a renewal confirmation via Gmail.
If the payment response indicates failure, emails the customer a payment failure notice via Gmail.
Setup
Add a Supabase credential and ensure the subscriptions table exists with fields used by the workflow (for example subscription_id, user_id, email, status, start_date, end_date, last_payment_date, and any payment ID fields).
Add a Gmail credential that has permission to send emails from your account.
Replace the HTTP Request URL with your real payment processing endpoint and adjust the JSON payload fields to match your API contract.
Confirm the schedule trigger time (09:00) and adjust it to your desired timezone and run time.
Additional info
How To Customize Nodes
You can easily customize this workflow based on your business requirements:
Schedule Trigger**: Change execution frequency.
Subscription Expiry Logic**: Adjust the expiry window from 3 days to any custom duration.
Payment API**: Replace the placeholder API with Stripe, PayPal, Razorpay, or custom gateways.
Email Templates**: Customize reminder, success, and failure email designs.
Renewal Duration**: Change renewal logic from monthly to yearly subscriptions.
Supabase Schema**: Add custom fields like plan type, billing cycle, or payment status.
Add-ons (Extend the Workflow)
You can enhance this workflow with:
Stripe or PayPal direct integration
SMS notifications using Twilio
WhatsApp renewal reminders
Subscription analytics dashboard
Google Sheets logging
Failed payment retry mechanism
Auto-cancel expired subscriptions
Webhook integrations for CRM systems
Use Case Examples
Primary use cases include:
SaaS subscription renewal automation
Membership expiration management
Automated recurring billing reminders
Subscription lifecycle tracking
Reducing churn through proactive notifications
Automating payment follow-ups
Troubleshooting Guide
| Issue | Possible Cause | Solution |
|---|---|---|
| No emails sent | Gmail credentials disconnected | Reconnect Gmail OAuth2 |
| Payment API fails | Invalid API endpoint or payload | Verify API URL and request body |
| Subscriptions not updating | Supabase permissions issue | Check API roles and table access |
| Workflow not triggering | Schedule disabled | Activate workflow |
| Incorrect expiry filtering | Date format mismatch | Ensure timestamps use ISO format |
Need Help?
WeblineIndia specializes in building advanced n8n automations, WooCommerce integrations and end-to-end business process workflows. If you need enhancements, add-ons or a completely custom automation solution, our n8n experts at WeblineIndia are happy to help.
👉 Contact WeblineIndia to get started with smarter automation today.