Skip to main content

Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail

Workflow preview

Workflow preview
100%
Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

What Problem Does This Solve? ️ This workflow automates the process of extracting information from a Google Doc, storing it in a Pinecone vector database, and using it to personalize and send ema...

Best for

  • Social Media automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.vectorstorepinecone, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.executeworkflowtrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail
Workflow name
Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail

What Problem Does This Solve? 🛠️ This workflow automates the process of extracting information from a Google Doc, storing it in a Pinecone vector database, and using it to personalize and send emails based on user input via chat. It eliminates the manual steps of gathering recipient data, writing messages, and dispatching emails providing a fully automated, intelligent communication system.

Perfect for teams that need to:

  • Maintain dynamic contact lists

  • Personalize bulk or contextual email outreach

  • Use chat interfaces to trigger intelligent email actions


Target Audience: Sales teams, marketing departments, HR staff, startup founders, or anyone looking to automate AI-powered communication workflows.


What Does It Do? 🌟

  • Extracts content from a Google Docs document (e.g., a list of contacts or structured notes)

  • Splits, embeds, and stores that content in Pinecone for semantic search

  • Listens for incoming chat messages using n8n's chatTrigger

  • Uses LangChain agents with OpenAI to:

    • Search Pinecone for contextually relevant information (e.g., email addresses)

    • Compose personalized emails based on instructions

  • Sends emails using the Gmail API, triggered dynamically from the AI output


Key Features 📋

  • Google Docs integration for live document data

  • Embedding & vector search with Pinecone for AI lookups

  • Custom LangChain agents with tool calling logic (search + send)

  • Full support for OpenAI models (GPT-4o)

  • Personalized email generation with dynamic name and message filling

  • Modular design: plug-and-play with other tools like CRMs, Notion, etc.


Setup Instructions

Prerequisites

  • n8n Instance: Self-hosted or cloud instance

  • Google Docs Account: For reading input content

  • Pinecone Account: For storing document data semantically

  • OpenAI Account: For generating embeddings and messages

  • Gmail Account: With Gmail OAuth2 credentials for sending emails


Installation Steps 📦

1. Import the Workflow Import the provided JSON files into your n8n instance.

2.Configure Credentials Go to n8n > Credentials, and set up:

  • Google Docs API

  • OpenAI API

  • Pinecone API

  • Gmail OAuth2

3. Set Your Pinecone Index & Namespace Ensure you have a working Pinecone index (e.g., n8ndocs) and namespace (e.g., docsmail).

4. Test the Full Flow

  • Run the Google Docs → Pinecone embedding workflow to prepare data.

  • Send a message to the chatTrigger endpoint (e.g., "Send an offer to User").

  • Check the execution log to verify correct tool usage and Gmail delivery.


How It Works 🔍

1. Data Preparation:

  • Google Doc content is fetched and chunked.

  • OpenAI embeddings are created.

  • Data is stored in Pinecone under a specific namespace.

2. Chat Trigger:

  • A webhook captures chat input.

  • The LangChain agent interprets the user request.

  • The agent uses two tools:

    • Vectorstore_mails: Retrieves relevant emails via Pinecone vector search

    • send_mail: Uses an internal n8n sub-workflow to send Gmail messages

3. Mail Generation & Delivery:

  • Email is personalized using recipient info (name/email from Pinecone)

  • Message follows a clean, friendly format with clear subject and closing

  • Delivered via Gmail integration

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 - When clicking ‘Test workflow’

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

Block 2 - Pinecone Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1

Block 3 - Embeddings OpenAI

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 4 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1

Block 5 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 6 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 7 - AI Agent

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

Block 8 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - Gmail

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

Block 10 - When chat message received

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

Block 11 - Vectorstore Mails

Type / Role
@n8n/n8n-nodes-langchain.toolVectorStore - toolVectorStore
Config choices
Version 1

Block 12 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 13 - send_mail

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

Block 14 - AI Agent1

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

Block 15 - OpenAI Chat Model2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 16 - Pinecone Vector Store1

Type / Role
@n8n/n8n-nodes-langchain.vectorStorePinecone - vectorStorePinecone
Config choices
Version 1

Block 17 - Embeddings OpenAI1

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 18 - Sticky Note

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

Block 19 - Sticky Note1

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

Block 20 - Sticky Note2

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

Block 21 - Get a document

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

3. Summary Table

Workflow Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail
Complexity advanced
Nodes 21
Categories Social Media, AI Chatbot
Author Belgacem Dhiflaoui
Published 07 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5757/5757.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 Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail do?

What Problem Does This Solve? ️ This workflow automates the process of extracting information from a Google Doc, storing it in a Pinecone vector database, and using it to personalize and send ema...

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 Social Media, AI Chatbot use case.