Build a Churn-Risk Watch Agent
A Churn-Risk Watch agent catches accounts heading into a risky renewal and drafts the next step for a CSM — automatically, on a schedule. It's a good first AI Agent: one clear use case, built on the Detect → Investigate → Act shape from Design an Agent.
Detect: accounts renewing at risk
Give the agent a Query trigger that returns one row per account you want it to watch — here, accounts renewing within 90 days that also look risky:
SELECT account_id
FROM accounts
WHERE subscription_remaining_days > 0
AND subscription_remaining_days <= 90
AND (prediction = 'churn' OR health_score <= 45)
Each returned row starts one run, and identical rows aren't re-run, so every at-risk account is handled once. Add an account filter if you want to scope it further (for example, to enterprise accounts).
Investigate: read the account before deciding
Add an AGENT step with a semantic.query tool so the model can read the account's accrued context before it drafts anything — its open needle movers, driving factors, dossier concerns, and recent conversations. Write the step's prompt to cite what it found, so the CSM reviewing the output can check it. (See the Investigate column in Design an Agent.)
Act: draft for a person, or alert the team
Choose who's in control:
- Assist (recommended to start).
tasks.createproduces an Action Card — the recommended step, the reasoning, and a drafted email — for the CSM to review and send. - Auto.
slack.send_messageposts an alert to the account team's channel.
Anything a customer will read starts in Assist; move it to Auto only once its drafts go out without edits.
Build it
- On the canvas — follow Getting started with agents to add the trigger, the AGENT step, and the action.
- With Claude — with the MCP server connected, describe the agent and let Claude build it (vibe coding). It saves a draft, previews which accounts the trigger picks up, and test-runs it before you publish.
Test on a recent at-risk account first. A draft doesn't run on its own, so nothing reaches a customer until you publish it.
Measure
Watch the Action Cards the agent creates and how many lead to a saved renewal. For a programmatic, cohort-based version that measures ARR protected, see Prevent churn with a Retention Outcome Agent.
Related
- Design an Agent: Detect, Investigate, Act — the worksheet behind this agent.
- Agent triggers and the Functions reference.
- Action Cards — what an Assist agent produces.