Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every morning ClickRuntime collects the HubSpot tickets from the last 30 days.

  2. It groups them by company.

  3. AI reads each company's tickets and rates how likely it is to leave, with a short reason.

  4. 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

RunsDaily
Spot customers at risk of churning from support ticketstoday, 9:00Succeeded
Slack · #cs🔴 Acme Retail: 4 tickets about failed exports in two weeks, last one asks how to move their data out.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
churn_risk_alerts_from_hubspot_tickets.pyexample
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?
All tickets linked to a company in HubSpot from the last 30 days, open or closed. Tickets not linked to a company are skipped.
What makes an account look at risk?
Repeated issues, rising ticket volume, frustrated wording, mentions of cancelling or of other products, and long waits for answers.
Will it flag the same company every day?
A company stays on the list while its recent tickets still suggest a risk. Once things improve, it drops off on its own.
What permissions does it need?
HubSpot tickets, companies read; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.