Automation library · Documents and files

Sync Google Drive documents to Pinecone RAG with Gemini

Started by a clock, and works across Google Drive, Google Sheets and Pinecone. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 32 steps, 3 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: GeminiRetrieval

32 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 1Model 3Logic 11Service 17

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

  1. 1Generate Embeddings with GeminiEmbeddings Google GeminiModel
  2. 2Scheduled Trigger Every MinuteSchedule triggerStarts it
  3. 3Load and Chunk Default DataDocument Default Data LoaderModel
  4. 4Store Vectors in PineconeVector Store PineconeModel
  5. 5List Files from Google DriveGoogle DriveService
  6. 6Read Log for Overlap CheckGoogle SheetsService
  7. 7Merge by Missing or OverlapMergeLogic
  8. 8Check if File New or UpdatedIfLogic
  9. 9Split by IDSplit OutLogic
  10. 10Check if File DeletedIfLogic
  11. 11Post to VectorDB API - Remove FileHttp RequestService
  12. 12Split by File IDSplit OutLogic
  13. 13Download from Google DriveGoogle DriveService
  14. 14Post to VectorDB API for DeletionHttp RequestService
  15. 15Delete Log Rows in SheetsGoogle SheetsService
  16. 16Route by File TypeSwitchLogic
  17. 17Extract Text from PDFExtract From FileService
  18. 18Extract Data from XLSXExtract From FileService
  19. 19Extract from Specialized FileExtract From FileService
  20. 20Extract from General FileExtract From FileService
  21. 21Set Fields for PDF DataSetLogic
  22. 22Convert Data to File FormatConvert To FileService
  23. 23Set Fields for Specialized FileSetLogic
  24. 24Set Fields for General FileSetLogic
  25. 25Append or Update Log in SheetsGoogle SheetsService
  26. 26Extract Data Post-ConversionExtract From FileService
  27. 27Read Log Rows in SheetsGoogle SheetsService
  28. 28Retrieve Files for Log UpdateGoogle DriveService
  29. 29Set Fields for Converted DataSetLogic
  30. 30Combine Missing or Overlap FilesMergeLogic
  31. 31Remove File via VectorDB APIHttp RequestService
  32. 32Remove Rows in Log SheetsGoogle SheetsService

How it's built

Starts on
A clock
Steps
32, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Google Sheets, Pinecone
Model
Gemini
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 Google Drive, Google Sheets and Pinecone accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls Gemini. 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 32 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 32 steps before you point it at anything that matters.