Push Databricks churn risk scores into Salesforce every morning
Every weekday we write your lakehouse account health scores onto Salesforce records and alert customer success only when an account newly turns at risk.
Every weekday at 7am, run my account health query on my Databricks SQL warehouse and put the results in front of my customer success team inside Salesforce, instead of leaving them in a dashboard nobody opens.
Submit the query with Execute SQL Statement, passing the id of my SQL warehouse. Databricks runs statements asynchronously, so poll Get SQL Statement until status.state is SUCCEEDED before reading any rows, and pull the remaining chunks if the result set comes back paged. Each row should give me the account identifier, the current churn risk score, the change versus last week, and the usage signals driving it, such as declining logins, dropped seat count, falling feature adoption, or rising support volume.
For each row, find the matching Salesforce account with SOQL Query, matching on whichever identifier my lakehouse stores, such as the Salesforce account id, an external id field, or the company domain. Before you write anything, read the churn score currently sitting on that Salesforce record, because I need the old value to decide whether this is news. Then write the latest score onto the record with Update Account.
Treat an account as newly at risk when this week's score crosses my at-risk threshold and the score already stored on the Salesforce record was still in the healthy range. That comparison is my deduplication rule: if the record was already showing an at-risk score, the account was flagged in an earlier run and my reps should not hear about it again. Keep the score updated on every account regardless of which side of the line it falls on, and gate only the alerting. A score that is high but flat, or that is moving in the healthy direction, is not an alert.
For every newly at-risk account, add a short plain-English explanation with Add Note to Account. Write it the way I would explain it to a rep who has 30 seconds: name the one or two usage signals that actually moved the score and say what changed, rather than dumping raw numbers. Then open a follow-up for that account's owner with Create Task, assigning it to the account's owner id, with a due date in the next few days and a subject that makes the reason obvious in a task list.
Finish by posting a single Slack Bot message to my customer success channel with Send a Message. List only the newly at-risk accounts, grouped by the owner who now has a task, with the top reason for each one. Resolve owner names with Get Many Users so the digest reads with real names rather than record ids. One message per run, not one message per account.
If nothing crossed the threshold, post nothing at all, and do not add notes or create tasks. A silent run is the correct outcome on a quiet day. Make the at-risk threshold and the weekday 7am schedule easy for me to change later, and assume the churn score already exists as a modeled table or view in my lakehouse, since this workflow distributes that score rather than computing it.
What does this prompt do?
- Runs your account health query in Databricks each weekday morning and waits for the results, so the numbers your team sees are always current.
- Writes the latest churn risk score straight onto each matching Salesforce account, so reps see it on the record instead of in a dashboard nobody opens.
- Spots accounts that just crossed from healthy into at risk, adds a short plain-English explanation to the account, and opens a follow-up task for whoever owns it.
- Posts one Slack digest to your customer success channel listing only the newly at-risk accounts, grouped by owner, with the top reason for each.
- Stays quiet when nothing changed. Accounts flagged in an earlier run are skipped, so nobody gets the same alert twice.
What do I need to use this?
- A Databricks workspace with a SQL warehouse and a table or view that already holds your account health or churn score
- A Salesforce login that can update accounts, add notes, and create tasks
- A Slack workspace and the channel your customer success team actually reads
- A field on your Salesforce account records to hold the score
- A shared identifier, such as an account ID or domain, that links your lakehouse rows to Salesforce accounts
How can I customize it?
- Change the timing. Every weekday at 7am is a starting point, and Monday only or twice daily work just as well.
- Set your own at-risk threshold and decide how big a weekly jump has to be before it earns a rep's attention.
- Pick which usage signals show up in the explanation, such as logins, seat count, feature adoption, or support volume.
- Send the digest somewhere else, or message each account owner directly instead of posting to a shared channel.
FAQs
Do I need to build a churn model first?
Will my reps get the same alert every week for the same account?
What happens if no accounts are at risk that day?
Can I use this with HubSpot instead of Salesforce?
Why put the score in the CRM instead of a dashboard?
Related templates
Stage a batch of filings overnight, then approve each completed form from a screenshot before anything is ever submitted.
Pick a client and a date range to see sent, replies, meetings booked and the real deal value your cold email produced, campaign by campaign.
Review every conversation Fin closed as resolved, judge which ones actually stuck, and see what the gap is worth against your bill.
Merge your IT, HR and Facilities queues into one list ranked by SLA time left, then reply, change status and escalate without ever opening Jira.
See every page's translation status at a glance, edit translations side by side with the English, and publish only what your team has actually approved.
One place for sales and ops to request an NDA or vendor agreement, watch its status, and let legal launch the contract in a single click.
Get churn risk in front of the people who can act on it.
Your lakehouse already knows which customers are slipping. This puts that answer on the account record and in your team's Slack, every weekday morning.