Automate Google Drive to Pinecone with n8n & Google Gemini

This workflow automates extracting large Google Docs text, chunking it contextually, embedding with Google Gemini, and storing vectors in Pinecone for smart retrieval. Save hours and improve search relevance with this n8n automation.
googleDrive
lmChatOpenRouter
vectorStorePinecone
+11
Workflow Identifier: 1327
NODES in Use: Manual Trigger, Google Drive, Extract Text, Code, SplitOut, Split In Batches, OpenRouter Chat Model, Agent, Set, Google Gemini Embeddings, Pinecone Vector Store, Default Data Loader, Recursive Character Text Splitter, Sticky Note
Automate Google Drive to Pinecone with n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow gets a Google Docs file, breaks its text into sections, then makes smart summaries and stores them as vectors for better searching.
It solves the problem of spending many hours doing this work by hand.
The result is faster and more relevant search answers for big documents.


Who should use this workflow

This is made for people who manage big Google Docs and want quicker, easier search results.
It fits teams who want to save time and reduce mistakes when preparing content for search.

You should have accounts and access for Google Drive, Google Gemini API, OpenRouter, Pinecone, and n8n automation.
No coding skills are needed but some setup of API keys is required.


Tools and services used

  • Google Drive: Holds the original document.
  • Google Gemini (PaLM) API: Creates vector embeddings from text.
  • OpenRouter Chat Model: Creates short context summaries from each text chunk.
  • Pinecone Vector Store: Stores and indexes vector data for search.
  • n8n automation platform: Runs the workflow steps.


Workflow Inputs, Processing, and Output

Inputs

  • Google Docs file ID to process.
  • API credentials for Google Drive, Gemini, OpenRouter, and Pinecone.

Processing Steps

  • Download the Google Docs file as plain text.
  • Extract and clean the text data.
  • Split the text into sections using a custom delimiter.
  • Prepare each section individually for processing.
  • Loop over each section one by one to avoid overload.
  • Use OpenRouter Chat Model to create a short context summary for each chunk.
  • Combine the context summary with its text chunk.
  • Generate text embeddings with Google Gemini embedding model.
  • Send embeddings to Pinecone vector index for storage.

Output

The workflow produces vector embeddings indexed inside Pinecone.
This improves speed and quality when searching the document content later.


Beginner step-by-step: How to build this in n8n

1. Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Go into the n8n editor, choose “Import from File” option.
  3. Select and upload the workflow file.

2. Configure the workflow

  1. Add all required credentials in n8n Credentials Manager:
    Google Drive OAuth2, OpenRouter API Key, Google Gemini API Key, Pinecone API Key.
  2. Update the Google Docs file ID in the Get Document From Google Drive node to the document to process.
  3. If needed, adjust prompt in the AI Agent node or chunking parameters.

3. Test the workflow

  1. Run the workflow once manually using the Manual Trigger node.
  2. Check if the document content downloads and processes without errors.

4. Activate for production

  1. Turn on the workflow by switching it to Active inside n8n.
  2. Optionally add scheduled triggers or webhooks to automate runs.
  3. Monitor workflow runs in n8n execution logs.

For smoother self hosting, see self-host n8n options.


Customization ideas

  • Change the Google Docs file by updating the fileId in the Google Drive node.
  • Adjust the text splitting delimiter in the Split Document Text Into Sections node for different section sizes.
  • Modify the AI prompt in the OpenRouter node to tailor the context summary for specific subjects.
  • Switch to a different Google Gemini embedding model by changing model name in the embedding node.
  • Increase batch size in the looping node to process multiple chunks at once if API limits allow.


Common issues and fixes

  • Google Drive API auth fails: This means credentials are missing or expired. Fix by re-authenticating credentials in the Google Drive node.
  • OpenRouter API errors: Check if API key is correct and internet is working. Update credentials in OpenRouter Chat Model node.
  • Pinecone insertion fails: Verify API key and ensure the Pinecone index “context-rag-test” exists and has permission.


Summary

→ This workflow downloads Google Docs content and chops it into meaningful parts.
→ It adds AI-generated context summaries to each part.
→ Google Gemini creates embeddings from the text and context.
→ Vectors save into Pinecone for quick and relevant search.
→ Saves hours of manual work and makes search smarter and faster.


Automate Google Drive to Pinecone with n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow will fail to download the document. Update the correct file ID in the Get Document From Google Drive node to fix this.
Yes. Change the model name in the Embeddings Google Gemini node to another supported Google PaLM embedding model.
Common causes are incorrect API credentials, missing index named context-rag-test, or lacking correct permissions in Pinecone.
Add a trigger node like Cron in n8n and connect it to start the workflow instead of Manual Trigger.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.