Process documents with recursive chunking using Google Drive, OpenAI & Gemini RAG
Ready for 3.0What this workflow does
This AI workflow has 23 nodes and runs on Google Drive events (file created) (plus 1 other trigger). Along the way it connects Google Drive, OpenAI Chat Model, Embeddings OpenAI and Supabase Vector Store and 3 more. It also calls etvncxazsxflierkgyge.supabase.co over HTTP.
How it runs
Trigger: On Google Drive events (file created) (plus 1 other trigger).
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- OpenAI: analyze (image)
- File info (Edit Fields (Set)): sets 4 fields: File_id, File_Type, File_url…
- AI Agent: runs an AI agent, with model: Google Gemini Chat Model; 1 tool (SupaBase Query)
- Google Drive: download
- Switch: routes items into 2 branches
- Extract from PDF (Extract from File): extracts data from a file (pdf)
- Extract from TEXT (Extract from File): extracts data from a file (text)
- PDF to DATA (Edit Fields (Set)): sets or maps fields
- Document Data (Edit Fields (Set)): sets or maps fields
…plus 5 more steps. See the full node list below.
Services it uses
HTTP calls to: etvncxazsxflierkgyge.supabase.co
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (20)
- Google Drive Trigger
n8n-nodes-base.googleDriveTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Drive
n8n-nodes-base.googleDrive - Switch
n8n-nodes-base.switch - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Summarize
n8n-nodes-base.summarize - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter - AI Agent
@n8n/n8n-nodes-langchain.agent - Manual Trigger
n8n-nodes-base.manualTrigger - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - OpenAI
@n8n/n8n-nodes-langchain.openAi - Edit Fields (Set)
n8n-nodes-base.set - Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - Split Out
n8n-nodes-base.splitOut - Http Request Tool
n8n-nodes-base.httpRequestTool
From the author
1. Document Ingestion & Processing Google Drive Trigger monitors for new files → Loop Over Items processes each file → File Info extracts metadata → Google Drive downloads the actual content → Switch routes to appropriate extractors (PDF or TEXT) based on…