In this article
Catching Silent Churn Before Cancellation
B2B SaaS customers rarely cancel spontaneously. Weeks before the billing card is deleted or the cancellation button is pressed, usage signals decline: daily active logins decrease, key export features go unused, and team collaboration stagnates. This is “silent churn.” By implementing an automated Customer Health Scoring pipeline using n8n and PostgreSQL, Customer Success (CS) teams receive proactive Slack warnings 30 days before customer renewal risks occur.
Architected by Saizul Amin for SaaS metrics engineering and retention operations.
Customer Health Scoring Formula Matrix
| Health Factor | Weight | Measurement Criteria |
|---|---|---|
| License Utilization | 35% | Active seats / Total purchased seats (past 14 days) |
| Core Feature Adoption | 30% | Weekly execution of high-value workflow actions |
| Executive Engagement | 20% | Admin/Decision-maker login frequency |
| Support Friction | 15% | Negative tickets or unresolved bugs open > 5 days |
PostgreSQL Analytical Query for Weekly Health Calculation
-- Calculate rolling 14-day customer activity score
WITH activity_metrics AS (
SELECT
tenant_id,
COUNT(DISTINCT user_id) AS active_users,
COUNT(CASE WHEN event_name = '\''export_generated'\'' THEN 1 END) AS core_actions,
MAX(created_at) AS last_active_at
FROM app_events
WHERE created_at >= NOW() - INTERVAL '\''14 days'\''
GROUP BY tenant_id
)
SELECT
t.id AS tenant_id,
t.company_name,
t.mrr_usd,
t.seats_purchased,
COALESCE(a.active_users, 0) AS active_users,
ROUND((COALESCE(a.active_users, 0)::numeric / t.seats_purchased::numeric) * 100, 1) AS seat_utilization_pct,
CASE
WHEN a.active_users IS NULL OR a.active_users = 0 THEN '\''CRITICAL_RISK'\''
WHEN (a.active_users::numeric / t.seats_purchased::numeric) < 0.40 THEN '\''AT_RISK'\''
ELSE '\''HEALTHY'\''
END AS health_tier
FROM tenants t
LEFT JOIN activity_metrics a ON t.id = a.tenant_id
WHERE t.subscription_status = '\''active'\'';
n8n Automated Churn Intervention Workflow
- Schedule Trigger: Executes every Monday at 08:00 UTC.
- Postgres Query Node: Executes health scoring SQL script.
- Filter Node: Isolates accounts flagged as
CRITICAL_RISKorAT_RISKwhere MRR > $500. - Slack Alert & Task Creation: Alerts account manager channel with a direct link to the customer account and creates a high-priority retention task in HubSpot CRM.