Templates / RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini

RAG: context-aware chunking | Google Drive to Pinecone via OpenRouter & Gemini

Needs changes

by Udit Rawat ✓ · 9,886 views · created 2025-02-09 · Engineering, AI RAG

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 13 nodes and runs manually, when you click “Execute workflow”. Along the way it connects OpenRouter Chat Model, Pinecone Vector Store, Embeddings Google Gemini and Google Drive.

How it runs

Trigger: Manually, when you click “Execute workflow”.

  1. Get Document From Google Drive (Google Drive): download
  2. Extract Text Data From Google Document (Extract from File): extracts data from a file (text)
  3. Split Document Text Into Sections (Code): runs custom JavaScript code
  4. Prepare Sections For Looping (Split Out): splits a list into separate items
  5. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  6. AI Agent: runs an AI agent, with model: OpenRouter Chat Model
  7. Concatenate the context and section text (Edit Fields (Set)): sets or maps fields
  8. Pinecone Vector Store: stores documents in the Pinecone vector store, with embeddings: Embeddings Google Gemini; document loader: Default Data Loader

Services it uses

OpenRouter Chat ModelPinecone Vector StoreEmbeddings Google GeminiGoogle Drive

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in AI Agent - Prepare Context (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.
Removed in 3.0Replace with
AI Agent v1 (old agent modes)
AI Agent - Prepare Context (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (13)

From the author

Workflow based on the following article. https://www.anthropic.com/news/contextual-retrieval This n8n automation is designed to extract, process, and store content from documents into a Pinecone vector store using context-based chunking. The workflow enhances…

Excerpt from Udit Rawat's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.