Build a Churn Prediction Alert with n8n and Stripe

Customer churn is one of the most expensive problems a SaaS business faces. By the time a customer cancels, the opportunity to intervene is already gone. The smarter move is to catch the signal early

Build a Churn Prediction Alert with n8n and Stripe

Customer churn is one of the most expensive problems a SaaS business faces. By the time a customer cancels, the opportunity to intervene is already gone. The smarter move is to catch the signal early — when subscription activity starts to look wrong — and act before the cancellation happens. This article walks through how to build a churn prediction alert using n8n and Stripe, so your team gets notified the moment a customer shows signs of leaving.

What "churn signal" actually means in Stripe

Most businesses focus on the cancellation event itself, but Stripe exposes earlier warning signals you can act on. The three most reliable ones are:

  • Failed payment + retry window open: A card decline doesn't always mean the customer wants to leave, but multiple failed retries in a short window is a strong signal.
  • Subscription paused or downgraded: Moving from a higher to a lower plan often precedes cancellation by 30–60 days.
  • Dispute or refund requested: A customer who opens a dispute is almost certainly not renewing.

Each of these events fires a webhook from Stripe. Your n8n workflow listens for them, evaluates severity, and routes the alert to the right channel — Slack, email, or your CRM.

Building the workflow in n8n

The architecture is straightforward: a Stripe webhook trigger feeds into a logic layer that scores the churn risk, then branches to notification actions. Here's how each piece works.

  • Trigger node — Stripe Webhook: Configure n8n to listen on customer.subscription.updated, invoice.payment_failed, and charge.dispute.created. You can filter by specific events or catch all and filter inside the workflow.
  • Switch node — event classification: Route each event type to its own branch. Payment failures go one way, downgrades another, disputes a third. This keeps logic clean and independently editable.
  • Function node — risk scoring: Assign a numeric score to each signal. For example: first failed payment = 2 points, second failed payment within 7 days = 5 points, downgrade = 4 points, dispute = 8 points. Pull the customer's existing score from a simple data store (n8n's built-in static data or an Airtable/Notion lookup), add the new points, and write it back.
  • IF node — threshold check: If the cumulative score exceeds your threshold (e.g., 7), route to the alert branch. Below threshold, log the event silently for reporting.
  • Alert branch — Slack + CRM update: Send a Slack message to your customer success channel with the customer name, risk score, and a direct link to their Stripe dashboard. Optionally update a field in HubSpot or Pipedrive to tag the account as "churn risk."

The entire workflow can be built and running in under two hours. The scoring logic is the part most teams customize — start simple and adjust thresholds based on what your data shows over 30 days.

Common mistakes to avoid

Most churn alert systems fail not because the technical setup is wrong, but because the operational side isn't ready. Watch out for these:

  • Alerting without context: A Slack message that says "customer X is at risk" with no history is useless. Include the MRR value, account age, and the specific events that triggered the score. Your CS team needs to act, not investigate.
  • Not deduplicating events: Stripe can fire the same webhook more than once. Add a deduplication check using the event ID before scoring — otherwise a single failed payment can trigger three alerts.
  • Ignoring the retry window: Stripe's smart retries happen automatically over several days. Don't alert on the first failure. Alert on the second failure, or when the subscription moves to past_due status.
  • Static thresholds: A threshold that works for a $49/month plan doesn't apply to a $2,000/month enterprise account. Consider segmenting your scoring by plan tier from day one.

Extending the workflow

Once the core alert is running, there are a few natural extensions that add significant value without much extra work:

  • Automated outreach: If the risk score hits a critical threshold and no CS rep has responded within 24 hours, trigger an automated email from the founder or account manager. Personalized, plain-text, short.
  • Weekly churn risk report: Add a scheduled node that queries your data store every Monday morning and posts a ranked list of at-risk accounts to Slack. Gives your team a weekly starting point.
  • Discount offer trigger: For self-serve accounts below a certain MRR, automatically send a retention offer via email when the risk score exceeds a threshold. High-touch response doesn't make economic sense at low price points — automation does.

If you'd rather skip the build and start with a working foundation, there are ready-made n8n templates for Stripe automation that include the webhook handling, branching logic, and Slack integration already wired up. Modify the scoring rules and thresholds to fit your business, and you're operational the same day.

A churn prediction system built on n8n and Stripe gives you something most businesses don't have: visibility into customer health before it becomes a revenue problem. The signal is already in your Stripe data. This workflow just makes sure someone sees it in time to act.

Stripe to HubSpot + Onboarding
PRONTO PARA USAR

Ja construimos isso pra voce

Nao comece do zero. O Stripe to HubSpot + Onboarding e um workflow n8n pronto para instalar que faz exatamente isso — em minutos, nao horas.

Instalar por $49 →