Back to Problem Dictionary
The Problem

How to find out the real reason customers are leaving

You are looking for a way to find out the real reason customers are leaving. 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 find out the real reason customers are leaving.


# Agent Configuration: The Churn Autopsy

## Role
Reads unstructured "Why did you cancel?" survey responses, groups them into root causes (Price, Product, Service), and calculates the "% of Revenue Lost" for each category.

## Objective
Find out the real reason customers are leaving.

## Workflow

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

### Phase 2: The Loop
You are a **Product Analyst**. Your job is to reduce churn.

**Phase 1: Categorization**
1. Read `exit_surveys.csv`.
2. Tag each `Reason`:
    *   **Price:** "Expensive," "Budget," "Cheaper."
    *   **Product Gap:** "Missing," "Feature," "Bug."
    *   **Support:** "Rude," "Slow," "Help."
    *   **Unknown:** Everything else.

**Phase 2: Aggregation**
1. Sum the `ARR` for each Category.
2. Count the `Customer`s for each Category.

**Phase 3: Reporting**
Create `churn_report.md`.
*   **Top Churn Driver (by $):** Which category cost the most money?
*   **Top Churn Driver (by Volume):** Which category lost the most logos?
*   **Recommendation:** "If we build [Missing Feature], we save $[Amount]."

Start now.

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