AI-Powered B2B Lead Nurturing and Personalized Email Drafting - n8n Workflow

Automate B2B lead generation, enrich data with AI agents, and draft hyper-personalized introductory emails using OpenAI (GPT-4o) and Google Sheets in this comprehensive n8n workflow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales Development Representatives (SDRs) and B2B marketers needing to scale personalization.

  • Businesses utilizing Google Sheets as a lightweight CRM or lead tracker.

  • Users looking for advanced examples of integrating LLMs like GPT-4o and Gemini within an n8n workflow.

  • Automation specialists seeking efficient, AI-driven lead nurturing n8n templates.

Overview

This sophisticated n8n workflow solves the persistent challenge of manual lead research and initial email outreach. The automation intelligently combines multiple steps: first, it captures the lead and stores it in Google Sheets. Second, an AI Agent, powered by Google Gemini, performs real-time data enrichment by researching the lead's company. Third, using the enriched data, the OpenAI n8n node (GPT-4o) crafts a hyper-personalized email draft based on a detailed B2B template, addressing the lead's specific pain points. This streamlined n8n workflow dramatically reduces manual work for sales teams, allowing them to focus solely on reviewing and sending perfectly targeted, high-quality emails, making this a crucial n8n template for modern sales operations.

How it Works

The n8n workflow operates in two main phases: Lead Capture & Enrichment, followed by Personalized Drafting.


  1. Lead Capture: The process begins with the On form submission n8n trigger, capturing essential lead details (Name, Company, Email) through an n8n form.

  2. Initial Storage: The data is immediately logged into a Google Sheet using the Append row in sheet n8n node, setting the initial Status to 'To Send'.

  3. AI Enrichment: An AI Agent is triggered. This agent uses the lead's company name and executes a web search (via the HTTP Request tool and the Google Gemini Chat Model) to find and summarize company activities and location.

  4. Data Structuring: A Code n8n node parses the AI Agent's response to cleanly extract structured fields for Company Information and Location.

  5. Database Update: The Update row in sheet n8n node adds this enriched data back into the lead's Google Sheet row.

  6. Drafting Check: The Get row(s) in sheet n8n node initiates the drafting phase by fetching all leads with the status 'To Send'.

  7. Personalized Content: The Introductory email n8n node (using OpenAI's GPT-4o) takes all collected data (form input + enriched data) and generates a unique, customized email subject and body based on a predefined prompt template.

  8. Draft Creation: The Create a draft (Gmail) n8n node saves this AI-generated content directly into the sales team's Gmail drafts folder, ready for final review.

  9. Status Completion: Finally, an Append or update row in sheet n8n node marks the lead's status as 'Drafted' and logs the date, maintaining accuracy within the n8n workflow.

Installation Guide

To install and utilize this n8n template, follow these steps:


  1. Import: Copy the entire JSON code provided above and paste it into your n8n instance using the 'Import Workflow' option.

  2. Credentials Setup: You must configure credentials for the following services:

Google Sheets: Set up OAuth2 credentials for the Google Sheets n8n node to access your lead tracking spreadsheet.
OpenAI: Set up API key credentials for the OpenAI n8n node to enable GPT-4o email generation.
Gmail: Set up OAuth2 credentials for the Gmail n8n node for saving email drafts.
Google Gemini (or PaLM API): Set up API credentials to power the AI Agent node for company research.

  1. Google Sheet Structure: Ensure your Google Sheet matches the expected column names used in the workflow: 'First Name', 'Email ID', 'Company Name', 'Message', 'Status', 'Company Information', and 'Intro email Date'.

  2. Customize AI Prompts: Review the prompt within the Introductory email n8n node to customize the B2B email template and company information (e.g., replace placeholder company names with yours) for optimal results.

Node Details

On form submission (n8n trigger): The starting n8n trigger point, used to capture lead data via an embedded form.
Append row in sheet (Google Sheets): Logs the incoming lead data and sets the initial status to 'To Send' in the specified sheet.
AI Agent (LangChain Agent n8n node): Orchestrates lead enrichment. It is configured to search online (using the HTTP Request tool) for company details and uses the Google Gemini Chat Model to process the findings.
Code (n8n node): Parses the output from the AI Agent, using JavaScript logic to extract 'CompanyDescription' and 'CompanyLocation' into separate, structured variables.
Get row(s) in sheet (Google Sheets n8n node): Filters the lead sheet for rows matching 'Status = To Send', acting as the internal n8n trigger for the drafting process.
Introductory email (OpenAI n8n node): Leverages the powerful chatgpt-4o-latest model to dynamically create a personalized subject and body for the outreach email, using lead and company data.
Create a draft (Gmail n8n node): Creates the draft email using the EmailSubject and EmailContent variables generated by the OpenAI n8n node, addressed to the lead's Email ID.
Append or update row in sheet (Google Sheets n8n node): Final update action, changing the lead's status to 'Drafted' and logging the current timestamp.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Founder - SoulAds.ai, BuildmyAIFlow.agency, peppy production. The curious mind behind many startups and now the driving force behind a new wave of AI-powered brand storytelling through SoulAds.ai and automation through BuildmyAIflow.agency.

Featured*