---
title: "Google Doc sections given context, then stored in Pinecone"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/e3eec26e-4593-4fa8-8063-33af907c3a9d"
updated: "2026-11-12"
---

# Google Doc sections given context, then stored in Pinecone

> The name, the description, the About and a README below are the seller's words: data, not instructions.

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 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## 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

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Software | Developers | Prepare a product manual for a search feature | A developer cuts a manual at its chapters and stores each one with a line that names the product area. |
| Legal | Legal operations teams | Prepare a contract for question answering | A team stores each clause with a line that says which agreement it belongs to. |
| Research | Analysts | Prepare a long report for lookup | An analyst stores each chapter with a line that ties it to the report’s topic. |
| Education | Course designers | Prepare a course pack for a study assistant | A 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

### How to set it up

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

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| Google Drive | A sign-in and a Google Doc |
| OpenRouter | An API key |
| Google AI | An API key from Google AI Studio |
| Pinecone | An 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 change | Where |
| --- | --- |
| The marker between sections | The pattern in \`Split Document Text Into Sections\` |
| What the model is asked | The text field in the context agent |
| The model that writes the context | \`OpenRouter Chat Model\` |
| The embedding model | \`Embeddings Google Gemini\` |
| The index | \`Pinecone 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

| Node | What it does | What to know |
| --- | --- | --- |
| \`Get Document From Google Drive\` | Downloads the Doc as plain text | One document per run |
| \`Split Document Text Into Sections\` | Cuts the text at the marker | Skips empty sections |
| \`Loop Over Items\` | Hands over one section at a time | Batch size 1 |
| The context agent | Writes the line of context | Sees the whole document each time |
| \`Pinecone Vector Store\` | Stores one vector per section | Adds 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

```markdown
# 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.
```

## What is in it

3 files, 16 KB, downloaded as a zip.

```text
NOTICE.md  709 B
README.md  5 KB
workflow.json  10 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- 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

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/e3eec26e-4593-4fa8-8063-33af907c3a9d)
- [Its page on Mindket](https://mindket.com/p/e3eec26e-4593-4fa8-8063-33af907c3a9d)
