# Sync Google Drive documents to Pinecone RAG with Gemini: n8n workflow

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

Source: https://millionrounds.com/workflow/sync-google-drive-documents-to-pinecone-rag-with-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

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

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fsync-google-drive-documents-to-pinecone-rag-with-gemini)

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

**3** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 1 Model 3 Logic 11 Service 17

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

- 1 **Generate Embeddings with Gemini** Embeddings Google Gemini *Model*
- 2 **Scheduled Trigger Every Minute** Schedule trigger *Starts it*
- 3 **Load and Chunk Default Data** Document Default Data Loader *Model*
- 4 **Store Vectors in Pinecone** Vector Store Pinecone *Model*
- 5 **List Files from Google Drive** Google Drive *Service*
- 6 **Read Log for Overlap Check** Google Sheets *Service*
- 7 **Merge by Missing or Overlap** Merge *Logic*
- 8 **Check if File New or Updated** If *Logic*
- 9 **Split by ID** Split Out *Logic*
- 10 **Check if File Deleted** If *Logic*
- 11 **Post to VectorDB API - Remove File** Http Request *Service*
- 12 **Split by File ID** Split Out *Logic*
- 13 **Download from Google Drive** Google Drive *Service*
- 14 **Post to VectorDB API for Deletion** Http Request *Service*
- 15 **Delete Log Rows in Sheets** Google Sheets *Service*
- 16 **Route by File Type** Switch *Logic*
- 17 **Extract Text from PDF** Extract From File *Service*
- 18 **Extract Data from XLSX** Extract From File *Service*
- 19 **Extract from Specialized File** Extract From File *Service*
- 20 **Extract from General File** Extract From File *Service*
- 21 **Set Fields for PDF Data** Set *Logic*
- 22 **Convert Data to File Format** Convert To File *Service*
- 23 **Set Fields for Specialized File** Set *Logic*
- 24 **Set Fields for General File** Set *Logic*
- 25 **Append or Update Log in Sheets** Google Sheets *Service*
- 26 **Extract Data Post-Conversion** Extract From File *Service*
- 27 **Read Log Rows in Sheets** Google Sheets *Service*
- 28 **Retrieve Files for Log Update** Google Drive *Service*
- 29 **Set Fields for Converted Data** Set *Logic*
- 30 **Combine Missing or Overlap Files** Merge *Logic*
- 31 **Remove File via VectorDB API** Http Request *Service*
- 32 **Remove Rows in Log Sheets** Google Sheets *Service*

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

## 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%2Fsync-google-drive-documents-to-pinecone-rag-with-gemini)
- **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.

[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 documents and files, with the same services where possible, closest in size first.

- [**AI knowledge assistant with Gemini and OpenAI** 32 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/ai-knowledge-assistant-with-gemini-and-openai)
- [**Document-based RAG chat assistant with Google Drive** 32 steps · calls a model · Google Drive, Supabase](https://millionrounds.com/workflow/document-based-rag-chat-assistant-with-google-drive)
- [**PDF RAG agent with Telegram** 32 steps · calls a model · Google Drive, Telegram](https://millionrounds.com/workflow/pdf-rag-agent-with-telegram)
- [**Extract and classify legal documents with Claude** 31 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/extract-and-classify-legal-documents-with-claude)
- [**Send, chase, and e-signature with Airtable and TurboDocx** 33 steps · Airtable, Gmail](https://millionrounds.com/workflow/send-chase-and-e-signature-with-airtable-and-turbodocx)
- [**Chat with Google Drive and Pinecone** 30 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/chat-with-google-drive-and-pinecone)
