# Zap blueprint: Tag why deals were lost

**This is a blueprint, not an import file.** Zapier has no public format for importing Zaps, so you rebuild these steps by hand in the Zap editor. It takes about 10–20 minutes (our estimate).
Create a new Zap: https://zapier.com/app/editor
Full recipe: https://recipeagents.usestarbase.com/recipes/lost-deal-reason-tagger

## Steps
1. **Trigger:** Pipedrive: Updated Deal Stage
   - Recipe input: CRM deal marked lost, with notes
2. **Filter by Zapier** (optional): only continue if the input is the kind you want (see the recipe's failure modes).
3. **Action:** ChatGPT (OpenAI): Conversation, or AI by Zapier
   - Paste this prompt and map the trigger fields into the {{...}} placeholders:

```
Classify why this deal was lost into exactly one of: PRICE, TIMING, COMPETITOR, NO_DECISION, FIT, UNKNOWN. Return JSON {category, quote} where quote is the phrase from the notes that supports it. Notes: {{notes}}
```
4. **Action:** Formatter by Zapier → Utilities → Import JSON / or Code by Zapier, to split the JSON fields (if the prompt returns JSON).
5. **Action:** Google Sheets: Create Spreadsheet Row
6. **Test each step** with a real example, then turn the Zap on. Keep a human approval on anything customer-facing.

## Recipe steps (from the page)
- Trigger: deal stage changes to Lost.
- AI step classifies the notes.
- Write the category into a custom dropdown field.
- Monthly: export and count.

## Where it breaks
- Two reasons at once: “Cheaper competitor” could be PRICE or COMPETITOR. Write down your rule once and add it to the prompt.

App and step names follow Zapier's current app directory as of 2026-10-16. Names change, so search the app in the editor if a step looks different.
