{
  "name": "Personalized email automation using Google Docs, Pinecone, GPT-4o and Gmail",
  "nodes": [
    {
      "id": "c3066810-8dd0-4b1c-8daa-ea5892551d7d",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -140,
        -860
      ]
    },
    {
      "id": "8b6c598a-547a-485a-a294-68c562ef86be",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        340,
        -860
      ]
    },
    {
      "id": "7c86d348-875a-4b57-94c2-ad37c10a24cf",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        200,
        -660
      ]
    },
    {
      "id": "70d44b68-e1f6-4794-9114-a20dcfe9fa7d",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        360,
        -640
      ]
    },
    {
      "id": "d8e2ae43-88ae-4bc4-818a-e46fea4968fb",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        400,
        -480
      ]
    },
    {
      "id": "1e43f542-5498-4626-981a-076c2748553f",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        20,
        600
      ]
    },
    {
      "id": "4c0907b1-32b4-498b-838b-d8c1377930a1",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        240,
        600
      ]
    },
    {
      "id": "6603a4d8-52c3-49cb-a3ad-32ccb6f1427c",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        200,
        860
      ]
    },
    {
      "id": "79342d85-a9d0-459a-8b2b-ae60a2d09006",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        500,
        860
      ]
    },
    {
      "id": "65054e26-803c-4cbf-89f9-be90411ee1ad",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        -200
      ]
    },
    {
      "id": "772f7733-5d42-4add-977e-a6f398adb683",
      "name": "Vectorstore Mails",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        180,
        40
      ]
    },
    {
      "id": "c8087076-86c2-4600-ba2e-54ca42441fad",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        420,
        220
      ]
    },
    {
      "id": "1567e58b-ae16-49f8-8913-3222bb870a9d",
      "name": "send_mail",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        540,
        60
      ]
    },
    {
      "id": "cda619f9-9e41-4559-8580-2830b675fe7a",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        -200
      ]
    },
    {
      "id": "e8a2fbef-5534-423c-bcc0-c007a67ad83e",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        20,
        60
      ]
    },
    {
      "id": "79c33b28-a1f8-4b25-a1f4-c9110929aa0a",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        60,
        220
      ]
    },
    {
      "id": "bc1ddbcc-52aa-4f05-9c16-2b5cc42cc1b1",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        120,
        360
      ]
    },
    {
      "id": "6e44ad97-d77c-434f-b869-3101c1046ced",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -860
      ],
      "parameters": {
        "width": 660,
        "height": 360,
        "content": "#### **First Step**\n* Add list of contact Email from Google Docs to vector store \"Pinecone\"\n\n  * **Read Google Docs Data:** Use the n8n Google Docs node to access and retrieve the list of contact emai"
      }
    },
    {
      "id": "ec252e7d-44e1-47f3-a7bd-104615e7eb82",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -120
      ],
      "parameters": {
        "width": 760,
        "height": 420,
        "content": "#### **Second Step**\n* Retrieve email addresses from Pinecone and generate personalized emails, then uses a separate workflow to send them, all triggered by a chat message.\n\n   * **AI Agent (Core Logi"
      }
    },
    {
      "id": "0de864f4-6b36-41d2-a4b0-5e51a7ad961c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -840,
        580
      ],
      "parameters": {
        "width": 800,
        "height": 340,
        "content": "#### **Third Step**\n* Triggered by second workflow, uses an AI Agent to dynamically compose and send emails via Gmail, extracting recipient, subject, and message content from the incoming data.\n\n  * T"
      }
    },
    {
      "id": "a44c0e8e-34c0-4ff1-888e-0a841e5434d2",
      "name": "Get a document",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        80,
        -860
      ]
    }
  ],
  "connections": {
    "Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "send_mail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get a document": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Vectorstore Mails": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Vectorstore Mails",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store1": {
      "ai_vectorStore": [
        [
          {
            "node": "Vectorstore Mails",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get a document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}