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.

Agentic Task
DatabricksSalesforceSlack BotSalesOperationsData SyncNotifications & Alerts
PromptCreate

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?
Yes. This workflow activates a score you already have. It reads the account health or churn score your data team has modeled in your lakehouse and puts it in front of your reps. It does not calculate the score itself.
Will my reps get the same alert every week for the same account?
No. Before writing the new score, the workflow checks what was already on the Salesforce record. If the account was already showing an at-risk score, it was flagged in an earlier run and is skipped. Only accounts that just crossed from healthy into at risk generate a note, a task, and a line in the digest.
What happens if no accounts are at risk that day?
Nothing gets posted. No Slack message, no notes, no tasks. A silent run is the correct outcome on a quiet day, which is what keeps the channel worth reading.
Can I use this with HubSpot instead of Salesforce?
Yes. Salesforce is the default here, but the same pattern works with HubSpot or another CRM. The score still lands on the company record, and the follow-up still goes to the account owner.
Why put the score in the CRM instead of a dashboard?
Because reps work in the CRM. A health score sitting in a dashboard only helps the people who open the dashboard, while a score on the account record shows up in the same view a rep is already using to decide who to call today.

Related templates

Share of voice dashboard for your brand and competitors

See how your brand's news coverage and sentiment stack up against four competitors, then let an assistant write the weekly report for you.

GDELT
Notion
Slack Bot
App
Approval war room for every social post awaiting sign-off

One screen showing every social post waiting on approval, sorted by deadline, so reviewers can approve or reject without leaving the page.

Hootsuite
Slack Bot
App
Turn champion job changes into new pipeline in Attio

Every Monday, find the past champions and closed-won contacts who changed jobs, update Attio, and get the moves worth chasing in Slack.

Boomerang
Attio
Slack Bot
Agentic Task
Collect social post requests and schedule them in Hootsuite

Staff submit what happened, your social manager edits the copy, picks the accounts and puts it on the calendar without a single spreadsheet.

Hootsuite
Slack Bot
General Input Database
App
Voice agent QA review board for your Hume EVI calls

Open one board each morning, see which voice calls went badly, replay the exact moment the caller got frustrated, and file the fix.

Hume
Linear
Slack Bot
App
Clear your Guru verification backlog in one weekly app

A personal queue of every overdue Guru card, sorted by how late it is, with one-click verify, reassign, comment, and an agent that drafts the refresh for you.

Guru
Slack Bot
App

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.