Salesforce Churn Risk Alert
FreeRuns every morning at 8 AM, queries all Customer accounts in Salesforce for inactivity, open cases, and missing renewal opportunities, scores each account 0–100, and posts a prioritized risk briefing to #cs-alerts for any account scoring above 60. CSMs see exactly which accounts need attention before the day starts.
Workflow Overview
Salesforce Churn Risk Alert
Automatically scans your Salesforce customer accounts every weekday morning at 8 AM, calculates a churn risk score (0–100) based on inactivity, open cases, and missing opportunities, and posts formatted alerts to Slack for high-risk accounts.
Prerequisites
- n8n instance (self-hosted or n8n Cloud)
- Salesforce account with API access enabled
- Slack workspace with a bot OAuth token
- n8n Salesforce credential (OAuth2) — setup guide
- n8n Slack credential (OAuth2) — setup guide
Setup Steps
1. Import the workflow
In n8n, go to Workflows → Import from File and select workflow.json.
2. Configure Salesforce credentials
- Open the "Query Salesforce Accounts" node
- Click the Credentials dropdown → Create New
- Follow the Salesforce OAuth2 setup (you need a Connected App in Salesforce with
apiandrefresh_tokenscopes) - Required Salesforce permissions:
Readaccess onAccount,Case, andOpportunityobjects
3. Configure Slack credentials
- Open the "Post Risk Alert to Slack" node
- Click the Credentials dropdown → Create New
- Add your Slack Bot Token (starts with
xoxb-) - Required Slack scopes:
chat:write,chat:write.public
4. Set your Slack channel
- In the "Post Risk Alert to Slack" node, change
#cs-alertsto your target channel - Make sure the Slack bot is invited to that channel (
/invite @your-bot-name)
5. Tune the risk threshold (optional)
- Open the "Risk Score Above 60?" IF node
- Change the value
60to your preferred threshold - Recommended ranges: 60 = high attention, 75 = critical only
6. Adjust the SOQL query (optional)
- Open the "Query Salesforce Accounts" node
- Default inactivity window is
LAST_N_DAYS:30— change toLAST_N_DAYS:14for tighter monitoring - If your accounts use a custom field for customer type, replace
Type = 'Customer'with your condition
7. Activate the workflow
- Toggle the workflow to Active
- It will run Monday–Friday at 8:00 AM server time
Risk Score Breakdown
| Signal | Weight | Max Points |
| Days since last Salesforce activity | 40% | 40 pts |
| Open cases created in last 30 days | 30% | 30 pts |
| No open renewal/expansion opportunity | 15% | 15 pts |
| No logged activity in 14 days | 15% | 15 pts |
- 75–100: 🔴 Critical — escalate immediately
- 60–74: 🟠 High — review same day
- 40–59: 🟡 Medium — monitor closely
- 0–39: 🟢 Low — healthy
Slack Message Format
🚨 *Churn Risk Alert: Acme Corp*
Risk Score: *78/100* — 🔴 Critical
*Top Risk Factors:*
• No activity in 47 days
• 4 open case(s) in last 30 days
• No open renewal or expansion opportunity
*CSM:* Jane Smith
*Salesforce:* https://login.salesforce.com/001...
Troubleshooting
"No accounts returned" from Salesforce- Check that
Type = 'Customer'matches your Account Type picklist exactly — it's case-sensitive in SOQL - Verify your Salesforce user has read access to the Account, Case, and Opportunity objects
- Confirm the bot is invited to the channel:
/invite @your-bot-name - Check that your Slack credential has
chat:writescope
- The workflow reads
Owner.Namevia a relationship query. If your Salesforce org uses a custom field for the CSM, changeOwner.Namein the SOQL and update theownerNamereference in the Code node toaccount.CSM_Name__c(or your field API name)
- Check that Salesforce is returning
LastActivityDate— if all accounts show null, activity logging may be disabled in your org (Settings → Activity Settings → Enable Activity Feed)
Template Details
Category
Risk Detection
Platform
n8n
Difficulty
Intermediate
Setup Time
20 minutes
Version
1.0.0
Last Updated
2026-04-14
Integrations
⬇ Download
You Might Also Like
HubSpot Onboarding Tracker
Daily check of HubSpot onboarding deals to catch customers falling behind their milestone schedule.
Intercom Ticket Escalation to Slack
Webhook-triggered escalation: routes high-priority Intercom conversations to Slack with an AI-generated summary.
Sales-to-Implementation Handoff Analyzer
Pulls Salesforce opportunity data and Gong call recordings, scores intake readiness, and generates an AI-powered implementation brief via email.