# Build a Google Drive internal knowledge base with OpenAI: n8n workflow

> Started by another system calling it, and works across Gmail, Google Drive, Google Sheets and Pinecone.

Source: https://millionrounds.com/workflow/build-a-google-drive-internal-knowledge-base-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Build a Google Drive internal knowledge base with OpenAI

Started by another system calling it, and works across Gmail, Google Drive, Google Sheets and Pinecone. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 34 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-google-drive-internal-knowledge-base-with-openai)

**34 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**0** Loops or waits

**4** Services it connects to

## The flow

Starts it 4 Model 11 Logic 8 Service 11

The steps in the order they run, from what starts it.

- 1 **Manual Ingestion Trigger** Manual trigger *Starts it*
- 2 **Split Into Chunks** Text Splitter Recursive Character Text Splitter *Model*
- 3 **Generate Embeddings** Embeddings Open Ai *Model*
- 4 **Question Webhook** Webhook *Starts it*
- 5 **Generate Query Embedding** Embeddings Open Ai *Model*
- 6 **Weekly Sunday 11AM Trigger** Schedule trigger *Starts it*
- 7 **Split Into Chunks1** Text Splitter Recursive Character Text Splitter *Model*
- 8 **Generate Embeddings1** Embeddings Open Ai *Model*
- 9 **List Knowledge Base Docs** Google Drive *Service*
- 10 **Load Document Data** Document Default Data Loader *Model*
- 11 **Store Embeddings in Pinecone** Vector Store Pinecone *Model*
- 12 **Extract Question & User** Code *Logic*
- 13 **Search Knowledge Base** Vector Store Pinecone *Model*
- 14 **List Knowledge Base Docs1** Google Drive *Service*
- 15 **Load Document Data1** Document Default Data Loader *Model*
- 16 **Re-ingest into Pinecone** Vector Store Pinecone *Model*
- 17 **Download Doc as Text** Google Drive *Service*
- 18 **Log to Document Registry** Google Sheets *Service*
- 19 **Build RAG Prompt** Code *Logic*
- 20 **Read Document Registry** Google Sheets *Service*
- 21 **Update Document Registry** Google Sheets *Service*
- 22 **Notify Ingestion Complete** Gmail *Service*
- 23 **Answer Generator** Open Ai *Model*
- 24 **Detect New or Updated Docs** Code *Logic*
- 25 **Build KB Digest Email** Code *Logic*
- 26 **Parse AI Answer** Code *Logic*
- 27 **IF New Docs Found** If *Logic*
- 28 **Send Weekly KB Digest** Gmail *Service*
- 29 **Log Q&A to Sheets** Google Sheets *Service*
- 30 **Prepare Docs for Re-ingestion** Code *Logic*
- 31 **Build KB Digest Email1** Code *Logic*
- 32 **Send Answer Response** Respond To Webhook *Starts it*
- 33 **Download Updated Docs** Google Drive *Service*
- 34 **Send Weekly KB Digest1** Gmail *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 34, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Drive, Google Sheets, Pinecone
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Drive, Google Sheets and Pinecone accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 34 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 34 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-google-drive-internal-knowledge-base-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Create a self-updating RAG chatbot with Google Drive** 34 steps · calls a model · Google Drive, Postgres](https://millionrounds.com/workflow/create-a-self-updating-rag-chatbot-with-google-drive)
- [**Generate FLUX image prompts from Google Sheets with RunComfy** 34 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/generate-flux-image-prompts-from-google-sheets-with-runcomfy)
- [**Automatic YouTube shorts generator with Google Cloud Storage** 34 steps · Google Cloud Storage, Google Sheets](https://millionrounds.com/workflow/automatic-youtube-shorts-generator-with-google-cloud-storage)
- [**24/7 shorts automation system for busy people with OpenRouter** 33 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/24-7-shorts-automation-system-for-busy-people-with-openroute)
- [**Manage finances, tasks, tweets and Gmail with OpenAI** 33 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/manage-finances-tasks-tweets-and-gmail-with-openai)
- [**Find and score event and speaker opportunities with Gumloop** 35 steps · Gmail, Postgres](https://millionrounds.com/workflow/find-and-score-event-and-speaker-opportunities-with-gumloop)
