# How we stop deals from going quiet

A daily Machine agent combs HubSpot for deals gone silent, blank next steps, stuck stages and late tasks, pings the rep who owns each one in Slack, and sends the worst cases up to their manager.

Canonical page: https://themachine.myapps.ai/use-cases/pipeline-hygiene

Pipelines rarely fall apart loudly. They go soft, a little at a time. Seven
days pass on a deal with no call and no email, and no one clocks it. A rep
promises a close date out loud but never types it in. Something parks in
"Proposal Sent" for a month longer than it should. A follow-up task hits its
due date and drifts past without a word. Your stage-by-stage report shows
none of this. The deal is open, it's counted, and on paper all is well.

That's the gap an agent on Machine now covers for us. Each day it goes
through HubSpot looking for those exact signs: deals that have gone silent,
blank next steps and close dates, deals frozen in one stage, and tasks that
are late. It pings the rep who owns each one in Slack, and the day's worst
cases go up to that rep's manager. It mostly reads. It flags, it nudges, and
it leaves a deal's stage, owner and amount exactly as they were.

- **Team:** Machine
- **CRM:** HubSpot
- **Runs on:** A cron once a day
- **Mode:** Mostly reads · flags and nudges, nothing more

## The problem

Don't confuse this with messy CRM records. Two copies of one contact, or a
blank job title, is about data quality. A deal that hasn't budged in three
weeks is about process: the pipeline has stopped doing its one job, which is
moving deals toward a signature. A report organised by stage can't separate
the deal that's pushing forward from the one that's been left in a corner.
They look identical. Both are open, both sit in a stage, both count toward
the forecast.

Most teams lean on a weekly pipeline review, with a manager scrolling through
each open deal hunting for the ones that went cold. By then a deal that went
quiet on Monday is already a week behind, and the meeting only covers what
someone thinks to bring up. Reps are busy selling, not checking their own
records. A blank next step or close date tends to sit unnoticed until
forecast week, when putting it right has become expensive.

## What we built

Once a day, a cron starts an agent in a brand new, sealed-off session that
can read HubSpot and write very little back. It gathers every open deal and
runs each through four checks. Has there been no activity logged within the
set window? Is the next step or close date blank? Has the stage stayed put
past the set window? Is there a task on the deal that's overdue? Anything
that fails gets flagged. Each owning rep gets a Slack ping listing what needs
fixing on their deals, and the worst cases of the day go, separately, to the
sales manager's channel. The stage, the owner and the amount on a deal are
never changed.

## How it works

### Start once a day

A **cron trigger** kicks off the agent daily. Each run gets a new
**session**, a fresh cloud computer set up just for that run, and nothing is
kept from the day before. Every morning the pipeline is checked again from
where it stands right now.

### Hand it the house rules

What "stale", "stuck" and "overdue" mean for us is written into a **skill**,
the playbook the agent carries. It covers the no-activity window, the
stage-stall window, what a blank next step or close date looks like, and how
the day's worst cases are picked for the manager. If the team changes its
idea of "stuck", you edit the rule. You don't hope the agent guesses.

### Connect HubSpot, mostly for reading

A scoped **connector** links the agent to HubSpot. Machine keeps the token on
its own servers, so the model never sees it. The agent reads deals, stage
history, activities and tasks, and the only thing it writes back is a
hygiene flag on the deal. No other field.

- **Deals and how they've moved.** The current stage, amount, close date and
next step, plus how long the deal has been in its current stage.
- **Activity.** The calls, emails, meetings and notes logged on each deal,
which is how it tells whether a deal has gone stale.
- **Tasks.** The open tasks attached to each deal, and whether any are late.
- **Slack, for posting.** A ping to the rep who owns the deal, and an
escalation in the manager's channel.

### Draw the lines

The agent **mostly reads**. Its single write to HubSpot is an internal
hygiene flag on a deal. It never touches the stage, the owner or the amount.
Whatever the numbers seem to say, it can't hand a deal to someone else, push
it to the next stage, or change what it's worth. Credentials are stored
encrypted in the Secrets Manager, added at run time, and only handed to the
agents you grant them to.

### Ping the rep, send the worst upstairs

Every flagged deal earns its owner a Slack ping that says what's wrong and
how to fix it: log some activity, add a next step, move the stage along, or
deal with the late task. When the run wraps up, the deals in the roughest
state go to the sales manager's channel. Those are the ones that broke
several rules at once, put the most money at risk, or have been silent the
longest. From there the rep and the manager choose what to do. The agent
just tells them.

> **The pattern**
> Once a day a **cron** opens a session whose **connector** into HubSpot
> mostly reads. A **skill** holds the hygiene rules. The agent flags deals
> that are silent, half-filled, stuck or overdue, pings the rep, sends the
> worst to the manager, and leaves the stage, owner and amount alone.

## Guardrails

An agent that reads every open deal each day has to be trusted, so its reach
is small and, where it counts, one-way:

- **Kept apart.** Each run gets its own sealed-off sandbox. The hygiene flag
  and the Slack messages are the only things it sends back out.
- **Locked-down keys.** The HubSpot credential is stored encrypted in the
  Secrets Manager, added to the sandbox at run time, and only handed to the
  agents you grant them to.
- **Mostly reading.** The one thing it writes to HubSpot is an internal
  hygiene flag. Stage, owner and amount are off limits. Those choices belong
  to the rep and the manager.
- **Pings and flags, that's all.** What it produces is a Slack message or a
  flag. It never acts for a rep.
- **All of it lives in code.** The stale window, the stage-stall window and
  the rules for what gets escalated are files in the repo. They're
  versioned, and you change them with a reviewed **change request**, not a
  setting on a dashboard.

## The outcome

- **Every day:** Each open deal checked again against HubSpot as it is now
- **4 rules:** Gone quiet, blank fields, stuck in stage, late tasks, all in one run
- **Read-mostly:** The agent never edits a deal's stage, owner or amount

Deals that once hid until the next pipeline review now show up the very day
they go cold. The rep who owns them hears about it, and the ones a manager
ought to be watching land in front of the manager too. The agent only flags
and pings. What moves, and when, is still up to the rep and the manager.
