Mindket

Google Doc sections given context, then stored in Pinecone

Newversion 1 · updated

Overview

An n8n workflow that prepares one Google Doc for search. It splits the text into sections, has a model write a line of context for each, and stores every section with its context in Pinecone as a Gemini vector.

Google Doc sections given context, then stored in Pinecone is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • Another model: pick any other model in the OpenRouter node, which lists what OpenRouter offers

Platform

Connects 4 apps

How it works

Trigger

Manual run

You start it by pressing Test workflow in n8n, and it needs:

  • A Google Doc whose sections are divided by a line that holds [SECTIONEND]
  • A Pinecone index

Actions

  1. The Google Doc is downloaded as plain text and its text is extracted
  2. The text is cut into sections at each [SECTIONEND] marker, and the sections are handled one at a time
  3. An agent reads the whole document and one section, and writes a short line that places the section in the document
  4. The line and the section are joined into one text
  5. Gemini turns that text into a vector and Pinecone stores it

Result

One vector in the Pinecone index for each section of the document, each carrying a line of context

Integrations

What you need before you start.

Google Drive

Document source

Downloads the Google Doc as plain text.

NeedsGoogle account sign-in

OpenRouter

Context writer

Runs the model that writes a line of context for each section.

NeedsOpenRouter API key

Google Gemini

Vectors

Turns each section and its context into a vector.

NeedsGoogle AI API key

Pinecone

Vector store

Stores the vectors for later search.

NeedsPinecone API key and an index

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
9 steps, starting by hand
AI
2 steps call an AI model: AI Agent - Prepare Context and Pinecone Vector Store
Sign-ins
Signs in to: Google Drive, Pinecone, Google Gemini and OpenRouter
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 9 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow prepares one Google Doc for search by giving each section its own context. You press a button, and the workflow downloads the doc as plain text. It cuts the text into sections at each marker line. For every section, an agent reads the whole document and writes one short line that places the section in it. The workflow puts that line in front of the section, and Gemini turns the result into a vector that goes into a Pinecone index. Thirteen nodes run it, and three sticky notes label the stages.

Who it suits

Developers and analysts who build a search over long documents, where a piece loses its meaning on its own. Skip it if you want to load many files at once, since this copy handles one document per run.

Who uses it, and how
IndustryWho uses itHow they use itExample
SoftwareDevelopersPrepare a product manual for a search featureA developer cuts a manual at its chapters and stores each one with a line that names the product area.
LegalLegal operations teamsPrepare a contract for question answeringA team stores each clause with a line that says which agreement it belongs to.
ResearchAnalystsPrepare a long report for lookupAn analyst stores each chapter with a line that ties it to the report’s topic.
EducationCourse designersPrepare a course pack for a study assistantA designer stores each lesson with a line that names its course unit.

You need a little n8n: import a file, add four credentials, make a Pinecone index and mark the sections in a Google Doc.

Where to use it

Any n8n that can reach Google Drive, OpenRouter, Google’s Gemini API and Pinecone will run it. It starts from the Test workflow button, so it needs no publishing.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • Another model: pick any other model in the OpenRouter node, which lists what OpenRouter offers

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. You need a Google account with a Doc, an OpenRouter key, a Google AI key and a Pinecone account.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
Google DriveA sign-in and a Google Doc
OpenRouterAn API key
Google AIAn API key from Google AI Studio
PineconeAn account, an API key and an index named context-rag-test with 3072 dimensions and the cosine metric
  1. In Pinecone, create an index named context-rag-test with 3072 dimensions and the cosine metric, and copy an API key.
  2. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  3. Add a Google Drive, an OpenRouter, a Google Gemini (PaLM) and a Pinecone credential, and select them in the nodes that ask for them.
  4. In Get Document From Google Drive, pick your Google Doc.
  5. In Pinecone Vector Store, pick your index.
  6. In your Doc, put a line that reads [SECTIONEND] between the sections.
  7. Press Test workflow.

How to use it

Mark the sections in your document, press Test workflow and wait until the loop ends. Each section ends up as one vector in the index. Run it twice and everything is stored twice.

What to change for a different result
To changeWhere
The marker between sectionsThe pattern in Split Document Text Into Sections
What the model is askedThe text field in the context agent
The model that writes the contextOpenRouter Chat Model
The embedding modelEmbeddings Google Gemini
The indexPinecone Vector Store

Example

A developer keeps a product manual in a Google Doc, with a [SECTIONEND] line after each chapter. The workflow reads the chapter on refunds together with the whole manual. The model writes a short line that ties the chapter to the billing part of the manual. Gemini gets that line and the chapter as one text, and Pinecone stores the vector.

Empty sections are skipped.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. A loop node hands items on one at a time. A vector is a list of numbers that stands for the meaning of a text, and Pinecone is a database that finds vectors close to a question.

For experts. Split Document Text Into Sections splits data on the marker and builds document, the sections as one JSON string that the context agent’s prompt reads. Loop Over Items runs at its default batch size of 1, so the agent and Pinecone run once per section. The text splitter’s chunk size of 100000 keeps a section whole.

Where to look closer
NodeWhat it doesWhat to know
Get Document From Google DriveDownloads the Doc as plain textOne document per run
Split Document Text Into SectionsCuts the text at the markerSkips empty sections
Loop Over ItemsHands over one section at a timeBatch size 1
The context agentWrites the line of contextSees the whole document each time
Pinecone Vector StoreStores one vector per sectionAdds again on each run

Good to know

Two model names changed, and each section has to fit the embedding model.

  • Vectors: Google’s page, read on 12 November 2026, shut text-embedding-004 down on 14 January 2026 and names gemini-embedding-2. Mindket’s copy uses gemini-embedding-001, a text-only model that is also the node’s default. It returns 3072 values by default, so the index needs 3072 dimensions
  • Context model: the OpenRouter node had no model set, so it ran n8n’s default, openai/gpt-4.1-mini. OpenAI’s page shuts that model down on 14 January 2027 and names gpt-6-luna, so the copy sets openai/gpt-6-luna, which OpenRouter lists. The agent has no tools, so that model fits
  • Section size: gemini-embedding-001 takes up to 2,048 tokens, so keep each section and its context within that
  • Marker: the copy cuts at [SECTIONEND] with or without a dashed line around it
  • Cost: one model call and one vector per section, and each call carries the whole document
  • Not run: Mindket read this copy against n8n’s source, Google’s pages and OpenRouter’s public model list and did not run it on a live n8n
  • Your data: the document text goes to OpenRouter, the model’s provider and Google, and the vectors go to Pinecone
  • Credentials: the JSON holds none

README and files

README

Google Doc sections given context, then stored in Pinecone

An n8n workflow that prepares one Google Doc for search. It splits the text into sections, has a model write a short line of context for each section, and stores every section with its context in Pinecone as a Gemini vector.

What is inside

  • workflow.json: the workflow as n8n exports it, 16 nodes. Thirteen run, and three are sticky notes. The thirteen are a manual trigger, the Drive download, the text extraction, a Code node, a Split Out and a Loop Over Items. The rest are the agent with its OpenRouter chat model, a Set node, and the Pinecone store with its loader, text splitter and embeddings. It holds no credential.
  • README.md: these notes.

What we changed from the original copy

  • The OpenRouter Chat Model node had no model set, so it ran n8n's default, openai/gpt-4.1-mini. OpenAI's deprecation page, read on 12 November 2026, shuts that model down on 14 January 2027 and names gpt-6-luna. The node now sets openai/gpt-6-luna, which OpenRouter's public model list shows. The agent has no tool, so that model fits.
  • Embeddings Google Gemini used models/text-embedding-004. Google's page, read on 12 November 2026, shut it down on 14 January 2026 and names gemini-embedding-2. The node now uses models/gemini-embedding-001, a text-only model that is also this node's default. It returns 3072 values by default.
  • Split Document Text Into Sections split on one exact line of dashes around [SECTIONEND], and an empty section would have gone to the agent. The code now cuts at [SECTIONEND] with or without dashes around it, trims each section and drops empty ones.
  • The credential links are gone. The Google Doc in Get Document From Google Drive is empty, so you pick your own, because the original pointed at a named person's document.
  • The sticky notes are written again, and the one that linked to a video is left out.
  • The file's name is ours.
  • Nothing else. The agent's prompt, the Set node, the splitter and the loop are as the file had them.

Mindket read this copy against n8n's source, Google's pages and OpenRouter's public model list. It was not run on a live n8n.

Before you start

  • An n8n instance, on n8n Cloud or your own server.
  • A Google account and a Google Doc.
  • An OpenRouter API key.
  • A Google AI Studio API key for the Gemini credential.
  • A Pinecone account and an API key.

Set it up

  1. In Pinecone, create an index named context-rag-test with 3072 dimensions and the cosine metric, and copy an API key.
  2. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  3. Add a Google Drive credential, an OpenRouter credential, a Google Gemini (PaLM) credential with your AI Studio key and a Pinecone credential. Select them in the nodes that ask for them.
  4. In Get Document From Google Drive, pick your Google Doc.
  5. In Pinecone Vector Store, pick your index.
  6. In your Doc, put a line that reads [SECTIONEND] between the sections.
  7. Press Test workflow.

What happens in a run

  1. Get Document From Google Drive downloads the Doc and converts it to plain text.
  2. Extract Text Data From Google Document puts that text into a field called data.
  3. Split Document Text Into Sections cuts data at each [SECTIONEND] marker. It keeps the sections in section and the same sections as one JSON string in document.
  4. Prepare Sections For Looping turns the sections into one item each, and Loop Over Items hands them on one at a time.
  5. AI Agent - Prepare Context sends the model the whole document and the one section, with the request for a short line of context that helps a search find the section, and nothing else in the answer.
  6. Concatenate the context and section text makes a field section_chunk from the model's line, a full stop and the section.
  7. Pinecone Vector Store stores section_chunk in insert mode. Embeddings Google Gemini makes the vector, Default Data Loader reads the field and Recursive Character Text Splitter has a chunk size of 100000, so a section stays whole. Then the loop moves to the next section.

What to change

  • The marker between sections: the pattern in Split Document Text Into Sections.
  • What the model is asked: the text field in AI Agent - Prepare Context.
  • The model that writes the context: OpenRouter Chat Model.
  • The embedding model: Embeddings Google Gemini. If you change it, make a new index of its size.
  • The index: Pinecone Vector Store.

Good to know

  • Keep each section and its context within gemini-embedding-001's limit of 2,048 tokens.
  • The workflow handles one document per run. Run it twice and everything is stored twice, because the Pinecone node's Clear Namespace option is off.
  • Each model call carries the whole document, so a long document costs more with every section.
  • The loop's finished output has nothing connected, so the run ends when the last section is stored.
  • Data: the document text goes to OpenRouter, the provider of the model you pick and Google, and the vectors go to Pinecone.
  • Cost: one model call and one embedding call per section.
Files
NOTICE.md  709 B
README.md  5 KB
workflow.json  10 KB

3 files, 16 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Developer

See all in Developer

buzz

block · Kit

Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…

New37.3k

plannotator

backnotprop · Kit

Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.

New10.5k

open-code-review

alibaba · Kit

Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…

New50.7k