n8n

How to Embed Google Drive to Pinecone Search?

Turn long Google Docs into a high quality search index in Pinecone. Teams can load a document, slice it into clear sections, add smart context with an AI agent, and store vectors for fast and accurate retrieval. Great for marketing and sales teams that need quick answers from content libraries.

The flow starts on a manual run. It downloads a Google Doc as plain text, extracts the content, and uses custom code to split the text by a clear separator. Each section moves through a loop. An AI agent, powered by an OpenRouter chat model, reads the full document and the current section to write helpful context. The context and section are joined into one text. Google Gemini creates embeddings, and the Pinecone node inserts them into a chosen index. This design improves relevance because each chunk carries situational context, not just raw text.

You will need accounts for Google Drive, OpenRouter, Google Gemini, and Pinecone. Expect to cut prep time from hours to minutes and make content easier to search at scale. Use it for product docs, sales playbooks, campaign briefs, and FAQs. After setting credentials and the index name, run the manual trigger and watch sections load into Pinecone for instant use in chat or search.

What are the key features?

  • Manual trigger lets you control when the run starts for safe testing.
  • Google Drive download converts a Doc to clean plain text for reliable parsing.
  • Extract Text step pulls the content out of the file ready for processing.
  • Custom Code splits text into sections using a clear separator string.
  • Split Out and Loop Over Items process each section one by one.
  • AI Agent with an OpenRouter model writes context using the full document and the current section.
  • Set node joins the agent context with the section to form a richer chunk.
  • Google Gemini embeddings create vector representations of the text.
  • Pinecone Vector Store inserts vectors into a chosen index for fast search and retrieval.

What are the benefits?

  • Reduce manual document prep from 3 hours to 15 minutes
  • Streamline content indexing by up to 80 percent
  • Improve answer relevance by adding context to each chunk
  • Handle 10 times more sections with batch processing
  • Connect Google Drive, OpenRouter, Google Gemini, and Pinecone in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, Pinecone, OpenRouter and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. Open the Google Drive node in n8n and create a new Google Drive OAuth2 credential. Follow the on screen steps, then select the account.
  4. In the Google Drive node, set the file ID of your document and keep conversion to text enabled. Run this node and confirm a text file is returned.
  5. Open the Extract Text node and run it. Check that the output contains the full document text in a single field.
  6. Open the Code node and review the separator string. If your document uses a different marker between sections, change the string and test. Confirm an array called section is produced.
  7. Open the Split Out node and ensure the field to split is section. Run once and confirm multiple items are created for each section.
  8. Open the OpenRouter Chat Model node and create a new credential with your OpenRouter API key. Choose a stable chat model and save.
  9. Open the AI Agent node. Keep the provided prompt that includes both the document and the current chunk. Adjust wording if you need different context style.
  10. Create a Google Gemini credential in n8n using your API key. In the Embeddings node, select the text embedding model text-embedding-004 and test with a sample text.
  11. In Pinecone, create an index and note the name. In n8n, create a Pinecone credential with your API key. Open the Pinecone Vector Store node, select the credential, choose your index, and keep mode set to insert.
  12. Start a full run with the manual trigger. Watch the loop process each section. Check your Pinecone dashboard to confirm new vectors appear in the chosen index.
  13. If you see 401 or permission errors, verify API keys and Google Drive access to the file. If you get a dimension mismatch, recreate the Pinecone index to match the embedding model.
  14. Increase or decrease the Split In Batches size to control speed and rate limits for OpenRouter and Gemini.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

OpenRouter

Sign up

Free models: $0 via API, 20 requests/min; 50/day or 1000/day with ≥10 credits

Pinecone

Sign up

Starter (Free): $0 / mo; includes 2 GB storage, 2M write units / mo, 1M read units / mo, up to 5 indexes; API access.

Credits:
YouTube video

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.