Subscription & Dunning Automation Workflow: Recover Failed Payments
Involuntary churn — customers lost to a failed card, not a decision — is usually the largest churn line a subscription business never looks at. The workflow watches billing events, runs a retry schedule tuned to card decline codes, sends dunning messages written for the specific failure, handles plan changes and cancellation requests with the right offer, and reports recovered revenue weekly.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 11, 2026
The problem
Failed payments get the billing provider's default three emails and then silently cancel. Cancellation requests get processed with no conversation. Finance finds out about revenue loss at month end.
What changes when it runs
Failed payments are recovered at a measurably higher rate because the retry timing matches the decline reason and the messages tell the customer exactly what to do. Cancellation requests get a relevant save offer or a clean exit, never silence. Recovered revenue and the reasons behind losses are on a weekly report.
Trigger, then 8 steps
Trigger
Billing webhooks (Stripe / Chargebee / Recurly)
invoice.payment_failed, customer.subscription.updated, cancellation requested, trial ending, card expiring soon.
Receive the billing event
WebhookEvent type, customer, amount, decline code, card details (last 4, expiry), plan and tenure.
Choose the retry strategy
SwitchDecline code decides: insufficient funds → retry on likely payday; expired card → no retry, update-card message; do-not-honour → one retry then message; fraud → stop and alert.
Draft the dunning message
AI AgentA short message for this exact situation and customer — amount, card ending, what happens next, one link to update payment — in your brand voice, with tone rules enforced.
Send across the sequence
GmailEmail day 0, 3, 7; SMS on day 7 for accounts above a value threshold; in-app banner via Intercom if available. Each step checks whether payment already succeeded before sending.
Handle plan changes and pauses
HTTP RequestDowngrade and pause requests are processed in the billing system with the right proration and a confirmation; upgrade requests route to the expansion workflow.
Cancellation intercept
AI AgentOn a cancellation request, the agent reads tenure, usage and stated reason and proposes one save offer from the approved set (pause, discount, downgrade, concierge call) — or none for customers who should simply be let go cleanly.
Alert finance and the owner
SlackHigh-value failures and cancellations alert the account owner with context; finance sees the daily failed/recovered tally.
Weekly recovery report
Schedule TriggerFailed amount, recovered amount, recovery rate by decline code and by message step, cancellations saved, and losses by reason.
Data it touches
- Billing platform events and customer data (Stripe, Chargebee, Recurly, Paddle)
- CRM account owner and tenure
- Product usage (for save-offer decisions)
- Approved save-offer set (finance-owned sheet)
Guardrails
- Retry schedules respect card-network rules and the provider's limits.
- Save offers come only from the finance-approved set; the agent picks, it does not invent discounts.
- Customers who ask to cancel and decline the offer are cancelled promptly — no dark patterns.
- Every message step checks payment status first so nobody is chased for a paid invoice.
Why decline codes matter
A failed payment is not one thing. 'Insufficient funds' usually succeeds if retried after the customer's likely payday; 'expired card' will never succeed and needs the customer to act; 'do not honour' is the bank being cautious and often clears on a second attempt days later; a fraud flag should stop everything. Billing providers' default retry logic treats them similarly. Matching the retry timing and the message to the code is where the recovery-rate improvement comes from — and it is pure workflow logic.
Messages that get cards updated
The default dunning email says a payment failed and links to a portal. The workflow's message says which card, how much, what will happen on which date, and gives one link that opens the update form directly. It is sent from a person, and the day-7 message for valuable accounts goes by SMS because email is where dunning gets ignored. The agent's role is making that specificity automatic without the tone slipping into threatening.
Cancellations: save or release
Not every cancellation should be fought. The agent looks at tenure, usage and the stated reason and either proposes one relevant offer from the approved set — pause for two months, a downgrade, a call — or recommends a clean exit with a short, graceful confirmation. Customers who decline the offer are cancelled immediately. The report shows save rate by offer and by reason, which is how finance decides what to keep offering.
Tools in the stack
| Tool | Role in this workflow |
|---|---|
| n8n | Event handling, sequences, reporting |
| Stripe / Chargebee / Recurly | Billing (unchanged) |
| Claude | Dunning messages and save-offer selection |
| Gmail + Twilio + Intercom | Email, SMS, in-app |
| Slack + Google Sheets | Alerts, offer set, reports |
Want this running without building it?
Automation workflow
$247/month
We set up, host and maintain this workflow on n8n and connect it to your tools. Setup included, cancel monthly, you keep the JSON.
Custom build
$3,500–6,000 one-time
Your systems, your rules, your edge cases. A one-off build on Claude and n8n, delivered with documentation and a walkthrough.
Covers one billing platform and up to 2,000 billing events a month. Multi-currency tax logic, usage-based billing or a custom cancellation flow inside your app are a custom build.
Frequently asked questions
Does Stripe not already do dunning?
Stripe's Smart Retries and default emails are a baseline. The workflow adds decline-code-specific timing, personalised multi-channel messages, cancellation handling with save offers, owner alerts and the reporting — the parts that move the recovery rate.
Can it apply discounts automatically?
Only from the finance-approved offer set, and only in the cancellation flow. Discount values and eligibility rules live in a sheet finance owns.
Is this compliant with consumer-protection rules?
The workflow cancels promptly on request, never hides the cancel option and never adds friction beyond one offer. Message content is yours to approve. Local rules on retries and notice periods are configured per region.
Calculator
Put your own numbers in
Estimate the cost of the current process and what this workflow changes.
The pillar
AI Finance Agent
Bookkeeping, reconciliation, and reporting—no code required.