Recover failed Stripe payments with a dunning sequence
Classifies Stripe payment failures by decline code and responds differently to each: a soft retry note, a card-update request, or escalation to a human for hard declines.
The Stripe trigger subscribes to invoice.payment_failed and verifies Stripe's signature itself. A Set node lifts the customer, email, amount — divided from Stripe's minor units exactly once — currency, decline code and attempt number. A Switch then classifies the decline into three named outcomes with a fallback: insufficient funds and processing errors take a soft 'we'll try again' email, expired or incorrect card details take a specific update-your-card email naming the code and linking to the billing portal, and everything else — fraud blocks, do-not-honour — goes to a human in Slack without contacting the customer at all. All three branches converge on a Google Sheets log recording the code, attempt number and which branch fired. Every external call retries and routes failures to an error rail on Discord, because a failed dunning message is silent churn.
Key benefits
- ✓Each decline code gets the response that fits it, instead of one generic email that loses recoverable customers
- ✓Suspected-fraud declines go to a person, never to the customer's inbox
- ✓The amount is converted from Stripe's minor units once, so no branch quotes a figure 100× wrong
- ✓The dunning log tells you whether recovery is working rather than assuming it
- ✓No money moves anywhere in this workflow — the Stripe key only needs read access
Use cases
- →Subscription businesses losing customers to involuntary churn
- →Finance teams chasing failed payments from a Stripe dashboard by hand
- →SaaS teams that want dunning without paying for a dunning vendor
- →Anyone whose current flow emails 'your payment failed' to every decline code alike
Integrations
Workflow preview (9 nodes)
The template's actual node layout and connections. Node parameters and credential slots unlock with the download.
What's inside (9 nodes)
A look at the node types this workflow uses. No purchase required — full parameters and credentials are yours after you buy.
From download to running in 3 steps
- 1Import. In n8n, open Workflows → menu → “Import from File” and pick the downloaded JSON.
- 2Connect. Add your own credentials on the app nodes - n8n highlights exactly which ones need them.
- 3Activate. Run it once to test, then toggle Active. The automation is live.
What you'll learn
Production levelProduction-grade: idempotency, dead-letter handling, and reconciliation included.
- •Moving data between Gmail, Slack and Google Sheets in a single run
- •Adding retries and an explicit error path to external calls
- •Testing against pinned sample data before connecting anything real
Every node carries its own documentation on the canvas, plus notes explaining why the architecture was built this way, a credential setup guide, troubleshooting, and three practice exercises. Sample data comes pinned to the trigger, so you can hit Execute and watch data flow before connecting a single account.
Common questions
What exactly do I get?
The complete, ready-to-import n8n workflow as a JSON file, delivered instantly after payment. Import it into your own n8n (cloud or self-hosted), add your credentials, and it runs.
How do I import it into n8n?
In n8n, open Workflows, click the three-dot menu, choose “Import from File”, and select the downloaded JSON. Then connect your own app credentials on the highlighted nodes.
Do I need anything else for it to work?
You need your own n8n instance and accounts/credentials for the apps this workflow connects to (Stripe, Gmail, Slack, Google Sheets, …). No coding is required.
What if it doesn't work for me?
If the file is faulty, won't import, or isn't as described, contact us within 7 days and we'll fix it or refund you - see our refund policy.
Can I modify or resell it?
You can freely adapt and use it in your own or your clients' projects. Reselling or redistributing the template file itself is not permitted.
Related templates
Reconcile receipts for invoicing
Invoicing on n8n: runs when mail lands in the inbox across Google Sheets, Slack and Gmail, starting at "Collect Raw Text". Pulls structured fields out of free text. 22 documented nodes.
Categorize transactions: Slack
Invoicing on n8n: runs when mail lands in the inbox across Slack, Airtable, Gmail and Google Sheets, starting at "Prepare Approval Packet". 22 documented nodes.
Route expenses for expenses
Expenses on n8n: runs when a form is submitted across Slack, Google Sheets, Google Drive and Gmail, starting at "Normalize Invoice Payload". 23 documented nodes.
Turn a Stripe dispute into a Jira issue with the evidence deadline
Turns a Stripe dispute into a Jira ticket carrying the evidence deadline as the due date, a priority derived from hours remaining and amount, and a list of evidence to gather — then announces it in Slack with the real issue key.