Skip to content
Demonstration - not client work

n8n AI agent that works each new HubSpot deal

An n8n AI agent that picks up each new deal in a HubSpot pipeline, reads the client's history, saves a reply as a Gmail draft, logs it on the timeline, sets the stage and creates a follow-up task.

  • n8n
  • OpenAI
  • HubSpot
  • Gmail
A HubSpot contact record showing the note 'AI agent draft reply (not sent)', a deal moved to the Emergency stage and a reply-waiting task.
workflow nodes
26
agent tools
8
sample deals
3

Problem

Each new job in the pipeline needs the same first steps: look up the client, read what was said before, write a reply, pick the stage, set a reminder. Done by hand, it is slow, and it gets skipped on busy days.

What was built

Two n8n workflows: a 26-node AI agent with 8 tools that works each new deal, and an 11-node workflow that completes the follow-up task once the reply has been sent from Gmail.

What it does

When a new deal appears in the pipeline, the agent starts work without anyone pressing a button. It has 8 tools: read the client and their history, read notes, read the deal, find the last Gmail thread, save a Gmail draft, log the draft on the HubSpot timeline, create a follow-up task, and move the deal stage.

The agent chooses among four stages and writes the reply under fixed rules: 90 to 150 words, and never an invented price or date. The reply lands in Gmail as a draft, for a person to read and send.

A second workflow closes the loop. When the reply shows up in the Sent folder, n8n marks the matching "Reply waiting" task in HubSpot as complete.

A guard node sits in front of the agent. In the demo it lets through only sample addresses, one test address of our own, and one pipeline, so the agent only works on test records.

What was built

  • An n8n workflow with 26 nodes: trigger, guard, and an AI Agent node with 8 tools.
  • An n8n workflow with 11 nodes that watches Sent mail and completes the HubSpot task.
  • Helper scripts to seed sample deals, read results back, and send one draft under a send guard.

How it was tested

  • 3 of 3 sample deals were picked up by the poll and worked by the agent with no manual trigger.
  • The agent's own run took 16 to 21 seconds, with a median of 17. From creating the deal to the end of the run took 35 to 72 seconds, which includes the wait for the one-minute poll.
  • 7 of the 8 tools ran in each test. The notes tool did not run because no test contact had notes.
  • The first draft for one deal was attached to an unrelated Gmail thread. That was fixed and the deal re-run.
  • One draft was sent to an inbox of our own to prove the second workflow. The first attempt was refused by the send guard because of a leftover Cc/Bcc field; after that was cleared, the send went through and the follow-up tasks were completed.

What it does not do

The agent saves drafts and never sends. On the demo portal, new deals are found by a one-minute poll instead of a direct HubSpot trigger, and the deals it works on are sample records.

  • It does not send email. It drafts; a person sends.
  • HubSpot does not call the workflow directly in this demo. On the free demo portal that was not available to us, so a one-minute poll stands in.
  • It does not create a draft inside HubSpot's own one-to-one email tool. We found no API for that, so drafts live in Gmail.
  • It could not read the bodies of emails logged in HubSpot, because the demo access lacked that permission.
Next demoHubSpot lead triage and AI reply drafts with n8n

More demos

Diagram of the workflow's last steps: a Google Sheets row, the Hot check, and an alert that fires on Hot leads only.

Contact form AI lead qualifier in n8n

A 10-node n8n workflow that reads each website contact form submission, labels it Hot, Warm or Not Relevant with a one-line reason, logs it to Google Sheets and alerts the team on Hot leads only.

The sync audit with zero findings and the ops log of the four flows.

Lead-to-invoice sync in n8n with a sync audit

Four n8n workflows that carry a lead from an email into HubSpot, a project tool, a time tracker and a draft invoice, with retries, an error branch, and an audit that finds records the tools disagree on.

Start with a free automation audit

Email the founder to arrange a free 45-minute video call. We map your workflow, tools and bottlenecks, and you get a prioritized roadmap.

Michael replies within two business days.