Recover failed Stripe payments with Anthropic Claude and Gmail alerts
Ready for 3.0What this workflow does
This workflow has 13 nodes and runs on Stripe events (invoice.payment failed). Along the way it connects Stripe and Gmail. It also calls api.anthropic.com over HTTP.
How it runs
Trigger: On Stripe events (invoice.payment failed).
- Set config: brand, tone and final attempt (Edit Fields (Set)): sets 7 fields: brandName, fromName, supportEmail…
- Read the failed invoice (Code): runs custom JavaScript code
- Route by which attempt this is (Switch): routes items into 3 branches
- Angle: assume a card expiry (Edit Fields (Set)): sets 2 fields: angle, urgency
- Angle: action is needed (Edit Fields (Set)): sets 2 fields: angle, urgency
- Angle: access is at risk (Edit Fields (Set)): sets 2 fields: angle, urgency
- Build the recovery email (Code): runs custom JavaScript code
- Write the email with Claude (HTTP Request): calls api.anthropic.com (POST)
- Attach the payment link (Code): runs custom JavaScript code
- Email the customer (Gmail): uses Gmail
…plus 2 more steps. See the full node list below.
Services it uses
HTTP calls to: api.anthropic.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Stripe Trigger
n8n-nodes-base.stripeTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail - If
n8n-nodes-base.if
From the author
Quick overview This workflow listens for failed Stripe invoice payments, generates stage-appropriate dunning emails with Anthropic Claude, emails the customer via Gmail with the hosted Stripe invoice link, and sends an internal Gmail alert when the failure…