RAG Workflow For Company Documents stored in Google Drive n8n Workflow Template

n8n workflow template · 15 nodes · Pinecone

RAG Workflow For Company Documents stored in Google Drive is a free n8n workflow template that starts from the Google Drive Trigger node and works with Pinecone, Google Gemini and Google Drive. It has 15 nodes, 12 of them AI nodes (Pinecone Vector Store, Google Gemini Embeddings, Default Data Loader and Recursive Character Text Splitter). To run it, you add your own credentials for Google Drive OAuth2, Google Gemini (PaLM) API and Pinecone API.

At a glance

Trigger
Google Drive Trigger (Google Drive File Updated)
Nodes
15
Apps
Pinecone, Google Gemini and Google Drive
AI nodes
12
Credentials
3 types
Category
RAG, documents and vector search

Apps and integrations

  • Pinecone
  • Google Gemini
  • Google Drive

Node types used

  • Pinecone Vector Store
  • Google Gemini Embeddings
  • Default Data Loader
  • Recursive Character Text Splitter
  • AI Agent
  • Vector Store Question Answer Tool
  • Google Drive
  • Google Drive Trigger
  • Window Buffer Memory
  • Chat Trigger
  • Google Gemini Chat Model

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Chat with company documents

Add docuemnts to vector store when updating or creating new documents in Google Drive

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Set up steps

  1. Google Cloud Project and Vertex AI API
  • Create a Google Cloud project.
  • Enable the Vertex AI API for your project.
  1. Google AI API Key
  • Obtain a Google AI API key from Google AI Studio.
  1. Pinecone Account
  • Create a free account on the Pinecone website.

Obtain your API key from your Pinecone dashboard.

  • Create an index named company-files in your Pinecone project.
  1. Google Drive
  • Create a dedicated folder in your Google Drive where company documents will be stored.
  1. Credentials in n8n: Configure credentials in your n8n environment for
  • Google Drive OAuth2
  • Google Gemini(PaLM) Api (using your Google AI API key)
  • Pinecone API (using your Pinecone API key)
  1. Import the Workflow
  • Import this workflow into your n8n instance.
  1. Configure the Workflow
  • Update both Google Drive Trigger nodes to watch the specific folder you created in your Google Drive.
  • Configure the Pinecone Vector Store nodes to use your company-files index.

Nodes in this workflow

The 15 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Pinecone Vector Store (Pinecone Vector Store)
  2. Embeddings Google Gemini (Google Gemini Embeddings)
  3. Default Data Loader (Default Data Loader)
  4. Recursive Character Text Splitter (Recursive Character Text Splitter)
  5. AI Agent (AI Agent)
  6. Vector Store Tool (Vector Store Question Answer Tool)
  7. Pinecone Vector Store (Retrieval) (Pinecone Vector Store)
  8. Embeddings Google Gemini (retrieval) (Google Gemini Embeddings)
  9. Download File From Google Drive (Google Drive)
  10. Google Drive File Updated (Google Drive Trigger)
  11. Google Drive File Created (Google Drive Trigger)
  12. Window Buffer Memory (Window Buffer Memory)
  13. When chat message received (Chat Trigger)
  14. Google Gemini Chat Model (Google Gemini Chat Model)
  15. Google Gemini Chat Model (retrieval) (Google Gemini Chat Model)

Credentials you need

  • Google Drive OAuth2 – used by Download File From Google Drive, Google Drive File Created and Google Drive File Updated
  • Google Gemini (PaLM) API – used by Embeddings Google Gemini, Embeddings Google Gemini (retrieval), Google Gemini Chat Model and Google Gemini Chat Model (retrieval)
  • Pinecone API – used by Pinecone Vector Store and Pinecone Vector Store (Retrieval)

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us