Automation library · Data collection

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.

LargeCalls a model: OpenAIRetrieval

34 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
0Loops or waits
4Services it connects to

The flow

Starts it 4Model 11Logic 8Service 11

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

  1. 1Manual Ingestion TriggerManual triggerStarts it
  2. 2Split Into ChunksText Splitter Recursive Character Text SplitterModel
  3. 3Generate EmbeddingsEmbeddings Open AiModel
  4. 4Question WebhookWebhookStarts it
  5. 5Generate Query EmbeddingEmbeddings Open AiModel
  6. 6Weekly Sunday 11AM TriggerSchedule triggerStarts it
  7. 7Split Into Chunks1Text Splitter Recursive Character Text SplitterModel
  8. 8Generate Embeddings1Embeddings Open AiModel
  9. 9List Knowledge Base DocsGoogle DriveService
  10. 10Load Document DataDocument Default Data LoaderModel
  11. 11Store Embeddings in PineconeVector Store PineconeModel
  12. 12Extract Question & UserCodeLogic
  13. 13Search Knowledge BaseVector Store PineconeModel
  14. 14List Knowledge Base Docs1Google DriveService
  15. 15Load Document Data1Document Default Data LoaderModel
  16. 16Re-ingest into PineconeVector Store PineconeModel
  17. 17Download Doc as TextGoogle DriveService
  18. 18Log to Document RegistryGoogle SheetsService
  19. 19Build RAG PromptCodeLogic
  20. 20Read Document RegistryGoogle SheetsService
  21. 21Update Document RegistryGoogle SheetsService
  22. 22Notify Ingestion CompleteGmailService
  23. 23Answer GeneratorOpen AiModel
  24. 24Detect New or Updated DocsCodeLogic
  25. 25Build KB Digest EmailCodeLogic
  26. 26Parse AI AnswerCodeLogic
  27. 27IF New Docs FoundIfLogic
  28. 28Send Weekly KB DigestGmailService
  29. 29Log Q&A to SheetsGoogle SheetsService
  30. 30Prepare Docs for Re-ingestionCodeLogic
  31. 31Build KB Digest Email1CodeLogic
  32. 32Send Answer ResponseRespond To WebhookStarts it
  33. 33Download Updated DocsGoogle DriveService
  34. 34Send Weekly KB Digest1GmailService

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.