# Process documents with Google Drive and OpenAI: n8n workflow

> Started by an event in a connected app, and works across Google Drive and Supabase vectors.

Source: https://millionrounds.com/workflow/process-documents-with-google-drive-and-openai (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)

# Process documents with Google Drive and OpenAI

Started by an event in a connected app, and works across Google Drive and Supabase vectors. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 23 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fprocess-documents-with-google-drive-and-openai)

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

**1** Branch: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 2 Model 9 Logic 7 Service 5

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

- 1 **Google Drive Trigger** Google Drive trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 4 **Character Text Splitter** Text Splitter Character Text Splitter *Model*
- 5 **When clicking ‘Execute workflow’** Manual trigger *Starts it*
- 6 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 7 **SupaBase Query** Http Request Tool *Service*
- 8 **Loop Over Items** Split In Batches *Logic*
- 9 **Basic LLM Chain** Chain Llm *Model*
- 10 **Supabase Vector Store** Vector Store Supabase *Model*
- 11 **Default Data Loader** Document Default Data Loader *Model*
- 12 **OpenAI** Open Ai *Model*
- 13 **AI Agent** Agent *Model*
- 14 **File info** Set *Logic*
- 15 **Summarize** Summarize *Service*
- 16 **Google Drive** Google Drive *Service*
- 17 **Switch** Switch *Logic*
- 18 **Extract from PDF** Extract From File *Service*
- 19 **Extract from TEXT** Extract From File *Service*
- 20 **PDF to DATA** Set *Logic*
- 21 **Document Data** Set *Logic*
- 22 **Recursive Splitter** Code *Logic*
- 23 **Chunk Splitting** Split Out *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 23, with 1 branch, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Supabase vectors
- **Model:** Gemini, 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 Google Drive and Supabase vectors accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

Yes. It calls Gemini and 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 23 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 23 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%2Fprocess-documents-with-google-drive-and-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.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Chat with Supabase** 23 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/chat-with-supabase)
- [**Extract timesheet data with Mistral and Gmail** 23 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/extract-timesheet-data-with-mistral-and-gmail)
- [**Process documents & build semantic search with OpenAI** 23 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/process-documents-and-build-semantic-search-with-openai)
- [**Save & organize LINE message files in Google Drive with Sheets** 23 steps · Google Drive, Google Sheets](https://millionrounds.com/workflow/save-and-organize-line-message-files-in-google-drive-with-sh)
- [**AI agent to chat with OpenAI and Supabase** 22 steps · calls a model · Supabase, Supabase vectors](https://millionrounds.com/workflow/ai-agent-to-chat-with-openai-and-supabase)
- [**Automate document ingestion & RAG system with Google Drive** 24 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/automate-document-ingestion-and-rag-system-with-google-drive)
