AI Template Search
N8N Bazar

Find n8n Templates with AI Search

Search thousands of workflows using natural language. Find exactly what you need, instantly.

Start Searching Free
Nov 6, 2025

Automate Personalized Email Outreach with HubSpot & AI

Email Outreach Drafter with HubSpot and AI: Step-by-Step Learning Guide This guide walks you through an n8n workflow template that combines HubSpot, Gmail, and Google Gemini AI to automate highly personalized email outreach. Instead of manually researching each contact and writing emails from scratch, this workflow: Finds the right contacts in HubSpot Analyzes past email […]

Automate Personalized Email Outreach with HubSpot & AI

Email Outreach Drafter with HubSpot and AI: Step-by-Step Learning Guide

This guide walks you through an n8n workflow template that combines HubSpot, Gmail, and Google Gemini AI to automate highly personalized email outreach.

Instead of manually researching each contact and writing emails from scratch, this workflow:

  • Finds the right contacts in HubSpot
  • Analyzes past email conversations from Gmail
  • Builds a detailed customer persona with AI
  • Generates a tailored sales email for each contact
  • Saves the emails as Gmail drafts so your team can review and send

What You Will Learn

By the end of this tutorial-style article, you will understand how to:

  • Set up OAuth2 connections for HubSpot and Gmail in n8n
  • Configure an n8n workflow to fetch decision makers from HubSpot
  • Retrieve and use previous email threads from Gmail as AI input
  • Use Google Gemini (PaLM) in n8n to build customer personas
  • Generate personalized sales emails based on those personas
  • Store the results as Gmail drafts for review or further automation
  • Customize prompts, targeting, and workflow behavior for your use case

Core Concepts Before You Start

1. n8n Workflow Overview

In n8n, an automation is built as a workflow made up of nodes. Each node performs a specific task, such as:

  • Pulling data from HubSpot
  • Reading email threads from Gmail
  • Sending prompts to Google Gemini AI
  • Creating email drafts in Gmail

The nodes are connected so that data flows from one step to the next, eventually producing a personalized email for each contact.

2. Tools Used in This Template

  • HubSpot – CRM where your contacts and decision makers are stored
  • Gmail – Email account used to fetch previous conversations and create drafts
  • Google Gemini (PaLM) – AI model that builds personas and writes emails
  • n8n – Automation platform that connects all of the above

3. What the Workflow Actually Automates

This n8n template is designed for scenarios like:

  • Sales reps reaching out to decision makers with tailored pitches
  • Marketing teams running personalized outreach campaigns
  • Consultants offering AI partnership or AI implementation services

The example product in this template is AI partnerships consulting packages that help clients start and succeed with AI projects in a cost-effective way, but you can adapt the product details to your own offer.

How the Workflow Works in n8n

Let us walk through the main stages of the template so you can see how data flows from HubSpot to Gmail via AI.

Step 1 – Fetch Target Contacts from HubSpot

The workflow starts with a HubSpot Get Contacts node.

This node:

  • Uses OAuth2 authentication to securely connect to your HubSpot account
  • Pulls contacts that match specific filters, for example:
    • Decision makers
    • People in certain roles or job titles
    • Leads with particular scores or segments

For each selected contact, the node makes their key details available to the rest of the workflow. Typical fields you will use as variables include:

  • firstname
  • lastname
  • email
  • Any other custom fields you want to reference in your messaging

Step 2 – Retrieve Recent Email Threads from Gmail

Next, the workflow uses a Gmail node to gather context about each contact.

For each HubSpot contact, the Gmail node:

  • Looks up the contact by their email address
  • Fetches a defined number of recent email threads involving that contact
  • Provides the email content as input to the AI step

You can optionally configure how many emails to fetch per contact. For example, you might only want the last 3 to 5 relevant conversations to keep the AI prompt focused and efficient.

Step 3 – Build a Customer Persona with Google Gemini AI

Once the workflow has the contact details and email history, it passes this information to a Google Gemini (PaLM) node that is responsible for persona analysis.

In this step, the AI:

  • Analyzes the language and content of previous emails
  • Extracts a wide range of traits and insights, such as:
    • Decision-making style
    • Communication preferences
    • Key pain points and challenges
    • Professional goals and priorities
    • Work style and personality traits
    • Buying behavior and budget sensitivity
    • Business culture and company values
    • Industry awareness and level of technical understanding

The result is a structured persona description that captures how this specific contact thinks, talks, and makes decisions. This persona is then used as the foundation for the personalized sales email.

Step 4 – Generate a Personalized Sales Email

The next AI step is an additional Google Gemini node (or a separate prompt within the same node) that focuses on email generation.

This node takes as input:

  • The persona data from the previous step
  • The contact’s basic details (name, role, company if available)
  • Your product_to_sell information, for example:
    • AI partnerships consulting packages
    • How they help clients start and scale AI projects
    • The cost-effective benefits and outcomes

Based on this, the AI drafts a customized sales email that:

  • Matches the contact’s tone and communication style
  • Emphasizes the pain points and goals discovered in the persona
  • Aligns with their business culture and industry context
  • Includes a relevant call to action tailored to that persona

Step 5 – Create Gmail Drafts for Review

Finally, the workflow uses another Gmail node to create email drafts.

For each contact, the node:

  • Builds a new draft email in your Gmail account
  • Uses the AI-generated content as the email body
  • Sets the contact’s email address as the recipient

The drafts appear in your Gmail Drafts folder, so your sales or marketing team can:

  • Review the message
  • Make small edits or add personal touches
  • Send the email manually

If you prefer, you can later extend the workflow to send emails automatically or to notify the team via Slack when drafts are ready.

Setting Up the Workflow in n8n

1. Connect Your Accounts

Before running the template, you need to connect the required services inside n8n.

  • HubSpot via OAuth2
    • Open the HubSpot node in the workflow
    • Choose OAuth2 as the authentication method
    • Authorize n8n to access your HubSpot CRM
  • Gmail account
    • Open the Gmail nodes used for fetching threads and creating drafts
    • Connect your Gmail account using OAuth2
    • Verify that n8n can read emails and create drafts
  • Google Gemini (PaLM) API
    • Set up your Google Gemini or PaLM credentials in n8n
    • Paste your API key or configure the credential as required
    • Link these credentials in the AI nodes that perform persona analysis and email generation

Security tip: Make sure your HubSpot, Gmail, and Google Gemini credentials are stored securely in n8n and not hard coded into the workflow.

2. Configure Contact Targeting in HubSpot

Next, adjust the Get Contacts node in the workflow so that it pulls the right people from your CRM.

Typical configuration steps:

  • Open the HubSpot node in the editor
  • Set filters for:
    • Role or job title (for example “Head of Operations”, “CTO”)
    • Decision maker flags or lifecycle stage
    • Lead score, industry, or other segmentation fields
  • Test the node to see which contacts are returned

The goal is to ensure the workflow only processes relevant buyers or decision makers, not every contact in your database.

3. Define Variables for Each Contact

Within the workflow, you will reference certain fields as variables, such as:

  • firstname
  • lastname
  • email
  • product_to_sell (a description of your offer)

Make sure these variables are mapped correctly from the HubSpot node output to the AI prompts and Gmail nodes. This ensures that each email is accurately personalized.

4. Tune Email Thread Retrieval in Gmail

In the Gmail node that retrieves previous emails, you can:

  • Specify how many emails to fetch for each contact
  • Filter by label, folder, or search query if needed

This step is optional but useful if you want to limit the AI input to the most recent or most relevant conversations.

5. Configure Google Gemini AI Prompts

Persona Analysis Node

In the Analyse and Build Persona node, you control what the AI extracts from the email threads.

You can refine the prompt to emphasize particular attributes, for example:

  • Decision-making style (data driven, consensus based, fast or cautious)
  • Industry specific challenges or regulatory concerns
  • Preferred communication style (brief, detailed, formal, informal)
  • Level of technical or AI familiarity

Adjusting this prompt helps you generate personas that are truly aligned with your sales process.

Sales Email Generation Node

In the Generate Sales Email node, you define how the AI should write the email.

Within the prompt, you can control:

  • Tone – friendly, professional, consultative, or more direct
  • Formality – casual or formal language depending on your audience
  • Length – short outreach, medium pitch, or more detailed explanation
  • Call to action – book a meeting, reply with a question, try a pilot project, and so on

By testing and iterating on this prompt, you can optimize open and response rates for your specific market.

6. Decide How Emails Are Reviewed and Sent

In the base template, the workflow creates Gmail drafts only. This gives you full control over what gets sent.

You have two main options:

  • Manual review only
    • Keep the workflow as is
    • Sales reps open the drafts, make edits, and send them manually
  • Extended automation
    • Add steps to notify your team via Slack when drafts are ready
    • Or add a conditional step that automatically sends emails if they meet certain criteria

Customization Tips for Better Results

1. Improve Persona Extraction

To get more actionable personas, you can:

  • Ask the AI to output structured sections, for example:
    • “Pain points”
    • “Goals”
    • “Preferred communication style”
    • “Objections likely to arise”
  • Focus on traits that matter most to your sales cycle, such as budget sensitivity or risk tolerance

2. Adapt Email Style to Your Brand

Use the email generation prompt to align with your brand voice.

  • Specify whether you want short subject lines or more descriptive ones
  • Define how you introduce your AI partnerships consulting packages or other offers
  • Control how strong or soft the call to action should be

3. Fine Tune Targeting in HubSpot

Better targeting usually leads to better results. In your HubSpot filters, you can:

  • Limit outreach to specific industries where your AI services have strong fit
  • Target only contacts above a certain lead score
  • Focus on roles that typically sign off on AI projects

4. Optimize Your Review Process

Decide how your team will work with the drafts created by the workflow:

  • Create internal guidelines on what to check before sending (accuracy, tone, offer)
  • Use labels or tags in Gmail to organize drafts by campaign or rep
  • Optionally, extend the workflow to send Slack or email notifications when new drafts are available

Benefits of Automating Email Outreach with n8n, HubSpot, and AI

  • Time savings – Automate persona building and email drafting so reps spend more time selling and less time writing.
  • Higher engagement – Personalized, AI crafted messages are more likely to be opened, read, and answered.
  • Consistent quality – Every email follows a thoughtful structure while still being tailored to each contact.
  • Human oversight – Emails are saved as drafts so your team can review, adjust, and approve before sending.
  • Unified workflow – HubSpot, Gmail, and Google Gemini are connected in one n8n automation for a smooth sales process.

Quick FAQ

Do I have to send emails automatically?

No. By default, the workflow only creates Gmail drafts. You keep full control over what is sent and when. You can later add automatic sending if it suits your process.

Can I use this for products other than AI consulting?

Yes. The template uses AI partnerships consulting packages as an example, but you can update the product_to_sell details and prompts to match any product or service.

Is previous email history required?

The workflow works best when there are existing Gmail threads with the contact, because the AI can analyze their communication style and needs. If there is no history, you can still generate emails using CRM data and generalized personas, but the personalization will be less deep.

Is my data secure?

n8n uses your configured credentials to connect to HubSpot, Gmail, and Google Gemini. Make sure you store these credentials securely in n8n and follow your organization’s security policies.

Leave a Reply

Your email address will not be published. Required fields are marked *

AI Workflow Builder
N8N Bazar

AI-Powered n8n Workflows

🔍 Search 1000s of Templates
✨ Generate with AI
🚀 Deploy Instantly
Try Free Now