RAG:Context-Aware Chunking | Google Drive to Pinecone via OpenRouter & Gemini

Prepare Document. This section is responsible for downloading the file from Google Drive, splitting the text into sections by detecting separators, and preparing them for looping.

Workflow Structure (13 nodes)
100%
Manual Trigger
When clicking ‘Test workflow’
Langchain.agent
AI Agent - Prepare Context
Google Drive
Get Document From Google Drive
Set
Concatenate the context and section text
Extract From File
Extract Text Data From Google Document
Code
Split Document Text Into Sections
Split Out
Prepare Sections For Looping
Split In Batches
Loop Over Items
Langchain.lm Chat Open Router
OpenRouter Chat Model
Langchain.embeddings Google Gemini
Embeddings Google Gemini
Langchain.vector Store Pinecone
Pinecone Vector Store
Langchain.text Splitter Recursive Character Text Splitter
Recursive Character Text Splitter
Langchain.document Default Data Loader
Default Data Loader
Node Types:
trigger
logic
default
action
code
transform
Requires credentials

Prerequisites

Required Credentials (4)

Google Drive

Used by: Get Document From Google Drive

Docs

Google Palm

Used by: Embeddings Google Gemini

Docs

Open Router

Used by: OpenRouter Chat Model

Docs

Pinecone

Used by: Pinecone Vector Store

Docs

Multiple services required

This workflow needs 4 different credentials. Make sure you have accounts for all services before importing.

Complexity

Advanced

Expert level. Custom code, complex logic, many integrations.

Setup time: ~55 min
Score: 73/100
Custom Code
Loops

When to Use This Workflow

Real-time Response

React instantly when events happen - new orders, form submissions, or API calls.

Zero delay between trigger and action for time-sensitive workflows.

Time Savings

Replace repetitive manual tasks with reliable automation.

Reclaim hours every week for higher-value work.

Error Reduction

Eliminate human error from routine processes with consistent automation.

Improve accuracy and reliability across your workflows.

workflow.json
{
  "id": "VY4WBXuNDPxmOO5e",
  "meta": {
    "instanceId": "d16fb7d4b3eb9b9d4ad2ee6a7fbae593d73e9715e51f583c2a0e9acd1781c08e",
    "templateCredsSetupCompleted": true
  },
  "name": "RAG:Context-Aware Chunking | Google Drive to Pinecone via OpenRouter & Gemini",
  "tags": [
    {
      "id": "XZIQK6NdzGvgbZFd",
      "name": "Sell",
      "createdAt": "2025-01-15T12:28:48.424Z",
      "updatedAt": "2025-01-15T12:28:48.424Z"
    }
  ],
  "nodes": [
    {
      "id": "7abbfa6e-4b17-4656-9b82-377b1bacf539",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
...

Workflow Details

Nodes
17
Trigger
Manual
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

RAG Workflow For Company Documents stored in Google Drive

Chat with company documents

Vectorstorepinecone
Embeddingsgooglegemini
Documentdefaultdataloader
Textsplitterrecursivecharactertextsplitter
18 nodesEvent
Curated

RAG Workflow For Stock Earnings Report Analysis

Set up steps 1. Google Cloud Project & Vertex AI API: Create a Google Cloud project. Enable the Vertex AI API for your...

Vectorstorepinecone
Embeddingsgooglegemini
Documentdefaultdataloader
Textsplitterrecursivecharactertextsplitter
18 nodesManual
Curated

Chat with GitHub OpenAPI Specification using RAG (Pinecone and OpenAI)

Indexing content in the vector database This part of the workflow is responsible for extracting content, generating embe...

Http-request
Vectorstorepinecone
Documentdefaultdataloader
Textsplitterrecursivecharactertextsplitter
17 nodesEvent
Curated

Advanced AI Demo (Presented at AI Developers #14 meetup)

![h](https://i.postimg.cc/9XLvL5dL/slide-sf-talk.pngfull-width)

Slack
Textsplitterrecursivecharactertextsplitter
Embeddingsopenai
Documentdefaultdataloader
39 nodesEvent
Curated

API Schema Extractor

Stage 1 - Research for API Documentation - Fetch a list of services pending research from Database (Google Sheet) - Uses...

Http-request
Textsplitterrecursivecharactertextsplitter
Documentdefaultdataloader
Executeworkflow
88 nodesEvent
Curated

Ask questions about a PDF using AI

Load data into database Fetch file from Google Drive, split it into chunks and insert into Pinecone index

Google-drive
Textsplitterrecursivecharactertextsplitter
Embeddingsopenai
Documentdefaultdataloader
16 nodesEvent
Curated