Daily
Hear when a big deal starts looking risky
Each day your large Salesforce deals get a risk score, and the owner gets a Slack message when one jumps, with the reason.
- Runs
- Daily
- Apps
- Salesforce, Slack
- AI
- Yes, uses the built-in AI allowance
- Access
- api; chat:write, users:read.email
Send this to your assistant
Create a ClickRuntime automation: every day, score open Salesforce deals over $20k for risk from 1 to 10, and DM the owner in Slack when a deal's score goes up by 2 or more, saying why.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
On a team with a handful of large deals each quarter, one slipping can decide the number. The warning signs, like a pushed close date, a missing next step or two quiet weeks, build up gradually, and the owner is often the last to admit the deal is in trouble.
This automation scores every open deal over $20k each day and remembers yesterday's score. When a deal's risk jumps, the owner gets a direct message in Slack explaining why, while there's still time to do something.
What you get out of it
Alerts on change, not noise
Owners only hear about a deal when its risk rises noticeably, so the messages stay worth reading.
A reason with every score
Each message says what changed, like the close date being pushed again, so the owner knows what to fix.
Private to the owner
The message goes to the deal owner as a direct message, not a public channel, which keeps the tone helpful.
Focus on the deals that matter
Only deals above your size threshold are scored, so attention goes where the revenue is.
How it works
What happens, step by step
Every day the automation finds open Salesforce deals worth more than $20k.
AI gives each one a risk score from 1 to 10 with a one-line reason.
It compares each score with the one from the previous run.
If a score has risen by 2 or more, the deal owner gets a direct message in Slack.
Before it runs live
- Connect Salesforce
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Salesforce and Slack steps into one automation
Under the hood
The code that runs this automation
from slack_sdk import WebClient
from clickruntime import on_trigger, credentials, http, state, ai
INSTANCE = "https://yourcompany.my.salesforce.com"
API = f"{INSTANCE}/services/data/v61.0"
def soql(headers, q):
return http.get(f"{API}/query", headers=headers, params={"q": q}).json()["records"]
SCHEMA = {"type": "object", "properties": {"score": {"type": "integer"}, "reason": {"type": "string"}},
"required": ["score", "reason"]}
@on_trigger
def run(event):
headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
deals = soql(headers, "SELECT Id, Name, Amount, StageName, CloseDate, PushCount, NextStep, LastActivityDate, "
"Owner.Email FROM Opportunity WHERE IsClosed = false AND Amount > 20000 ORDER BY Amount DESC LIMIT 40")
slack = WebClient(token=credentials.connection("slack", "work"))
scores, alerted = state.get("scores") or {}, 0
for d in deals:
r = ai.generate(f"Rate the risk of this deal slipping or being lost, 1 (safe) to 10, with a one-line reason.\n"
f"{d['Name']} | {d['Amount']} | {d['StageName']} | close {d['CloseDate']} | pushed {d['PushCount']} times | "
f"next step: {d['NextStep'] or 'none'} | last activity {d['LastActivityDate'] or 'never'}",
json_schema=SCHEMA, max_output_tokens=80).json
before = scores.get(d["Id"])
if before is not None and r["score"] - before >= 2:
user = slack.users_lookupByEmail(email=d["Owner"]["Email"])["user"]["id"]
slack.chat_postMessage(channel=user, text=f"Risk on <{INSTANCE}/{d['Id']}|{d['Name']}> went from "
f"{before} to {r['score']}/10: {r['reason']}")
alerted += 1
scores[d["Id"]] = r["score"]
state.set("scores", scores)
return {"scored": len(deals), "alerted": alerted}FAQ
Common questions
How does it find the owner in Slack?
What does the risk score look at?
Why didn't I get a message on the first day?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Spot risky renewals 90 days out
Every Monday, customer success sees which accounts renewing in the next 90 days show warning signs, and why.
See how it worksGet a morning list of deals that have gone quiet
Each weekday, every rep sees which of their Salesforce deals haven't moved in two weeks, with a suggested next step for each.
See how it worksGet a Friday list of deals that break your sales rules
Every Friday, each rep sees which of their open deals have missing fields, an out-of-date close date or a discount over your limit.
See how it worksKeep exploring
Set up “Hear when a big deal starts looking risky” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.