n8n Tutorial: AI Sales Agent — Hyper-Personalized Follow-up Emails with Real-Time Company Intelligence Automation

Your CRM is full of deals that stalled. A demo went well, the prospect said "circle back next quarter," and then everyone forgot. Your reps know follow-up wins deals — but writing a follow-up that isn

n8n Tutorial: AI Sales Agent — Hyper-Personalized Follow-up Emails with Real-Time Company Intelligence Automation

Your CRM is full of deals that stalled. A demo went well, the prospect said "circle back next quarter," and then everyone forgot. Your reps know follow-up wins deals — but writing a follow-up that isn't "just checking in" takes research nobody has time for. So the pipeline rots. This tutorial shows you how to build an n8n workflow that runs every weekday morning, finds every deal that's gone quiet, researches what's actually happening at that company right now, and drafts a follow-up email that references something real — a funding round, a product launch, a press mention — then sends it and logs the touch in HubSpot. No new hires. No manual research. Just relevance at scale.

The problem: generic follow-ups get ignored, personalized ones don't scale

Reply rates on cold-ish follow-ups collapse when the email reads like a template. "Just wanted to bump this to the top of your inbox" tells the prospect you have nothing new to say. The fix is well known — reference something specific about their world — but it doesn't scale. A rep working 80 open deals cannot read the news for 80 companies every morning. So they either send generic filler (ignored) or cherry-pick five deals and let the other 75 die.

The math is brutal. If 40% of your pipeline stalls for lack of follow-up, and personalization roughly doubles reply rates, you're leaving a large fraction of already-qualified revenue on the table — not because the leads were bad, but because nobody had 20 minutes per deal to make the email worth reading. This is exactly the kind of research-heavy, judgment-light work that an AI agent handles well: gather real-time context, write one relevant paragraph, repeat 80 times before 9am.

The solution: a morning agent that researches, writes, and logs

The workflow is a scheduled pipeline with five logical stages:

  • Find stale deals — query HubSpot for open deals with no activity in the last X days.
  • Research each company — hit Perplexity for the company's latest news, funding, launches, and press.
  • Write the email — GPT-4o composes a short, specific follow-up that opens with the real fact it found.
  • Send — Gmail delivers it from the rep's inbox.
  • Log — the touch is written back to HubSpot as an engagement so the deal is no longer "stale" and the rep sees what was sent.

Everything is real-time. The email doesn't say "I saw you're in fintech" — it says "Congrats on the Series B you announced last Tuesday — the expansion into EU payments is exactly where template automation pays off." That specificity is the entire point, and it only works because the research node runs the morning the email goes out, not from a stale enrichment field.

Step-by-step setup in n8n

Here's how the nodes wire together. You'll need credentials for HubSpot (private app token), OpenAI, Perplexity, and Gmail (OAuth2).

1. Schedule Trigger

Add a Schedule Trigger node. Set it to a Cron expression that fires weekday mornings only: 0 8 * * 1-5 (8:00 AM, Monday–Friday). Running before the workday starts means drafts are ready when reps open their inboxes.

2. HubSpot — find stale deals

Add a HubSpot node, resource Deal, operation Search (or use the HTTP Request node against the CRM Search API for finer filter control). Filter on hs_lastmodifieddate older than X days and dealstage not in your closed-won/closed-lost stages. A clean starting filter:

  • hs_lastmodifieddate LTE {{ $now.minus({ days: 7 }).toMillis() }}
  • dealstage NEQ closedwon and NEQ closedlost

Request the associated company so you get a real company name and domain to research. Follow with a Split In Batches (Loop Over Items) node so you process one deal at a time and stay under API rate limits.

3. Perplexity — real-time company intelligence

Add an HTTP Request node pointed at Perplexity's chat completions endpoint (https://api.perplexity.ai/chat/completions), model sonar, with your bearer token in the Authorization header. Send a tight prompt:

"Find the single most recent, specific, verifiable business development for {{ $json.company_name }} ({{ $json.domain }}) in the last 90 days — funding, product launch, exec hire, expansion, or press mention. Return one sentence with a date. If nothing verifiable, return 'NONE'."

Forcing a single dated fact (or an explicit NONE) is what keeps the downstream email honest — you don't want GPT inventing a launch that never happened.

4. GPT-4o — write the follow-up

Add an OpenAI node (or the AI Agent node), model gpt-4o. Route the Perplexity result in. Two rules in the system prompt do the heavy lifting: open with the real fact, and if the research returned NONE, fall back to a value-driven follow-up with no fabricated news. Keep the temperature around 0.6. A workable system prompt:

"You are an SDR writing a follow-up to a stalled deal. Open with the specific company news provided, connect it in one sentence to how our product helps, then a soft one-line CTA. Under 90 words. No 'just checking in'. No fabrication — if news is NONE, lead with a concrete value point instead. Return subject and body as JSON."

Feed it the deal owner's name, the contact's first name, and your product's one-line value prop so the close feels human, not automated.

5. Gmail — send

Add a Gmail node, operation Send. Map To to the contact email from the HubSpot association, and pull Subject and Message from the GPT node's parsed JSON. Sending from the actual rep's connected Gmail account (via OAuth2) means replies land in their inbox and threading stays natural. For a safer rollout, set the operation to Create Draft first — reps review the first week's output before you flip it to auto-send.

6. HubSpot — log the engagement

Close the loop with a second HubSpot node that creates an Engagement (email type) associated with the deal and contact. This updates hs_lastmodifieddate, so the deal drops out of tomorrow's stale query — your dedup is automatic, and no prospect gets pinged two days running.

Benefits: what this actually buys you

Coverage. Every stalled deal gets touched every cycle, not just the five a rep remembers. Pipeline stops leaking silently.

Relevance that converts. Emails anchored to a real, dated event read as human research, because they are — Perplexity did the reading. Reply rates on these consistently outperform "checking in" filler.

Rep time back. The 15–20 minutes of research per deal disappears. Reps spend their morning replying to warm responses instead of manufacturing reasons to email.

A clean audit trail. Because every send is logged as a HubSpot engagement, managers see exactly what went out, and the CRM's activity data stays trustworthy for reporting and forecasting.

Common pitfalls (and how to avoid them)

Hallucinated news. The single biggest risk. If GPT invents a funding round, you've torched credibility. Guardrails: force Perplexity to return a dated fact or NONE, and instruct GPT to fall back to value-based copy on NONE. Never let the model fill gaps with plausible-sounding fiction.

Over-emailing. Without the engagement-logging step, a deal that stays technically "stale" could get hit daily. Logging back to HubSpot — which bumps the last-modified date — is not optional; it's your dedup mechanism.

Deliverability. Blasting 80 emails at 8:00:00 AM from one Gmail account looks like spam. Add a small random Wait inside the batch loop (30–90 seconds) to spread sends, and respect Gmail's daily limits — Workspace accounts cap around 2,000/day, far lower on trial tiers.

Stale or missing contacts. Some deals have no associated contact email, or a bounced one. Add an IF node after the HubSpot fetch to skip deals with no valid recipient, and route them to a Slack alert so a human can fix the association instead of the workflow failing silently.

Tone drift. GPT left unconstrained gets flowery. Cap the word count in the prompt, keep temperature moderate, and review a sample weekly. Start in draft mode until you trust the output — auto-send is a switch you earn, not a default.

Wire these six nodes together, gate it behind draft mode for a week, and you have a research analyst that works every deal in your pipeline before your first coffee — for the cost of a few API calls.

AI Sales Agent — Hyper-Personalized Follow-up Emails with Real-Time Company Intelligence
PRONTO PARA USAR

Ja construimos isso pra voce

Nao comece do zero. O AI Sales Agent — Hyper-Personalized Follow-up Emails with Real-Time Company Intelligence e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.

Instalar por $149 →