Quick overview
This workflow listens to Stripe invoice payment events and uses Supergreen WhatsApp messaging to send PDF receipts for successful payments and interactive dunning polls for failed payments, while tracking invoice status in Google Sheets and alerting a Slack channel for billing escalations and workflow errors.
How it works
- Triggers on Stripe events for
invoice.payment_succeeded and invoice.payment_failed, deduplicates retries, fetches the Stripe customer, and normalizes the invoice fields and WhatsApp phone number.
- For successful payments, downloads the Stripe
invoice_pdf, sends it as a PDF document on WhatsApp via Supergreen, and upserts the invoice as Paid in a Google Sheets Invoices ledger.
- For failed payments, creates a Stripe Billing Portal session, sends the portal link on WhatsApp, sends a 3-option WhatsApp poll via Supergreen, and upserts the invoice as Past Due in Google Sheets with the poll message ID and next retry time.
- Triggers when a customer votes on the WhatsApp poll (via Supergreen), looks up the matching invoice row in Google Sheets by
pollMessageId, and routes the action based on the selected option.
- If the customer selects “retry now”, calls Stripe to pay the invoice immediately, then either marks the invoice Recovered in Google Sheets and confirms on WhatsApp or notifies the customer that the card is still declined with the portal link.
- If the customer selects “remind me”, updates the invoice as Snoozed in Google Sheets with a 72-hour
nextRetryAt and confirms the grace window on WhatsApp.
- If the customer requests support, marks the invoice Escalated in Google Sheets, posts the invoice and customer details to Slack, and confirms the handoff on WhatsApp.
- Runs daily at 09:00 to find Past Due or Snoozed invoices whose retry time has expired (under the retry cap), sends a follow-up WhatsApp poll, updates the poll message ID and retry counters in Google Sheets, and posts any workflow errors to Slack via an error trigger.
Setup
- Add credentials for Stripe API, Supergreen API (WhatsApp), Google Sheets OAuth2, and Slack OAuth2.
- Install the community node
n8n-nodes-supergreen and ensure your Supergreen workspace is configured to deliver WhatsApp vote webhooks to the Supergreen trigger URL.
- Create a Google Sheet with a tab named
Invoices and columns for invoiceId, invoiceNumber, customerId, phone, customerName, amount, status, pollMessageId, portalUrl, retryCount, nextRetryAt, and updatedAt.
- Replace the placeholders in the configuration nodes with your Google Spreadsheet ID, Slack channel ID, and Stripe Billing Portal return URL.
- Activate the Stripe Trigger in Stripe (or via n8n’s Stripe integration) so Stripe sends
invoice.payment_succeeded and invoice.payment_failed events to this workflow.
Requirements
- n8n-nodes-supergreen (v0.1.5+ verified community node on n8n Cloud & self-hosted), Stripe API key, Supergreen API account, Google Sheets OAuth2, and Slack OAuth2.
Customization
- Adjust the 72-hour snooze window or 2-retry cap in the Code nodes, customize the 3-option WhatsApp dunning poll labels, or swap Slack alerts for email/WhatsApp group notifications.