Personalized Sales Emails with n8n and Google Gemini AI

This workflow automates creating personalized sales emails by analyzing a customer’s past email correspondence with AI. It solves the problem of generic outreach emails by building a customer persona from email history and generating tailored sales messages using Google Gemini models.
manualTrigger
lmChatGoogleGemini
gmail
+6
Workflow Identifier: 1218
NODES in Use: manualTrigger, set, lmChatGoogleGemini, informationExtractor, gmail, stickyNote, hubspot, splitInBatches, noOp

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow pulls contacts who are decision-makers from HubSpot CRM.
It fetches recent email conversations from Gmail for each contact.
Then it uses Google Gemini AI to learn about each contact’s communication style and pain points.
Finally, it creates a personalized sales email draft in Gmail tailored to each contact.
The goal is to save time and write better emails that match the contact’s personality.


Who Should Use This Workflow

Salespeople who send many outreach emails can use this.
It helps those wanting personal emails without spending hours researching.

The user needs an account on HubSpot, Gmail, and Google Cloud with API access.
Also, some basic knowledge of n8n workflow automation helps.


Tools and Services Used


Beginner Step-by-Step: How to Use This Workflow in Production

Download and Import

  1. Download the workflow file from the Download button on this page.
  2. Open the n8n editor where you want to run the automation.
  3. Use the “Import from File” option to upload the downloaded workflow.

Configure Credentials and Settings

  1. Add or update the HubSpot API Key in the Get Contacts node.
  2. Update Gmail OAuth2 credentials in both the Get All Customer’s Correspondence and Create Draft Email For Review nodes.
  3. Make sure Google Gemini API Key is set in the Google Gemini Chat Model nodes.
  4. Review any filters like email addresses, HubSpot list IDs, or limits to match your data.

Test and Activate

  1. Run the workflow manually by pressing “Execute Workflow” on the trigger node.
  2. Observe output at each step to confirm it finds contacts, fetches emails, and generates drafts.
  3. When satisfied, activate the workflow to run on a schedule or trigger as needed.

Using self-host n8n is possible for better control over your automation.


Workflow Input → Processing → Output

Inputs

Processing Steps

  • The workflow loops through each contact one-by-one.
  • For each contact, it gets recent emails for context.
  • Google Gemini AI analyzes emails to build a persona profile like communication style and motivations.
  • A second AI call creates a tailored sales email draft using the persona and sales product info.
  • The draft email is created in Gmail for review and sending.

Output

  • One custom draft email per contact saved inside Gmail.
  • The draft uses the right tone and highlights product benefits matching the contact’s style.

Edge Cases or Failures and How to Fix

  • Authentication Errors: Occur if Gmail or HubSpot API keys expire or are invalid.
    Fix by re-adding OAuth credentials in n8n.
  • No Contacts Found: Happens if HubSpot filters are misconfigured or no contacts match.
    Check filter settings and HubSpot list contents.
  • No Emails Retrieved: Can be caused by wrong email filters or missing Gmail permissions.
    Test queries directly in Gmail to confirm syntax.
  • Incomplete AI Persona Data: May result from API rate limits or prompt issues.
    Review Google Cloud quota and prompts used with Gemini API.

Customization Ideas

  • Change product details in the variables node to reflect current offerings.
  • Adjust the number of emails fetched per contact in the Gmail node.
  • Modify the email creation node to send directly without review by switching from draft creation to sending.
  • Edit persona attributes extracted by AI to better fit your sales approach.
  • Replace HubSpot contact node with other CRM connectors supported by n8n.

Summary of Benefits

✓ Saves many hours by automating email personalization.
✓ Creates emails that reflect how each person prefers to communicate.
✓ Lets sales reps review emails before sending.
✓ Works in batch mode for many contacts.


Example AI Prompt Used in Google Gemini Chat Model Node

This prompt asks AI to understand persona from email texts:

Analyze these email conversations between the sales rep and the client.
Extract client personality traits such as communication style, decision-making behavior, pain points, and motivations.
Deliver the result as JSON with fields: communication_preferences, decision_making_style, pain_points, professional_goals_motivations.

Use the output to guide the sales email generation.


Example Prompt for Generating Sales Email

This AI prompt tells Gemini to draft the email:

Act as a sales rep writing a closing email.
Use this customer persona to match tone and content.
Include product benefits related to the customer pain points.
Format the email in HTML.

This ensures emails feel personal and professional.


Frequently Asked Questions

Yes, the workflow supports other CRMs like Salesforce or Pipedrive by changing the contact retrieval node and mapping fields.
API usage depends on contact volume and prompt size, so monitor usage and optimize prompts to control costs.
Common causes are incorrect Gmail filter syntax or the contact not having matching emails in the inbox.
Data stays within secure authenticated connections, but users should handle sensitive data carefully when sending to third-party AI APIs.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free