All Projects
Customer Health & Churn Alert
Predict Customer Churn With AI Analysis

A comprehensive customer health monitoring system that loops through all HubSpot deals, deploys an AI agent to gather deal data, contact information, support ticket history, and product feature usage from Google Sheets. It performs sentiment analysis on every support ticket, converts sentiments to numerical scores, and feeds all signals into an AI chain that evaluates churn risk against three thresholds: deal age (>1 year since close), negative sentiment score, and declining feature usage. When risk is detected, it generates a professionally formatted HTML alert email with risk classification (Low/Medium/High) and recommended retention actions for the Customer Success team.
Tech Stack
| Layer | Technology |
|---|---|
| Automation Platform | n8n |
| AI / LLM | OpenAI GPT-5-mini (Agent + Sentiment + Churn Analysis) |
| CRM Data Source | HubSpot (Deals, Contacts, Tickets via MCP) |
| Feature Usage Data | Google Sheets |
| Sentiment Analysis | n8n LangChain Sentiment Analysis node |
| Alert Delivery | SMTP Email (HTML formatted) |
| Data Format | Structured JSON output with schema validation |
| Triggers | Manual trigger (batch analysis) + Webhook (ticket scoring) |
Workflow Architecture
[Flow 1: Ticket Scoring Sub-workflow]
Webhook (receive tickets)
-> Code: Format Tickets
-> Loop: For Each Ticket
-> AI Sentiment Analysis (Positive/Neutral/Negative)
-> Merge Results
-> Convert Sentiment to Score (+10/+5/-10)
-> Sum All Scores
-> Respond with Total Score
[Flow 2: Main Churn Analysis]
Manual Trigger
-> HubSpot: Get All Deals
-> Loop: For Each Deal
-> AI Agent: Gather Customer Data
(Tools: HubSpot MCP, Sentiment Scorer, Google Sheets)
-> Code: Group Feature Data by Name
-> AI Chain: Analyze for Churn Risk
-> Structure Alert Email (subject + message)
-> Convert Markdown to HTML
-> Send Churn Alert Email
-> Next Deal (loop)Business Outcomes
| Metric | Impact |
|---|---|
| Churn prediction coverage | 100% of deals analyzed -- no customer falls through the cracks |
| Early warning system | Detects churn signals (negative sentiment, declining usage, stale deals) before renewal conversations |
| Actionable alerts | Each alert includes risk level (Low/Medium/High) + 2-3 concrete retention actions |
| Multi-signal analysis | Combines 3 data dimensions: deal age, support sentiment, feature usage trends |
| Sentiment scoring | Every support ticket scored (+10 positive, +5 neutral, -10 negative) for aggregate health view |
| CS team efficiency | Replaces hours of manual CRM digging with automated, prioritized alerts |
Technical Metrics
| Metric | Value |
|---|---|
| Nodes in workflow | 19 (across 2 connected flows) |
| AI model calls per deal | 3+ (data gathering agent, sentiment per ticket, churn chain) |
| Churn thresholds | 3 (deal age over 1 year, sentiment below 0, declining usage) |
| Sentiment scoring | +10 (Positive), +5 (Neutral), -10 (Negative) |
| External integrations | 4 (OpenAI, HubSpot MCP, Google Sheets, SMTP) |
| Output format | Structured JSON -> Markdown -> HTML email |
| Sub-workflows | 1 (ticket scoring via internal webhook) |
Estimated Cost Savings (If Implemented)
| Item | Manual Cost | Automated Cost |
|---|---|---|
| CS analyst time per account review (30 min @ $35/hr) | $17.50/account | ~$0.05 (API calls) |
| 100 accounts/quarter | $1,750/quarter | ~$5/quarter |
| Prevented churn (1 account @ $10K ARR) | $10,000 recovered | -- |
| Annual savings (100 accounts, 5% churn prevention) | -- | ~$50,000-$57,000/year (5 accounts saved + analyst time) |