Pipeline Hygiene Agent
🟡 GrowthFlags stale, incomplete, or risky opportunities (missing amounts, past close dates, vague next steps) and recommends cleanup — never auto-closes deals
Adam's take
Forecast meetings are only as honest as the pipeline under them. This agent recommends cleanup rather than doing it, because deleting a rep's deal by robot is how RevOps loses the room.
Required tools
Optional tools
Expected value
Cleaner pipeline; forecast trust; fewer surprise slips
Deployable workflow pack
The full pack includes the agent spec, deployment guide, architecture diagrams, n8n workflow skeleton, Clay template, HubSpot properties, JSON schemas, OpenAPI spec, cost and ROI calculators, demo data, QA checklist, and governance notes.
View pack on GitHubHow to deploy this agent
Every sales leader has sat through a forecast call where a deal "closing this week" turns out to have no next step logged and hasn’t been touched in three weeks. The ten checks that catch this are simple individually; running all ten, on every open deal, every day, by hand, is the part nobody has time for. This agent runs them daily and recommends cleanup — it never closes or re-stages a deal itself.
Core signals
Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://deploytheagent.com/schemas/agent-009-input.schema.json",
"title": "Agent #009 Pipeline Hygiene Agent Input",
"type": "object",
"required": [
"record_id"
],
"properties": {
"record_id": {
"type": "string",
"description": "CRM record ID (company/contact/deal depending on agent)."
},
"domain": {
"type": "string"
},
"config_version": {
"type": "string",
"description": "Versioned config used for this run."
}
},
"additionalProperties": true
}Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://deploytheagent.com/schemas/agent-009-output.schema.json",
"title": "Agent #009 Pipeline Hygiene Agent Output",
"type": "object",
"required": [
"record_id",
"pipeline_hygiene_score",
"pipeline_hygiene_flags",
"pipeline_hygiene_recommendations",
"pipeline_hygiene_scan_date"
],
"properties": {
"record_id": {
"type": "string"
},
"pipeline_hygiene_score": {
"type": "string",
"description": "Agent #009 output field."
},
"pipeline_hygiene_flags": {
"type": "string",
"description": "Agent #009 output field."
},
"pipeline_hygiene_recommendations": {
"type": "string",
"description": "Agent #009 output field."
},
"pipeline_hygiene_scan_date": {
"type": "string",
"description": "Agent #009 output field."
}
},
"additionalProperties": false
}Scoring / classification logic
Hygiene score starts at 100 and subtracts points per failed check, floored at 0. Every flagged issue comes with a specific, generated recommendation — "Close date is 4 days in the past, confirm new close date or update forecast category" — not a generic "clean up this deal" nudge.
HubSpot CRM properties
n8n workflow skeleton
The Pipeline Hygiene Agent scans every open opportunity for the ten checks that quietly break forecast trust — missing amount, missing or past close date, no next step, stale activity, no champion — and recommends cleanup actions. It never closes or re-stages a deal itself. Configure every node marked CONFIGURE before enabling the trigger.
- TriggerCONFIGURE: set cadence per agent-spec.md's What It Does section. Leave disabled until Step 6 of deployment-guide.md.
- Load versioned configCONFIGURE: replace with your versioned config built from real data (see deployment-guide.md Step 1).
- Fetch source dataCONFIGURE: {{HUBSPOT_CREDENTIAL}}. Pull the fields listed in agent-spec.md's Inputs table.
- Validate + gate recordsDrops records missing required inputs or failing suppression/gate checks defined in agent-spec.md. Logs every drop.
- Apply workflow logicImplements the Workflow Logic table from agent-spec.md. Writes model/config version alongside every derived value for auditability.
- Write agent-owned CRM fieldsCONFIGURE: {{HUBSPOT_CREDENTIAL}}. Writes only: pipeline_hygiene_score, pipeline_hygiene_flags, pipeline_hygiene_recommendations, pipeline_hygiene_scan_date. Never writes sales-owned fields.
- Route to human review / alertCONFIGURE: {{SLACK_CHANNEL}}. Fires for records requiring human review per agent-spec.md's Governance section.
Cost calculator
Cost Calculator — Agent #009: Pipeline Hygiene Agent
Fill in your own volumes and rates — do not use these as benchmark numbers.
| Cost driver | Your volume | Unit cost | Monthly cost |
|---|---|---|---|
| n8n execution (workflow runs) | ___ runs/month | $___ / run | $___ |
| Enrichment/sourcing credits (if applicable) | ___ records/month | $___ / record | $___ |
| LLM API calls (if applicable) | ___ calls/month | $___ / call | $___ |
| Human review time | ___ hrs/month | $___ / hr (loaded) | $___ |
| Total | $___ |
Build cost (one-time)
Estimated build time: 0.5–1 day. Multiply by your builder's loaded hourly rate for a one-time build-cost estimate.
Notes
Costs scale with the volume of records this agent processes, not with the size of your whole CRM — scope your volume estimate to the specific object/list this agent actually touches (see `agent-spec.md`'s Inputs table).
ROI calculator
ROI Calculator — Agent #009: Pipeline Hygiene Agent
| Metric | Before | After | Basis |
|---|---|---|---|
| Deals with a past close date at forecast time | Found manually, inconsistently | Flagged daily, automatically | Deterministic date check run every day |
| Time spent on manual pipeline review | Hours weekly across sales leadership | Digest pre-surfaces the issues | Checks run automatically, humans review a summary |
| Forecast category consistency | Rep judgment, uneven | Logic-checked against stage/date | Same rule applied to every deal |
Forecast accuracy improvement should be measured against your own historical forecast-to-actual variance; this agent surfaces the hygiene problems, it doesn't guarantee a specific accuracy gain.
Your numbers
| Input | Value |
|---|---|
| Records processed per month | ___ |
| Manual time saved per record (before) | ___ min |
| Loaded hourly rate | $___ |
| Monthly time-savings value | $___ (records × minutes saved ÷ 60 × rate) |
Compare this to the cost calculator's monthly total for a net ROI. Do not add a revenue-impact number unless you've measured it against your own baseline — see `agent-spec.md`'s ROI note.
Governance notes
- This agent only recommends — it has no CRM write permission for stage, amount, or close-date fields, only for its own agent-owned flag and score fields.
- Closing or re-staging a deal is always a human action; the agent’s job ends at a specific, actionable flag.
- Stage-age thresholds are set per stage in config, since normal time in Discovery and normal time in Negotiation are very different numbers.
- The champion check degrades gracefully when the Buying Committee Mapper isn’t deployed — it’s disabled in config rather than always failing.
Failure modes
- Agent accidentally closes or re-stages a deal: prevented structurally — write credentials are scoped only to agent-owned fields, and a QA test asserts no write attempt ever reaches stage, amount, or close-date fields.
- Vague next steps not caught: the vague-phrase pattern list is versioned and expanded every time a miss gets caught in review.
- Stage-age threshold flags normal early-stage deals: prevented by requiring a threshold per stage in config rather than one global number.
- Forecast-inconsistency check never fires: a deliberately inconsistent test deal (Commit category, 90-day-out close date) is part of QA specifically to verify this check actually catches what it’s supposed to.
QA checklist
QA Checklist — Agent #009: Pipeline Hygiene Agent
To be completed by a non-builder reviewer before go-live.
Deployment checklist
- ☐ Per-stage stage-age thresholds configured
- ☐ Five HubSpot opportunity properties created
- ☐ Vague-next-step pattern list written
- ☐ n8n workflow imported, write permissions scoped to agent-owned fields only
- ☐ Demo-data run matches `demo-data/sample-output.json`
- ☐ Forecast-inconsistency test deal correctly flagged
- ☐ Weekly digest delivery tested
- ☐ QA checklist completed by a non-builder
- ☐ Rollback tested
Failure-mode verification
- ☐ Verified: Agent closes or re-stages a deal does not occur (mitigation: n8n credential scoped to agent-owned fields only; QA test asserts no write attempt to stage/amount/close-date fields)
- ☐ Verified: Vague next step not caught does not occur (mitigation: Vague-phrase pattern list is versioned and expanded as new examples are caught in review)
- ☐ Verified: Stage-age threshold flags normal early-stage deals does not occur (mitigation: Config requires a threshold per stage, not a single global number)
- ☐ Verified: Forecast-inconsistency check never fires does not occur (mitigation: QA includes a deliberately inconsistent test deal (Commit + 90-day-out close date) and asserts it's flagged)
Governance verification
- ☐ Agent writes only to its agent-owned fields: `pipeline_hygiene_score`, `pipeline_hygiene_flags`, `pipeline_hygiene_recommendations`, `pipeline_hygiene_scan_date` (opportunity)
- ☐ No auto-send, auto-close, auto-route, or auto-create action occurs without the human step described in `agent-spec.md`
- ☐ Confidence/model-version is present on every written record where applicable
- ☐ Demo-data run output matches `demo-data/sample-output.json` in structure
Sign-off
Reviewer name: _______________ Date: _______________ Result: Pass / Fail (attach notes)