HubSpot to Gmail, personalized outreach drafts ready
You finally have a clean HubSpot segment ready to contact, then the real work starts. Dig up context, reread old threads, guess what matters to each person, and still try to sound like you didn’t copy-paste.
SDRs feel it first, because volume turns “quick outreach” into a full-time writing job. A founder doing sales and a marketing lead supporting outbound feel the same friction too. This HubSpot Gmail drafts automation gets you review-ready outreach drafts that actually match the contact’s tone.
This workflow pulls a targeted HubSpot list, reads real Gmail thread context, builds a lightweight persona with Gemini, then creates a Gmail draft per contact. You’ll see what it fixes, what you need, and how the flow works so you can customize it safely.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: HubSpot to Gmail, personalized outreach drafts ready
flowchart LR
subgraph sg0["Manual Start Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Manual Start Trigger", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/hubspot.svg' width='40' height='40' /></div><br/>Retrieve HubSpot Contacts"]
n2@{ icon: "mdi:swap-vertical", form: "rounded", label: "Iterate Contacts Batch", pos: "b", h: 48 }
n3@{ icon: "mdi:cog", form: "rounded", label: "Contact Anchor", pos: "b", h: 48 }
n4@{ icon: "mdi:swap-vertical", form: "rounded", label: "Map Contact Fields", pos: "b", h: 48 }
n5@{ icon: "mdi:message-outline", form: "rounded", label: "Fetch Customer Emails", pos: "b", h: 48 }
n6@{ icon: "mdi:robot", form: "rounded", label: "Build Persona Profile", pos: "b", h: 48 }
n7@{ icon: "mdi:robot", form: "rounded", label: "Draft Sales Message", pos: "b", h: 48 }
n8@{ icon: "mdi:message-outline", form: "rounded", label: "Create Gmail Draft", pos: "b", h: 48 }
n9@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Model A", pos: "b", h: 48 }
n10@{ icon: "mdi:brain", form: "rounded", label: "Gemini Chat Model B", pos: "b", h: 48 }
n4 --> n5
n3 --> n4
n1 --> n2
n2 --> n3
n7 --> n8
n9 -.-> n6
n6 --> n7
n5 --> n6
n10 -.-> n7
n8 --> n2
n0 --> n1
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n6,n7 ai
class n9,n10 aiModel
classDef customIcon fill:none,stroke:none
class n1 customIcon
The Challenge: Personalizing outreach without living in your inbox
Personalization sounds simple until you try to do it for a list of 30 “high-intent” contacts. You open HubSpot, then Gmail, then HubSpot again. You skim threads, miss a key detail, and end up writing something that feels generic or worse, slightly wrong. And because it’s manual, the process is inconsistent. One rep writes thoughtful emails, another rep sends thin templates, and your results look random. Honestly, the mental load is the real killer: context switching all day makes it harder to do the actual selling.
None of these alone is the problem. Together, they are.
- Finding the most relevant thread per contact can take 5 to 10 minutes, especially when names don’t match perfectly.
- Even a small tone mismatch (“too salesy” or “too formal”) leads to rewrites and delays.
- Manual personalization makes mistakes more likely, like referencing the wrong product, timeline, or stakeholder.
- When outreach depends on whoever has time that day, your pipeline becomes harder to predict and manage.
The Fix: HubSpot list → persona-driven Gmail drafts
This workflow starts with a small, targeted HubSpot search (for example, decision makers in a specific lifecycle stage). It processes contacts one by one so you keep control and avoid hammering Gmail. For each person, it fetches up to 20 recent Gmail threads to learn how they communicate and what they care about, then Gemini extracts a lightweight persona (tone, goals, pain points, decision style). After that, Gemini drafts a concise outreach email aligned to your offer, including a subject line and an HTML body. The last step is the most practical part: it saves each message as a Gmail draft so you can skim, tweak, and send from one place.
The workflow begins when you run it manually (or by schedule if you choose to extend it). HubSpot supplies the exact segment, Gmail supplies real conversation context, and Gemini turns that into a persona plus a draft that sounds like it belongs in that thread. Finally, the draft lands in Gmail, ready for review.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you run a weekly outbound push to a HubSpot list of 25 contacts. Manually, you might spend about 10 minutes per person reading old threads and another 10 minutes drafting, which is roughly 8 hours of work. With this workflow, you kick off the run in a minute, then it pulls up to 20 threads per contact, generates the persona, and creates the Gmail draft while you do something else. You still review and adjust, but that review is often 2 minutes per draft, so the “writing day” becomes closer to an hour or two.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- HubSpot for pulling the right contact segment.
- Gmail to read threads and create drafts.
- Google Gemini API key (get it from Google AI Studio/Google Cloud credentials).
Skill level: Beginner. You’ll connect accounts, edit one HubSpot filter, and update your offer text in a Variables step.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
A controlled start. You run the workflow manually, which is ideal when you’re testing a new segment or offer. Some teams later switch to a schedule trigger once they trust the output.
HubSpot pulls the segment. The “Get Contacts” search is where you define scope (for example, hs_buying_role = decision maker). Keeping the list tight is the point; better targeting beats bigger blasts.
Gmail provides real context. For each contact, the workflow fetches up to 20 recent threads. That’s enough to detect tone, objections, and how direct the person likes to communicate without over-collecting.
Gemini builds a persona and drafts the email. First it extracts persona attributes (decision style, goals, pain points, and a few communication preferences). Then it generates a subject line and HTML email body that matches what it “learned,” using your product_to_sell value as the anchor.
The draft lands in Gmail. Each contact ends with a reviewable Gmail draft. You can easily modify the persona attributes to emphasize different signals (like urgency or risk) based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
This workflow starts manually so you can test and iterate on outreach drafts before scheduling or automating.
- Add the Manual Start Trigger node to your canvas.
- Leave all fields at their defaults (this node has no parameters).
- Connect Manual Start Trigger to Retrieve HubSpot Contacts to start the main flow.
Step 2: Connect HubSpot
Fetch the target contacts from HubSpot using a search filter that focuses on decision makers.
- Select the Retrieve HubSpot Contacts node.
- Set Operation to
search. - Set Authentication to
oAuth2. - In Filter Groups, add a filter where Property Name is
hs_buying_role|enumerationand Value isDECISION_MAKER. - Credential Required: Connect your hubspotOAuth2Api credentials.
Flow note: Retrieve HubSpot Contacts outputs to Iterate Contacts Batch to process contacts one at a time.
Step 3: Set Up Contact Batching and Field Mapping
Batch processing ensures one contact is handled at a time, while the field mapping standardizes data for later steps.
- Open Iterate Contacts Batch and keep default batch options (no changes required).
- Ensure Iterate Contacts Batch outputs to Contact Anchor, then to Map Contact Fields.
- In Map Contact Fields, add assignments:
- Set firstname to
{{ $json.properties.firstname }}. - Set lastname to
{{ $json.properties.lastname }}. - Set email to
{{ $json.properties.email }}. - Set product_to_sell to
AI partnerships: a consulting package of AI development and services. We help customers find a strong foothold on AI initiatives bringing them to life cost effectively and always with results..
Contact Anchor is a placeholder node used to anchor the batch flow; it requires no configuration.
Step 4: Set Up Email Retrieval and Persona Extraction
Pull recent email history for each contact and use it to build a persona profile with AI.
- Configure Fetch Customer Emails with Operation set to
getAll. - Set Limit to
20and Simple tofalse. - Set the search query in Filters → q to
from:{{ $json.email }}. - Credential Required: Connect your Gmail credentials to Fetch Customer Emails (none are configured yet).
- In Build Persona Profile, set Text to the full expression:
{{ $input.all() .map(item => `subject: ${item.json.subject} date: ${$json.headers.date} message: ${item.json.text.substr(0, item.json.text.indexOf('> wrote:') ?? item.json.text.length).replace(/^On[\w\W]+$/im, '')}`) .join('\n---\n') }} - In Build Persona Profile, set the System Prompt Template to
Your task is to build a persona of a customer or potential customer so that we may better serve them for our business. Analyse the recent correspondence of the user, {{ $('Map Contact Fields').item.json.email }}, and extract the required attributes.. - Ensure Gemini Chat Model A is connected as the language model for Build Persona Profile and set Model Name to
models/gemini-2.0-flash. - Credential Required: Connect your googlePalmApi credentials to Gemini Chat Model A (AI credentials are set on the model node, not on Build Persona Profile).
⚠️ Common Pitfall: The Gmail nodes require credentials even if the workflow imported correctly. Make sure both Gmail nodes are authenticated before testing.
Step 5: Configure Sales Drafting and Gmail Draft Output
Use the persona profile to draft a tailored sales message, then save it as a Gmail draft addressed to the contact.
- In Draft Sales Message, set Text to
# Profile of {{ $('Map Contact Fields').first().json.firstname }} {{ $('Map Contact Fields').first().json.lastname }} {{ Object.keys($json.output).map(key => `## ${key}\n${$json.output[key]}`).join('\n') }}. - Set the System Prompt Template to
You are a sales representative drafting an email to close a potential customer on the following product: <product>{{ $('Map Contact Fields').first().json.product_to_sell }}</product> Use the provided profile to draft the a suitable email which reflects similar communication style and addresses their values, ultimately convinces the customer to inquire about and/or buy this product. Provide only the subject and body of the message as this text will go into a template. Omit the subject and signature.. - Ensure Gemini Chat Model B is connected as the language model for Draft Sales Message and set Model Name to
models/gemini-2.0-flash. - Credential Required: Connect your googlePalmApi credentials to Gemini Chat Model B (AI credentials are set on the model node, not on Draft Sales Message).
- Configure Create Gmail Draft with Resource set to
draftand Email Type set tohtml. - Set Message to
{{ $json.output.body }}and Subject to{{ $json.output.subject }}. - Set Options → Send To to
{{ $('Map Contact Fields').first().json.email }}. - Credential Required: Connect your Gmail credentials to Create Gmail Draft (none are configured yet).
Flow note: Create Gmail Draft outputs back to Iterate Contacts Batch to continue processing the next contact.
Step 6: Test and Activate Your Workflow
Run a manual test to confirm contact retrieval, persona building, and draft creation are working end-to-end.
- Click Execute Workflow on Manual Start Trigger to run a test.
- Verify Retrieve HubSpot Contacts returns contacts tagged with
DECISION_MAKER. - Check that Fetch Customer Emails returns email history for each contact.
- Confirm Build Persona Profile outputs a structured persona object and Draft Sales Message outputs
subjectandbody. - Open Gmail and confirm a draft exists for each processed contact.
- When satisfied, toggle the workflow to Active for production use.
Watch Out For
- HubSpot credentials can expire or need specific permissions. If things break, check your HubSpot private app/OAuth connection status in n8n first.
- Gmail read access is sensitive, and Google can revoke tokens after password changes or policy prompts. Reconnect the Gmail nodes if you suddenly see “invalid_grant” errors.
- Gemini outputs will feel generic if your prompt is generic. Add a short brand style guide (sentence length, CTA rules, sign-off) early so you’re not editing every draft later.
Common Questions
About 30 minutes if HubSpot, Gmail, and Gemini are already accessible.
Yes. You’ll mostly be connecting accounts and editing a HubSpot filter. If you can copy an API key and change a few text fields, you’re good.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini API usage, which depends on how long your threads and prompts are.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
You can change the HubSpot segment in “Retrieve HubSpot Contacts,” then adjust your offer in the “Map Contact Fields” variables (product_to_sell). If you want different persona depth, tweak the “Build Persona Profile” extractor fields. And if you’re selling into multiple industries, you can branch after the HubSpot search and load different value props before “Draft Sales Message.”
Most of the time it’s an OAuth token problem. Reconnect the Gmail nodes in n8n, confirm you’re using the same Google account for “Fetch Customer Emails” and “Create Gmail Draft,” then retry with a single contact. If it still fails, check Google account security prompts and make sure your workspace admin hasn’t restricted Gmail API access.
Practically, it’s built for small, targeted lists processed one-by-one. If you self-host n8n there’s no execution cap (your server and Gmail/Gemini limits decide), and on n8n Cloud the plan you choose determines monthly executions. A common pattern is running 20 to 100 contacts per batch, reviewing drafts, then running the next batch.
Often, yes, because the persona extraction plus drafting logic is easier to control in n8n. You can loop through contacts, keep the run deliberate, and evolve prompts without fighting platform limits. Self-hosting is also a big deal if you plan to scale executions without paying per task. Zapier or Make can still work if you only need basic “HubSpot contact created → send email” automation, but this workflow leans into context and writing quality. If you’re torn, Talk to an automation expert and describe your list size and review process.
You get drafts that sound like you actually read the conversation, without burning half a day to do it. Set it up once, then spend your time on the parts that still need a human.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.