# How we get back to every inbound lead

An agent on Machine works with HubSpot, email and Google Calendar. It looks into each new lead, writes a personal follow-up with a suggested call time, and waits for a person to approve the send.

Canonical page: https://themachine.myapps.ai/use-cases/lead-follow-up

A fresh lead goes stale fast. Someone who fills in your form on Tuesday is far
more likely to talk if you reply that Tuesday than if you get round to it on
Friday. Trouble is, a decent reply takes homework: who is this company, what do
they do, why did they sign up? When the pipeline is busy, the homework is the
first thing to go.

So every new lead gets an agent. It looks into the company, writes a follow-up
that's actually about them, and suggests a time to talk. Here's how we run it on
Machine: what it connects to, the steps it takes and the limits we set.

- **Team:** Machine
- **Connected systems:** HubSpot · Email · Google Calendar
- **Trigger:** A HubSpot check on a schedule, every 15 minutes
- **Mode:** Starts on a schedule · a person approves

## The problem

The follow-up that wins the meeting is the one that proves you read the form and
get what the company does. That needs a few minutes of digging for every lead,
and a few minutes for every single inbound adds up to more time than a growing
team can spare. So replies go out bland, or they go out late. Either way, deals
slip away.

Templates speed up the sending but not the personal touch, and the personal
touch is what counts. Then setting up the call means another round of emails.
The work that actually moves a lead along is the work that keeps getting
dropped.

## What we built

We connected our **HubSpot** pipeline to an agent on Machine. On a schedule, a
check starts a fresh, isolated session, a cloud sandbox, with scoped access to
only what a follow-up needs: the lead's record, the web for research, our email
and the team calendar. For each new lead the agent does its homework, writes a
personal message and suggests a call time. A person signs off before anything
is sent.

## How it works

### Check HubSpot on a schedule

Every 15 minutes a scheduled **trigger** looks through HubSpot for new leads,
and each check opens a fresh **session**, a cloud computer (sandbox) of its own.
If one check finds several new leads, they all run in that one session, but
each lead is treated as a separate job. If the research or the draft fails for
one lead, the others carry on untouched. Nothing is shared from one check to the
next; what carries forward is the marker the agent writes back on each HubSpot
record.

### Hand it our sales playbook

Every session loads how we follow up as **skills** and **memory**: how we
position ourselves, the voice we write in, what a good qualifying question looks
like and follow-ups that have worked before. The agent writes to that bar
instead of making up its own, and its memory updates as deals progress.

### Decide what it can reach

The agent works through scoped **connectors**, connections that Machine brokers
on the server so the model never sees a raw token. With them it can:

- **Look into the company**: it reads the lead's website and public details to
learn what they do and why they got in touch.
- **Read and write HubSpot**: the full lead history goes in, and its research
notes go back onto the record.
- **Write the email**: a personal follow-up shaped by our playbook, ready to go.
- **Suggest a time on Google Calendar**: it checks when the team is really free
and offers a specific slot for a call.

### Put a person before the send

Research and drafting are fair game; sending on its own is not. Each follow-up
stops at a **human approval gate** and sits as a draft until someone checks it
and sends it. Credentials are stored encrypted in the Secrets Manager and only
handed to the agents you grant them to.

### Let every lead get worked

Once that's in place, new leads show up with the work already done. The company
is researched, the record is updated, a personal email is drafted and a call
time is suggested against real free slots. Whoever is on sales reads the draft,
changes what they like and sends it, rather than starting every follow-up from
a blank page.

> **The pattern**
> Link the CRM with a **trigger** that spots new leads, give the agent scoped
> **connectors** to HubSpot, email and the calendar, write the sales playbook
> down as **skills** and **memory**, and make a person approve every send.

## Guardrails

Letting an agent contact leads is a question about your brand as much as your
sales. Here's what Machine puts in place:

- **Isolation.** Every check runs in its own sealed sandbox: a fresh session
  that may cover several new leads, each treated as a separate job so one
  failure never holds up the others. The drafts it writes are the only thing
  that comes back out.
- **Scoped secrets.** HubSpot, email and Calendar credentials are stored
  encrypted in the Secrets Manager and only handed to the agents you grant them
  to.
- **Human approval gate.** Nothing reaches a lead until a person has read the
  draft and sent it.
- **Everything is code.** The agent's persona, skills and permissions are files
  in the repo. They're versioned and only change through a reviewed **change
  request**, not a setting in a dashboard.

## The outcome

- **Every lead:** Looked into and followed up, not only the obvious ones
- **Same-day:** A personal reply ready while the lead still cares
- **3 systems:** HubSpot, email and the calendar, handled by a single agent

Each new lead now turns up with the homework finished, a personal draft written
and a call time suggested, waiting on a person to approve it instead of sitting
untouched. The team spends its time choosing which leads to chase, not repeating
the same research again and again.

Four things hold it together: a sealed sandbox for each run with every lead
handled on its own, a secrets manager that brokers the HubSpot, email and
Calendar tokens, a person approving anything before it reaches a lead, and
memory that gets sharper as deals move.
