AutomationFlowsAI & RAG › Chat with Google Drive Documents Using Openai and Pinecone RAG Search

Chat with Google Drive Documents Using Openai and Pinecone RAG Search

ByPinecone @pinecone on n8n.io

This n8n workflow template lets you chat with your Google Drive documents (.docx, .json, .md, .txt, .pdf) using OpenAI and Pinecone vector database. It retrieves relevant context from your files in real time so you can get accurate, context-aware answers about your proprietary…

Chat trigger trigger★★★★☆ complexityAI-powered15 nodesPinecone Vector StoreOpenAI EmbeddingsChat TriggerAgentOpenAI ChatDocument Default Data LoaderReranker CohereText Splitter Character Text Splitter
AI & RAG Trigger: Chat trigger Nodes: 15 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #11870 — we link there as the canonical source.

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e73ef010-c51c-4bb1-87cb-92cd65a6a73a",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -16,
        16
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "release-notes-namespace"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-dense-index",
          "cachedResultName": "n8n-dense-index"
        }
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "98c2d7b7-88ff-49d6-9095-a386846f690b",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -80,
        592
      ],
      "parameters": {
        "options": {
          "dimensions": 1536
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5c37d980-4726-4f35-8845-71e8d4750121",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -464,
        864
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "b51a237f-2467-4f72-8d14-04b2443c5270",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -176,
        864
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful assistant. Only use the Pinecone Vector Store Tool to retrieve data about Pinecone releases. Include the file name and file url in citations wherever referenced in output."
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f1299e20-a590-46f3-a742-24bd93fbd78e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -272,
        1136
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c06a2096-c5cc-4a0d-a9f8-fcef5c237c81",
      "name": "Pinecone Vector Store Tool",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        112,
        1008
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 20,
        "options": {
          "pineconeNamespace": "release-notes-namespace"
        },
        "useReranker": true,
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n-dense-index",
          "cachedResultName": "n8n-dense-index"
        },
        "toolDescription": "Contains data about Pinecone releases."
      },
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "a62e23b3-eae6-48e6-9b9e-4b5853234a62",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -80
      ],
      "parameters": {
        "width": 604,
        "height": 1488,
        "content": "![Pinecone logo](https://www.pinecone.io/images/pinecone-logo-for-n8n-templates.png)\n\n\n## Try it out\n\nThis n8n workflow template lets you chat with your Google Drive documents (.docx, .json, .md, .txt, .pdf) using OpenAI and Pinecone vector database. It retrieves relevant context from your files in real time so you can get accurate, context-aware answers about your proprietary data\u2014without the need to train your own LLM.\n#### Not interested in chunking and embedding your own data or figuring out which search method to use?\n\nTry our n8n quickstart for Pinecone Assistant [here](https://docs.pinecone.io/guides/assistant/quickstart/n8n-quickstart) or check out the full workflow to chat with your Google Drive documents [here](https://n8n.io/workflows/9942-rag-powered-document-chat-with-google-drive-openai-and-pinecone-assistant/).\n\n### Prerequisites\n\n* A [Pinecone account](https://app.pinecone.io/)\n* A GCP project with [Google Drive API enabled and configured](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/)\n* An [Open AI account](https://auth.openai.com/create-account) and [API key](https://platform.openai.com/settings/organization/api-keys)\n* A [Cohere account](https://dashboard.cohere.com/welcome/register) and [API key](https://dashboard.cohere.com/api-keys)\n\n### Setup\n\n1. Create a Pinecone index in the Pinecone Console [here](https://app.pinecone.io/organizations/-/projects/-/indexes) \n\t1. Name your index `n8n-dense-index`\n\t2. Select OpenAI's `text-embedding-3-small`\n\t3. Set the Dimension to `1536`\n\t4. Leave everything else as default\n\t5. If you use a different index name, update the related nodes to reflect this change\n2. Use the Connect to Pinecone button to authenticate to Pinecone or if you self-host n8n, create a Pinecone credential and add your [Pinecone API key](https://app.pinecone.io/organizations/-/projects/-/keys) directly\n3. Setup your Google Drive OAuth2 API, Open AI, and Cohere credentials in n8n\n4. Download these files and add them to a Drive folder named `n8n-pinecone-demo` in the root of your My Drive\n\t1. https://docs.pinecone.io/release-notes/2022.md\n\t2. https://docs.pinecone.io/release-notes/2023.md\n\t3. https://docs.pinecone.io/release-notes/2024.md\n\t4. https://docs.pinecone.io/release-notes/2025.md\n\t5. https://docs.pinecone.io/release-notes/2026.md\n5. Activate the workflow or test it with a manual execution to ingest the documents\n6. Enter the chat prompts to chat with the Pinecone release notes\n\t1. `What support does Pinecone have for MCP?`\n\t2. `When was fetch by metadata released?`\n\n### Ideas for customizing this workflow\n\n- Use your own data and adjust the chunking strategy\n- Update the AI Agent System Message to reflect how the Pinecone Vector Store Tool will be used. Be sure to include info on what data can be retrieved using that tool.\n- Update the Pinecone Vector Store Tool Description to reflect what data you are storing in the Pinecone index\n### Need help?\n\nYou can find help by asking in the [Pinecone Discord community](https://discord.gg/tJ8V62S3sH) or [filing an issue](https://github.com/pinecone-io/n8n-templates/issues/new/choose) on this repo."
      },
      "typeVersion": 1
    },
    {
      "id": "f738618b-ce9f-41ab-a6f5-2f7fed2a1d9f",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        128,
        192
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "external_file_id",
                "value": "={{ $json.id }}"
              }
            ]
          }
        },
        "dataType": "binary",
        "binaryMode": "specificField",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "0af1ef79-079b-4c93-a7d6-ea65c153de52",
      "name": "Cohere Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        208,
        1248
      ],
      "parameters": {
        "topN": 5
      },
      "credentials": {
        "cohereApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3058cf8c-385d-4f9b-bdb4-12243bb1c52f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 1184,
        "height": 608,
        "content": "## 1. Download, chunk, embed, and upsert Pinecone release notes to Pinecone index"
      },
      "typeVersion": 1
    },
    {
      "id": "c844c7ca-fc77-44d7-9fc7-3ae5dd5b11b1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        736
      ],
      "parameters": {
        "color": 7,
        "width": 1184,
        "height": 672,
        "content": "## 2. Chat with the Pinecone release notes"
      },
      "typeVersion": 1
    },
    {
      "id": "766a7768-8bf7-458b-b43c-29fe238fc8df",
      "name": "Character Text Splitter - markdown",
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "position": [
        224,
        352
      ],
      "parameters": {
        "chunkSize": 2000,
        "separator": "<Update label=\"",
        "chunkOverlap": 500
      },
      "typeVersion": 1
    },
    {
      "id": "2fb30743-a6f7-44eb-aed0-abc3eba9a399",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -80
      ],
      "parameters": {
        "color": 6,
        "width": 576,
        "height": 608,
        "content": "## What chunking strategy should I use?\n\nIn the case of the Pinecone release notes, these are markdown files with separators like this:\n\n```\n<Update label=\"2025-12-12\" tags={[\"General\"]}>\n  ### Upgrade from Starter to Standard trial\n\n  Organizations on the Starter plan can now upgrade to a Standard plan trial at any time. The Standard trial provides 21 days and \\$300 in credits to test Pinecone at scale, with access to Standard plan features such as higher limits. For more information, see [Standard plan trial](/guides/organizations/manage-billing/standard-trial).\n</Update>\n```\n\nEach release is contained in an `Update` tag and each feature indicated by `###`. We expect our queries to be as granular as features in a release, so we try to chunk by release without breaking up features. We want chunks to be big enough to contain meaningful information but not so big that the meaning is diluted or it can't fit within the context window of the embedding model. Here, we use the Character Text Splitter and split on `<Update label=\"` with a chunk size about as big as a release and an overlap in case info spills to the next chunk.\n\nNote: We could also choose to use the Recursive Text Splitter to break paragraphs, sentences and words based on markdown syntax, depending on a given chunk size. This was less accurate for the example queries based on the shape of the data and expected queries.\n\nYou can read more about choosing a chunking strategy [here](https://www.pinecone.io/learn/chunking-strategies/)."
      },
      "typeVersion": 1
    },
    {
      "id": "675daabc-abb7-49d8-b1c8-dac9b3b2aa36",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -496,
        16
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1gsyG6CMIIVkLU9fHpmrrf3GVja6VFDrO",
          "cachedResultUrl": "",
          "cachedResultName": "n8n-pinecone-demo"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8fb8ddb6-ea88-4410-b065-9c4c2ac8e2e6",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -288,
        16
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "fileName": "={{ $json.name }}"
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    }
  ],
  "connections": {
    "Download file": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cohere Reranker": {
      "ai_reranker": [
        [
          {
            "node": "Pinecone Vector Store Tool",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Pinecone Vector Store Tool",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter - markdown": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n workflow template lets you chat with your Google Drive documents (.docx, .json, .md, .txt, .pdf) using OpenAI and Pinecone vector database. It retrieves relevant context from your files in real time so you can get accurate, context-aware answers about your proprietary…

Source: https://n8n.io/workflows/11870/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow acts as a 24/7 sales agent, engaging leads across WhatsApp, Instagram, Facebook, Telegram, and your website. It intelligently transcribes audio messages, answers questions using a knowle

Chat Trigger, Memory Postgres Chat, Tool Workflow +20
AI & RAG

• Create a Google Drive folder to watch. • Connect your Google Drive account in n8n and authorize access. • Point the Google Drive Trigger node to this folder (new/modified files trigger the flow).

Agent, Chat Trigger, Memory Buffer Window +14
AI & RAG

The workflow operates through a three-step process that handles incoming chat messages with intelligent tool orchestration: Message Trigger: The node triggers whenever a user message arrives and passe

Chat Trigger, Memory Postgres Chat, OpenAI Embeddings +16
AI & RAG

Advanced Ai Demo Presented At Ai Developers 14 Meetup. Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14
AI & RAG

Advanced Ai Demo (Presented At Ai Developers #14 Meetup). Uses slack, stickyNote, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Chat trigger; 39 nodes.

Slack, Text Splitter Recursive Character Text Splitter, OpenAI Embeddings +14