Skip to main content
Lifetime license included with every purchase
n8n workflowsSaaS retentionchurn preventionfreemium automation

How to Automate SaaS Subscription Management and Churn Prevention with n8n

Build automated subscription management workflows with n8n — audit Stripe subscriptions, identify at-risk users, trigger retention campaigns, and convert freemium users to paid. Step-by-step workflow breakdown.

Nn8n Marketplace Team·April 29, 2026·10 min read

Churn Is a Workflow Problem, Not a Strategy Problem

Most SaaS teams know they need to work on retention. Few have a system that runs it automatically.

Subscriptions cancel silently. Trials expire without follow-up. Free users drift for months before someone notices they've gone inactive. By the time a human reviews the Stripe dashboard, the window to intervene has closed.

n8n turns subscription management into an automated system — one that flags at-risk accounts, triggers the right message at the right moment, and monitors MRR health without anyone opening a dashboard.

What You Can Automate

Every high-impact touchpoint in the subscription lifecycle can be handled by an n8n workflow:

  • Weekly subscription audits — pull Stripe data to surface cancellations, downgrades, and failed payments before they compound
  • At-risk user detection — identify low-engagement paid users before they cancel and route them into retention sequences
  • Trial expiry follow-up — catch users on day 7, 3, and 0 of expiry with conversion-focused outreach
  • Payment failure recovery — send dunning emails and Slack alerts the moment a charge fails
  • Freemium conversion campaigns — segment free users by activity level and send targeted upgrade prompts on a weekly schedule
  • Churn win-back sequences — reach recently cancelled accounts within 48 hours with personalized win-back offers
  • MRR health digest — weekly Slack or email summary of subscription movement, at-risk accounts, and outreach activity

The pipeline below connects these into a system that monitors your subscription base and acts on it — continuously.

The Subscription Management Pipeline

A complete n8n subscription system runs two parallel tracks:

Track 1 — Monitoring:
Schedule Trigger (weekly) → Stripe API → Code (segment by risk) → Switch
  → Trial expiring: Conversion email + Sheets log
  → Payment failed: Dunning email + Slack alert + Sheets log
  → Paid + inactive: CS Slack alert for high-MRR, retention email for low-MRR
  → Canceled: Win-back email + exit survey

Track 2 — Freemium Campaigns:
Schedule Trigger (weekly) → User list → Code (engagement score) → Switch
  → Active free (score ≥ 20): Upgrade campaign
  → Passive free (score 5–19): Feature highlight email
  → Dormant free (score < 5): Re-engagement sequence

Both tracks write to the same Google Sheets log — one source of truth for your subscription health.

1. Collect — Stripe Subscription Audit

Use a Schedule Trigger node set to run every Monday. The first action is an HTTP Request node calling the Stripe subscriptions API:

GET https://api.stripe.com/v1/subscriptions?status=all&limit=100
Authorization: Bearer sk_live_...

This returns your full subscription list with status, plan, trial dates, and customer IDs. A Code node flattens the response and computes key signals:

const subs = items.map(sub => ({
  id: sub.id,
  customer_id: sub.customer,
  status: sub.status,
  plan: sub.items.data[0].plan.nickname,
  mrr: sub.items.data[0].plan.amount / 100,
  trial_end: sub.trial_end,
  days_until_trial_end: Math.floor((sub.trial_end - Date.now() / 1000) / 86400),
  canceled_at: sub.canceled_at,
}));
return subs.map(s => ({ json: s }));

You now have structured subscription data ready for segmentation.

Pagination for large subscription lists

Stripe's API returns 100 records per page. If you have more than 100 active subscriptions, add a loop in your Code node that fetches subsequent pages using the starting_after parameter until the response's has_more field is false.

2. Segment — Flag At-Risk Accounts

Chain IF nodes to classify each subscription before routing:

IF (status == "trialing" AND days_until_trial_end <= 3) → Trial expiry branch
IF (status == "past_due") → Payment failure branch
IF (status == "active" AND last_login_days > 14) → Low engagement branch
IF (status == "canceled" AND canceled_within_last_7_days) → Recent churn branch

The last_login_days signal requires a second data source — your product database, Mixpanel, or Amplitude. Use an HTTP Request node to fetch the user's last event timestamp from your analytics API, then combine it with the Stripe record using a Merge node before the IF chain.

Already logging activity in Google Sheets?

Skip the analytics API entirely. Use the Google Sheets node to pull your activity log, merge on customer email, and you have the same engagement signal without any additional infrastructure.

3. Route — Branching by Risk Signal

A Switch node splits classified users into separate branches. Each branch handles its own actions independently.

Trial expiring (≤ 3 days):

  • Gmail node sends a conversion email referencing what they've built in the trial, with a direct upgrade link
  • Google Sheets logs the outreach with timestamp and recipient

Payment failure:

  • Gmail node sends a dunning email with a direct link to update the payment method
  • Slack node posts to your #revenue channel with customer name, MRR at risk, and days since failure
  • Google Sheets logs the event

Paid + inactive (last login > 14 days):

  • Gmail node sends a check-in email for standard accounts ("we noticed you haven't been active — here's how others use this feature")
  • Slack node sends a high-priority alert to your #cs-team channel for accounts above your MRR threshold so a human can reach out directly

Recent cancellation (within 7 days):

  • Gmail node sends a win-back offer within 24 hours of cancellation
  • Google Sheets logs the cancellation with plan and tenure data
Get the Smart Subscription Manager template

4. Act — Freemium Retention Campaigns

The freemium track runs on its own weekly schedule. A Google Sheets node reads your free user list (or pull from your database via HTTP Request).

A Code node scores each user by engagement signals:

const score =
  (user.logins_last_30d * 2) +
  (user.features_used * 3) +
  (user.invites_sent * 5);

return [{ json: { ...user, engagement_score: score } }];

A Switch node routes by score range:

score >= 20 → Active free → Upgrade campaign (focus: limits and team features)
score 5–19 → Passive free → Feature highlight (focus: one workflow they haven't tried)
score < 5  → Dormant free → Re-engagement (focus: "what's changed since you signed up")

Each branch sends via a Gmail node or your email platform's HTTP Request node. The messaging is different at every tier — active free users get limit-focused upgrade prompts, dormant users get a specific use case walkthrough, not a generic "come back" email.

Get the Freemium Retention Campaign template

5. Follow Up — Weekly MRR Health Digest

A Google Sheets node reads the week's log rows. A Code node computes summary metrics:

const churned = rows.filter(r => r.status === 'canceled').length;
const atRisk = rows.filter(r => r.risk_flag === 'true').length;
const contacted = rows.filter(r => r.outreach_sent === 'true').length;
const mrrAtRisk = rows
  .filter(r => r.risk_flag === 'true')
  .reduce((sum, r) => sum + parseFloat(r.mrr || 0), 0);

return [{ json: { churned, atRisk, contacted, mrrAtRisk, week: new Date().toISOString() } }];

A Slack node posts this to your #revenue channel every Monday before standup. Your team sees what's happening with subscriptions without opening a single dashboard.

Implementation Patterns

Pattern 1: Three-Touch Trial Conversion

A single conversion email on the last day converts poorly. A three-touch sequence converts significantly better:

Schedule Trigger (daily) → Stripe API → Filter (days_until_trial_end == 7) → Email 1 (use case)
Schedule Trigger (daily) → Stripe API → Filter (days_until_trial_end == 3) → Email 2 (social proof)
Schedule Trigger (daily) → Stripe API → Filter (days_until_trial_end == 0) → Email 3 (upgrade offer)

Build three separate workflows sharing the same Stripe fetch logic. Each filters for a different day offset. They run on the same daily schedule but contact different trial cohorts — 7-day, 3-day, and expiry day.

Pattern 2: High-MRR Early Warning

High-value accounts that go quiet deserve a human touch before they cancel:

Stripe API → Merge (usage data) → IF (mrr > 200 AND last_login_days > 10)
  → Slack alert to #cs-team (customer name, MRR, last active date)
  → Google Sheets (log with priority flag)

This fires weekly. Your customer success team sees a prioritized list of accounts worth a personal call — not a spreadsheet they have to generate themselves.

Pattern 3: 48-Hour Win-Back Sequence

Most teams do nothing after a cancellation. The first 48 hours are the highest-conversion window for win-back:

Stripe Webhook (customer.subscription.deleted) → Wait (2 hours)
  → Gmail (win-back with specific reason-based offer)
  → Wait (46 hours) → HTTP Request (check Stripe — did they resubscribe?)
  → IF (still canceled) → Gmail (final offer + exit survey link)

Use n8n's Wait node for the two-hour delay. The second email fires only if the customer hasn't resubscribed — verified via a Stripe API call before sending.

Connect cancellation reasons to your product backlog

Exit survey responses from cancelled users are among the highest-signal inputs you can feed into your product process. Route cancellation reasons through your feedback pipeline the same way you handle feature requests and bug reports. Read more about building that system in our guide to n8n customer feedback automation.

n8n Nodes You'll Use Most

NodePurpose
Schedule TriggerFire weekly audits and campaign batches
HTTP RequestCall Stripe API, fetch usage data from analytics platforms
CodeCompute engagement scores, flatten API responses, paginate results
IF / SwitchRoute users by risk level, engagement score, or subscription status
MergeCombine Stripe subscription data with product engagement signals
GmailSend conversion emails, dunning sequences, win-back campaigns
SlackAlert CS team to at-risk accounts, post weekly MRR digest
Google SheetsLog all outreach, track subscription status, maintain free user lists
WaitIntroduce time delays in win-back and drip sequences
WebhookTrigger instantly on Stripe events (payment failures, cancellations)

Getting Started

Pick the highest-leverage intervention for your current stage and build that piece first.

  1. Set up the Stripe HTTP Request — authenticate with your Stripe secret key and test a subscription list call to confirm the response shape
  2. Add a Code node to flatten the response and compute days_until_trial_end for each subscription
  3. Build one IF branch — start with trial expiry since it has the clearest trigger condition and immediate conversion impact
  4. Connect a Gmail node to send a single conversion email to trial-expiring users
  5. Test with a real account — find a subscription with a trial ending in the next three days and trigger the workflow manually

Once the trial expiry branch runs end-to-end, add payment failure handling. Once that works, build the weekly freemium campaign track.

The full pipeline — weekly audit, risk segmentation, conversion drips, and health digest — can be running within a weekend. After that, it runs itself.

For a broader look at how retention fits into your full marketing stack, see our guide to n8n marketing automation workflows.

Browse subscription and retention automation templates
FAQ

Common questions

Can n8n connect directly to Stripe for subscription data?
Yes. n8n's HTTP Request node calls the Stripe API to fetch subscription status, MRR, trial end dates, and customer metadata. You can also trigger workflows from Stripe webhook events like subscription cancellations or payment failures.
How does n8n identify at-risk users before they cancel?
You combine Stripe subscription data with product usage signals from your analytics API or database in a single workflow. An IF node routes users who haven't logged in for 14+ days, or who've dropped below an engagement threshold, into a retention sequence automatically.
Can n8n automate freemium-to-paid conversion campaigns?
Yes. A weekly Schedule Trigger reads your free user list, a Code node scores each user by activity, and a Switch node routes them into targeted upgrade emails for active users or re-engagement sequences for dormant ones — all without manual intervention.
Stop reading. Start running.

Get the workflow templates this guide is built on

Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.