Skip to main content

Write and track cold emails with Google Gemini and Gmail

Workflow preview

Workflow preview
100%
Write and track cold emails with Google Gemini and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow uses an n8n Chat trigger with Google Gemini to draft a personalized cold email, sends it via Gmail with a tracking pixel, and then captures opens through a webhook that...

Best for

  • Lead Nurturing automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.code, n8n-nodes-base.datetime

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ravi Patel.

Original n8n.io source

1.1 Workflow description

Title
Write and track cold emails with Google Gemini and Gmail
Workflow name
Write and track cold emails with Google Gemini and Gmail

Quick Overview

This workflow uses an n8n Chat trigger with Google Gemini to draft a personalized cold email, sends it via Gmail with a tracking pixel, and then captures opens through a webhook that triggers an internal Gmail notification.

How it works

  1. Receives a chat message in n8n containing an action and context such as a LinkedIn URL, company profile, website, or job post.
  2. Uses Google Gemini through an AI agent to generate a cold email with labeled fields for recipient name, recipient email, subject, and email body.
  3. Parses the AI response into structured fields and stops with an error if the recipient email address is missing.
  4. Generates a unique tracking ID and builds a tracking-pixel URL that includes the recipient email, name, and subject as query parameters.
  5. Converts the email body into HTML, appends a 1×1 tracking pixel image, and sends the email to the recipient via Gmail.
  6. When the recipient’s email client loads the tracking pixel, a webhook captures the request metadata, adds a timestamp, and sends an “email opened” notification to your inbox via Gmail.

Setup

  1. Add a Google Gemini (PaLM) API credential and select the model you want to use in the Google Gemini Chat Model configuration.
  2. Add a Gmail OAuth2 credential for sending the outbound email and for sending the internal open-notification email.
  3. Replace the placeholder text "webhook url from tracking webhook node" in the tracking URL generator with your real Tracking Webhook production URL.
  4. Update the internal notification recipient address in the Gmail open-notification step and ensure your AI prompt signature ("Your Name") matches what you want to send.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Tracking Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - Set Pixel And Metadata

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Send Open Notification

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 4 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 5 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 6 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1.1

Block 7 - Parse AI Output

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Generate Tracking ID

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Build HTML Email

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Send via Gmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 11 - Date & Time

Type / Role
n8n-nodes-base.dateTime - dateTime
Config choices
Version 2

Block 12 - Sticky Note Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky - Chat Trigger

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky - Tracking Webhook

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky - Set Pixel Metadata

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky - Open Notification

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky - AI Agent

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky - Parse AI Output

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky - Generate Tracking ID

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky - Build HTML Email

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky - Send via Gmail

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky - Date Time

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Write and track cold emails with Google Gemini and Gmail
Complexity advanced
Nodes 22
Categories Lead Nurturing, AI Chatbot
Author Ravi Patel
Published 10 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16249/16249.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Write and track cold emails with Google Gemini and Gmail do?

Quick Overview This workflow uses an n8n Chat trigger with Google Gemini to draft a personalized cold email, sends it via Gmail with a tracking pixel, and then captures opens through a webhook that...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Nurturing, AI Chatbot use case.