Skip to content

On a schedule

Log daily support numbers and churn signals to a sheet

Every day a row of ticket numbers goes into your metrics sheet, along with any customers whose tickets hint they might leave.

Runs
On a schedule
Apps
Google Sheets, Zendesk
AI
Yes, uses the built-in AI allowance
Access
Zendesk read; sheet editor

Send this to your assistant

Create a ClickRuntime automation: every morning, add a row to my Support Metrics sheet with yesterday's new, solved and open Zendesk tickets. Use AI to spot tickets suggesting a customer might cancel, list them in the Churn tab and post a heads-up to #customer-success.

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 manager wants two things from support: a daily count they can chart, and an early warning when an account sounds unhappy. Both mean reading Zendesk every morning. On busy days it does not happen, and the chart has gaps just when it matters most.

Writing the numbers and the risk list to a sheet each morning gives a complete history to chart and a short list of accounts to call.

What you get out of it

  • A complete daily history

    One row per day, with no gaps, makes trends and seasonal peaks easy to chart.

  • Risk signals with context

    Each flagged ticket is logged with the customer and the reason, so the account manager knows what to talk about.

  • The team hears quickly

    A short Slack message points customer success to the new entries without anyone opening the sheet first.

  • Your own definitions

    You decide what counts as a risk signal, from cancellation questions to repeated bug reports.

How it works

What happens, step by step

  1. Every morning, ClickRuntime counts yesterday's new, solved and open tickets in Zendesk.

  2. It adds those numbers as a new row in your Support Metrics sheet.

  3. AI reads yesterday's tickets and picks out those that suggest a customer might leave.

  4. Each flagged ticket is added to the Churn tab with the reason, and a heads-up goes to #customer-success in Slack.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Zendesk

What you get

RunsOn a schedule
Log daily support numbers and churn signals to a sheettoday, 9:00Succeeded
Slack · #customer-success2 possible churn signals from yesterday's tickets, see the Churn tab: Northwind (asking about contract exit), Acme (third outage complaint).

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 Slack
  • Combine it with other Google Sheets and Zendesk 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.
support_metrics_and_churn_risk_log.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import date, timedelta
from clickruntime import on_trigger, http, credentials, ai, notify

ZD, AGENT = "https://yourcompany.zendesk.com/api/v2", "you@yourcompany.com"

def zd(method, path, **kw):
    r = http.request(method, ZD + path, auth=(f"{AGENT}/token", credentials.secret("ZENDESK_API_TOKEN")), **kw)
    return r.raise_for_status() or (r.json() if r.content else None)


sheets = lambda: build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
SHEET_ID = "your-spreadsheet-id"

@on_trigger
def run(event):
    day = (date.today() - timedelta(days=1)).isoformat()
    count = lambda q: zd("GET", "/search/count", params={"query": f"type:ticket {q}"})["count"]
    s = sheets()
    s.values().append(spreadsheetId=SHEET_ID, range="Metrics!A:D", valueInputOption="RAW",
                      body={"values": [[day, count(f"created:{day}"), count(f"solved:{day}"), count("status:open")]]}).execute()
    tickets = zd("GET", "/search.json", params={"query": f"type:ticket updated:{day}"})["results"][:80]
    if not tickets:
        return {"risks": 0}
    text = "\n".join(f"{i}. {t['subject']} | {t['description'][:300]}" for i, t in enumerate(tickets))
    risks = ai.generate(text, system="List tickets suggesting the customer may cancel or switch, with a short reason.",
                        json_schema={"type": "object", "properties": {"items": {"type": "array", "items": {"type": "object",
                        "properties": {"n": {"type": "integer"}, "reason": {"type": "string"}}}}}}, max_output_tokens=500).json["items"]
    rows = [[day, tickets[r["n"]]["id"], tickets[r["n"]]["subject"], r["reason"]] for r in risks]
    if rows:
        s.values().append(spreadsheetId=SHEET_ID, range="Churn!A:D", valueInputOption="RAW", body={"values": rows}).execute()
        notify.slack(f"{len(rows)} possible churn signals from yesterday's tickets, see the Churn tab.", channel="#customer-success")
    return {"risks": len(rows)}

FAQ

Common questions

Which numbers go into the daily row?
New, solved and still-open tickets for the previous day. You can add first reply time or satisfaction if your plan reports them.
How does AI decide a ticket is a churn risk?
It reads the ticket text against the signs you describe, such as asking about cancelling, exporting data or mentioning another provider.
Can it skip the Slack message?
Yes. It can log to the sheet only, or post only when at least one risk is found.
What permissions does it need?
Zendesk read; sheet editor. 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 (on a schedule). 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 “Log daily support numbers and churn signals to a sheet” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.