Automated Cold Email Outreach with Randomization and Tracking - n8n Workflow

Deploy robust cold email campaigns using this n8n workflow. Pull leads, randomly select email templates, personalize messages, and track status in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales and Marketing Teams: Users needing to scale cold outreach without manual effort.

  • Growth Hackers: Individuals looking for dynamic personalization and A/B testing capabilities using randomized email templates.

  • CRM Administrators: Professionals who need reliable, tracked email sending capabilities integrated with Google Sheets.

  • n8n Users: Anyone seeking advanced examples of using the n8n node combination for looping, data manipulation, and external service integration.

Overview

Managing cold email campaigns efficiently often requires personalization, rate limiting, and robust tracking to avoid spam filters and maintain good deliverability. This specialized n8n workflow solves these challenges by combining Google Sheets data management with dynamic template randomization and SMTP sending.

This powerful n8n workflow ensures that every run is idempotent by filtering out leads already marked 'SENT'. For each new lead, it fetches a pool of pre-written email templates from a separate sheet, uses a custom n8n node (Code) to randomly select one, and then performs deep personalization using the lead's name. By including a Wait n8n node, the workflow respects stringent email service rate limits, dramatically improving deliverability. Finally, every successful send is immediately logged back into your Google Sheets, giving you a real-time audit trail and preventing duplicate emails on future runs of the n8n trigger.

How it Works

This powerful n8n workflow initiates either manually or via a schedule using the manual n8n trigger node:


  1. Lead Extraction: The initial Google Sheets n8n node fetches all lead records from the designated 'Leads' spreadsheet, typically containing Name, Email, and Send Status.

  2. Filtering: An If n8n node checks the 'Send Status' field. Only records where the status is not equal to 'SENT' are allowed to proceed, ensuring the n8n workflow skips already contacted leads.

  3. Loop Initialization: The Loop Over Items n8n node processes each filtered lead individually.

  4. Template Randomization: Inside the loop, a separate Google Sheets1 n8n node retrieves the entire list of available email templates (Subject and Body) from a second sheet. A Code n8n node then executes a script to randomly select one of these n8n templates. This adds essential randomization to your cold outreach.

  5. Data Merging: A Merge n8n node combines the specific lead data (Name, Email) with the randomly selected template (Subject, Body).

  6. Personalization: The Edit Fields (Set) n8n node performs advanced personalization, replacing the [Name] placeholder in both the subject and body with the lead's actual name, using 'there' as a graceful fallback if the name is missing.

  7. Email Sending & Delay: The Send email n8n node uses SMTP credentials to dispatch the personalized message. The output then hits a Wait n8n node, enforcing a delay (recommended 30-60 seconds) between each email to maintain a healthy sending reputation.

  8. Status Logging: After successful delivery, the flow merges the data again and the final Google Sheets6 n8n node updates the original lead entry. It sets the 'Send Status' to the success code and records the exact 'Time' of the send, closing the loop of this complex n8n workflow.

Installation Guide

To install and utilize this n8n template for your cold email campaigns, follow these steps:


  1. Import: Copy the provided JSON into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Google Sheets Setup: You need two separate lists in Google Sheets:

Leads Sheet (Sheet1): Columns must include: Name, Email, Send Status, Time.
Templates Sheet (Sheet2): Columns must include: Subject, Body (use [Name] as the placeholder).

  1. Google Sheets Credentials: Update the credentials in the Google Sheets, Google Sheets1, and Google Sheets6 n8n node instances using your Google Sheets OAuth2 API credentials.

  2. SMTP Setup: Crucially, set up SMTP credentials in the Send email n8n node. Note: Gmail SMTP is strongly discouraged; use services like SendGrid or Mailgun for reliable mass sending. Ensure you set the correct 'From Email' address.

  3. Node Configuration: For each of the three Google Sheets n8n node instances, ensure the correct Document ID and Sheet Name (tab name) are selected to match your setup.

  4. Rate Limiting: Review the Wait n8n node configuration and set an appropriate delay (e.g., 60 seconds) to prevent throttling by your email provider.

  5. Testing: Use the 'When clicking ‘Test workflow’ n8n trigger and test the n8n workflow with 2-3 of your own email addresses to confirm personalization and status logging are functioning correctly before a full deployment.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): The starting point of the n8n workflow, useful for manual or scheduled execution.
Google Sheets (Get Leads Data): Fetches all rows from the main Leads sheet (Sheet1) using the getAll operation. This is the source for your cold outreach list.
If (Filter Leads): A core logic n8n node that checks if the field Send Status is notEquals to 'SENT'. This prevents duplicate sending.
Loop Over Items (Split In Batches): Ensures the subsequent steps, including template selection and email sending, run one lead at a time, facilitating rate limiting.
Google Sheets1 (Get Email Templates): Fetches the entire pool of email n8n templates from the designated Templates sheet (Sheet2).
Code: This custom n8n node performs two vital tasks: 1) Picks a random template object from the input array, and 2) Converts line breaks (\n) in the Body field to HTML break tags (
) for proper email formatting.
Edit Fields (Set): The key personalization n8n node. It uses expressions to dynamically replace the [Name] placeholder in the subject and body fields with the actual data from the lead item, ensuring every outgoing email is personalized.
Send email: Sends the final, personalized email using configured SMTP credentials.
Wait: Introduces a crucial delay between sending each email, mitigating the risk of triggering spam filters or exceeding provider rate limits.
Google Sheets6 (Log Status): Uses the appendOrUpdate operation. It matches the lead based on Email and updates the row, setting the 'Send Status' to 'SENT' and logging the time, completing the tracking process within this robust n8n workflow.

Related n8n Workflows

Free

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

Automation freelancer solving business challenges with n8n. From email sequences to API integrations and workflow optimization. I build solutions that save time and boost productivity. Let's connect. 🔧

Featured*