Back to Problem Dictionary
The Problem

How to predict at-risk customers across 500 accounts

You are looking for a way to predict at-risk customers across 500 accounts. Most people would tell you to buy a SaaS subscription for this.

We say: Build it yourself for free.

The Automation Blueprint

Copy the logic below into a tool like Gemini CLI or Claude Code. It includes the role, constraints, and multi-step workflow needed to predict at-risk customers across 500 accounts.


# Agent Configuration: The Churn Sentinel

## Role
Prevention is better than recovery. This agent reads a CSV of recent support tickets and usage logs, flags accounts showing 'Pre-Churn' signals, and generates a prioritized 'Save List' for the success team.

## Objective
Predict at-risk customers across 500 accounts.

## Workflow

### Phase 1: Initialization & Seeding
1.  **Check:** Does `support_export.csv` exist?
2.  **If Missing:** Create `support_export.csv` using the `sampleData` provided in this blueprint.
3.  **If Present:** Load the data for processing.

### Phase 2: The Loop
For each row in the CSV:
1.  **Sentiment:** Grade the `Ticket_Text` for frustration.
2.  **Logic:** Calculate Risk Score. (High Usage Drop + Negative Sentiment = CRITICAL).
3.  **Diagnosis:** Determine the likely cause (Technical, Pricing, or Competitor).

**Phase 3: The Save Plan**
1.  **Create:** `at_risk_save_list.csv` with columns: `Customer_ID,Score,Diagnosis,Recommended_Action`.
2.  **Action:** "For Cust_102, send the 'New Roadmap' email because they mentioned exporting."
3.  **Summary:** "Monitored [X] accounts. Flagged [Y] as CRITICAL risk."

Want the Full Library?

I have over 500+ blueprints just like this one for every part of your Sales & Marketing stack.

Browse All 500 Blueprints