Track Stripe cancellations and classify churn reasons with Claude and Gmail
Ready for 3.0What this workflow does
This workflow has 15 nodes and runs on Stripe events (customer.subscription.deleted) (plus 1 other trigger). Along the way it connects Stripe, Gmail and Google Sheets. It also calls api.anthropic.com over HTTP.
How it runs
Trigger: On Stripe events (customer.subscription.deleted) (plus 1 other trigger).
- Look up the customer (Stripe): work with customer
- Read the survey response (Code): runs custom JavaScript code
- Read the cancellation (Code): runs custom JavaScript code
- Set config: brand, survey link and recipient (Edit Fields (Set)): sets 5 fields: brandName, fromName, surveyUrl…
- Do we already know why (If): checks a condition and branches into true / false
- Build the analysis request (Code): runs custom JavaScript code
- Write the one question email (Code): runs custom JavaScript code
- Categorise the reason with Claude (HTTP Request): calls api.anthropic.com (POST)
- Ask why they left (Gmail): uses Gmail
- Write the churn note (Code): runs custom JavaScript code
…plus 2 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Anthropic + Google Sheets templates (261) · Other Anthropic + Gmail templates (192)
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- Stripe Trigger
n8n-nodes-base.stripeTrigger - Stripe
n8n-nodes-base.stripe - Code
n8n-nodes-base.code - n8n Form Trigger
n8n-nodes-base.formTrigger - No Operation, do nothing
n8n-nodes-base.noOp - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - HTTP Request
n8n-nodes-base.httpRequest - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow tracks Stripe subscription cancellations, emails a one-question exit survey when no cancellation reason is available, categorizes the stated reason with Anthropic Claude, then notifies you via Gmail and logs each churn record to…