Skip to content
Founder Workflows
BrowseSaved
Browse by stage

Recover failed Stripe payments with a Claude Code webhook queue, staged dunning emails and reason-based win-back

A consultant describes a Claude Code setup for a SaaS client that logs Stripe webhooks to a queue, then runs a three-step dunning sequence, plan-change emails, invoice PDFs, CRM updates and exit-survey follow-ups. He reports about $4,200 MRR recovered in 60 days, with no baseline shown.

ClaimedConversionSmall SaaSScriptConnected tools

Evidence: The author reports this. We have not checked it beyond reading the source.

The business problem

Small subscription businesses lose revenue to failed card payments and cancellations, and handle invoices, plan changes and CRM updates by hand, which the consultant puts at about 8 hours a week for this client.

What was tried

1. Webhook intake: a Claude Code script receives Stripe events, verifies the signature and routes by type (payment succeeded, payment failed, subscription updated, subscription deleted, invoice finalized). 2. To avoid Stripe's short timeout and retries, the handler only writes the event to a database table (SQLite is mentioned) and returns at once. A separate Claude Code process polls the table every 30 seconds. The post stresses making every handler idempotent so a retried event is not processed twice. 3. Dunning: on a failed payment, send a gentle reminder, an urgent follow-up 3 days later, and a final notice at day 7 with a reactivation link and a grace discount. A successful payment cancels the remaining emails. Emails come from templates personalised by Claude, and each send is logged to the CRM. 4. Plan changes: compare old and new plan details from the event. Upgrades get a congratulations email and a CRM flag; downgrades get a confirmation and a survey 7 days later; add-ons trigger onboarding for the feature. 5. Win-back: on cancellation, send an exit survey the same day, then branch on the stated reason (a 25% discount on day 3 for price, a roadmap or early-access invite on day 7 for missing features, a case study on day 30). Survey answers go to a Google Sheet. 6. Invoices and CRM: on a finalized invoice, build a branded PDF, save it to Google Drive and email it; keep plan, MRR, renewal date and lifetime value in sync in HubSpot, Airtable or Notion. 7. His advice is to start with dunning alone, test only in Stripe's test mode, keep business rules out of hard-coded logic, and log everything.

What was reported (positive)

For one unnamed Vancouver SaaS client: about $4,200 in MRR recovered by dunning in the first 60 days, MRR up 14% in 60 days, about 8% of cancelled subscriptions reactivated within 30 days (described as about $1,800 a month), and about 6 hours a month saved on 200+ invoices. Build time is given as 3 to 5 days with about an hour a month of upkeep. No baseline, control group or attribution method is given, so the figures cannot be separated from other growth.

Limitations

Vendor material: the author sells AI automation consulting, including a $1,500 audit, and the post links to his booking page. One unnamed client; the product type is not stated. No prompts, code or configuration are shown, only a numbered outline, so it cannot be followed exactly. The revenue figures have no baseline and assume the recovered revenue would otherwise have been lost. Industry churn figures in the post are unsourced. No failures are reported beyond common mistakes to avoid.

What you need

A Stripe account with webhooks, Claude Code, a small database for the event queue, an email sending service and a CRM. The post does not name the email service.

Build the queue first: accept the webhook, store it, return immediately, and process from the table. Make each step safe to run twice. Add the dunning sequence before any other branch.

A prompt to try

Write a Stripe webhook handler that verifies the signature, stores each event in a SQLite table with its event ID as a unique key, and returns 200 immediately. Then write a separate worker that polls the table every 30 seconds, skips events already processed, and on invoice.payment_failed schedules three emails at day 0, 3 and 7, cancelling the rest if invoice.payment_succeeded arrives for the same customer. Use Stripe test mode only.

Sources

Source published: August 7, 2026. Last reviewed here: November 4, 2026. Spot a mistake? Tell us.

Tools in this workflow

Get new workflows like this by email

A short selection of the most useful new workflows, including the ones that did not work. Free, and you can unsubscribe at any time.

Your email address

Related workflows

Recover failed Stripe payments with a Claude Code webhook queue, staged dunning emails and reason-based win-back | Founder Workflows