Automated Hyper-Personalized Cold Email Generation - n8n Workflow

Use this powerful n8n workflow to analyze LinkedIn and X (Twitter) profiles, generate hyper-personalized cold emails using OpenAI, and track progress via Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Lead Generation Specialists needing efficient, scalable personalization.
Sales professionals looking for high-conversion outreach n8n templates.
Marketing teams who manage contact lists in Google Sheets.
Automation experts utilizing the power of the n8n node and advanced AI integration.

Overview

Modern outreach requires deep personalization. Manually researching leads on LinkedIn and X (formerly Twitter) and then writing custom emails is extremely time-consuming. This specific n8n workflow eliminates this manual effort. It automatically pulls lead data from a Google Sheet, scrapes recent social media activity via RapidAPI, feeds this data into a sophisticated AI model (GPT-4o) using the LangChain n8n node, and generates highly targeted cover letters and subjects. The resulting email is then automatically sent, and the Google Sheet is updated, providing a seamless, automated, and hyper-personalized cold outreach system built entirely within n8n.

How it Works


  1. Trigger Event: The n8n trigger starts when the Google Sheets Trigger detects a new row in a specified sheet where the 'done' column is empty, indicating a new lead to process.

  2. Data Validation and Setup: An If n8n node checks if the lead has not been processed. Static company and sender variables are then set using the Set n8n node for use in the AI prompt.

  3. Social Data Retrieval (X/Twitter & LinkedIn): The n8n workflow uses multiple HTTP Request n8n node steps, configured with RapidAPI credentials, to first retrieve the Twitter user ID and tweets, and then to fetch the latest LinkedIn posts.

  4. Data Clean-up and Limitation: Custom Code n8n node steps (Extract and limit Linkedin, Exract and limit X) standardize the API responses and limit the dataset to the most recent 10 posts from each platform, optimizing the input size for the subsequent AI step.

  5. AI Generation: The core of the n8n workflow utilizes the LangChain Chain LLM n8n node integrated with the OpenAI Chat Model (GPT-4o). It combines the lead's social media activity and your company's value proposition to find a common match and generate a unique, HTML-formatted cover letter and subject line.

  6. Structured Output: The Structured Output Parser ensures the AI output is a clean JSON object containing the required subject and cover_letter fields.

  7. Final Action: The Send Cover letter and CC me n8n node dispatches the personalized email to the lead. Finally, a Google Sheets n8n node updates the processed row by marking 'X' in the 'done' column, preventing the n8n trigger from processing the lead again.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON code and import it into your n8n instance using the 'Import Workflow' option.

  2. Google Sheets Setup: Ensure you have a Google Sheet with the required columns (linkedinurl, name, twitterhandler, email, and done). Configure the Google Sheets Trigger n8n node with the correct credentials and link it to your target spreadsheet.

  3. Credential Configuration:

OpenAI: Set up your OpenAI credential and link it to the OpenAI Chat Model n8n node.
RapidAPI Keys: You must obtain and configure two separate RapidAPI credentials (Generic HTTP Header Auth) for the Twitter API and the LinkedIn API. These require subscriptions to specific RapidAPI services mentioned in the workflow notes.
* SMTP/Email: Configure your SMTP credential for the Send Cover letter and CC me n8n node to enable sending automated emails.

  1. Personalize Variables: Modify the Set your company's variables n8n node (as highlighted in the sticky note) to input your accurate company name, activity, and contact details.

  2. Activation: Save the n8n workflow and activate the Google Sheets Trigger to begin processing leads.

Node Details

Google Sheets Trigger: This is the starting n8n trigger. It polls the spreadsheet for new leads, specifically focusing on rows where the done column is empty.
Set your company's variables: A critical n8n node for defining static company and sender variables (e.g., company activity, name, email) which provide essential context for the AI generation prompt.
Get twitter ID / Get tweets / Get linkedin Posts: Standard HTTP Request n8n node steps that utilize external RapidAPI services to scrape public social media data based on the URLs and handles provided by the Google Sheets n8n trigger data.
Code Nodes (Extract and limit Linkedin / Exract and limit X): Custom JavaScript n8n node steps designed to parse the raw API responses and cap the number of posts analyzed to 10 per platform, optimizing the AI processing step of the n8n workflow.
OpenAI Chat Model: Provides the large language model capabilities (using GPT-4o) necessary for deep analysis and creative content generation within this n8n workflow.
Generate Subject and cover letter based on match: The core LangChain n8n node. It orchestrates the inputs from company variables and social media data, passing them to the AI to generate a highly tailored outreach message.
Send Cover letter and CC me: The final communication n8n node. It sends the HTML-formatted, AI-generated email content to the prospect while ensuring a copy is CC'd to the sender for tracking.
Google Sheets: Used to close the loop by updating the source spreadsheet, marking the lead as processed and preventing the n8n trigger from repeating the action.

Related n8n Workflows

Paid

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

We create bespoke AI solutions, automations and agents that help your business as it scales.

Featured*