Daily
Spot customers at risk of churning from support tickets
Each morning #cs gets a short list of customers whose recent tickets suggest they might leave, with the reason for each.
- Runs
- Daily
- Apps
- HubSpot, Slack
- AI
- Yes, uses the built-in AI allowance
- Access
- HubSpot tickets, companies read; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every morning, check HubSpot tickets from the last 30 days, score churn risk per company and post the at-risk ones in #cs.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A customer success team looks after a few hundred accounts. The warning signs of churn are usually in the support queue: the same bug reported three times, a frustrated tone, a question about how to export data. Each ticket is handled, but nobody sees the pattern across them until the cancellation email arrives.
This automation reads the last month of tickets for each company every morning and flags the accounts that look unhappy, so the account manager can call before the customer decides to leave.
What you get out of it
Problems are seen account by account
Grouping tickets by company shows when one customer is struggling, even if each ticket was handled by a different person.
Time to act before renewal
A call made while the customer is frustrated can save the account. A call after they have given notice rarely does.
A reason, not just a score
Each flagged account comes with a short explanation, so the account manager knows what to talk about.
A morning routine for the team
One post in #cs at the start of the day gives the team a clear list of who to check in with.
How it works
What happens, step by step
Every morning ClickRuntime collects the HubSpot tickets from the last 30 days.
It groups them by company.
AI reads each company's tickets and rates how likely it is to leave, with a short reason.
Companies that look at risk are posted in your #cs Slack channel.
Before it runs live
- Connect HubSpot
- 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 HubSpot and Slack steps into one automation
Under the hood
The code that runs this automation
import time
from collections import defaultdict
from clickruntime import on_trigger, credentials, http, notify, ai
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.secret('HUBSPOT_API_KEY')}"}
since = int(time.time() * 1000) - 30 * 86400000
body = {"filterGroups": [{"filters": [{"propertyName": "createdate", "operator": "GTE", "value": since}]}],
"properties": ["subject", "content", "hs_pipeline_stage"], "associations": ["companies"], "limit": 100}
tickets = http.post("https://api.hubapi.com/crm/v3/objects/tickets/search", json=body, headers=h).json()["results"]
by_co = defaultdict(list)
for t in tickets:
ids = http.get(f"https://api.hubapi.com/crm/v4/objects/tickets/{t['id']}/associations/companies", headers=h).json()["results"]
if ids:
by_co[ids[0]["toObjectId"]].append(f"{t['properties']['subject']}: {(t['properties'].get('content') or '')[:300]}")
lines = []
for co, items in by_co.items():
name = http.get(f"https://api.hubapi.com/crm/v3/objects/companies/{co}", headers=h).json()["properties"]["name"]
r = ai.generate(["Rate churn risk from these support tickets.", "\n".join(items)], max_output_tokens=120,
json_schema={"type": "object", "properties": {"risk": {"enum": ["low", "medium", "high"]}, "reason": {"type": "string"}}}).json
if r["risk"] != "low":
lines.append(f"{'🔴' if r['risk'] == 'high' else '🟠'} {name}: {r['reason']}")
if lines:
notify.slack("Churn watch\n" + "\n".join(lines), channel="#cs")
return {"companies": len(by_co), "flagged": len(lines)}FAQ
Common questions
Which tickets does it look at?
What makes an account look at risk?
Will it flag the same company every 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
Review each week's lost HubSpot deals with AI in Slack
Every Friday your sales channel gets the common reasons deals were lost this week and ideas for which ones to revisit.
See how it worksPost a weekly HubSpot leads and revenue summary in Slack
Every Monday your sales channel sees last week's new contacts, stage changes and won deals in one short message.
See how it worksFlag HubSpot deals that have gone quiet
Every morning your sales channel lists deals with no activity in 21 days, with the owner tagged so they can follow up.
See how it worksKeep exploring
Set up “Spot customers at risk of churning from support tickets” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.