Build a RAG knowledge base from PDFs with Gemini, Supabase and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 27 nodes and runs on a schedule (every hour) (plus 1 other trigger). Along the way it connects Google Sheets, Supabase Vector Store, Google Drive and Embeddings Google Gemini and 1 more.
How it runs
Trigger: On a schedule (every hour) (plus 1 other trigger).
- Get row(s) in sheet (Google Sheets): uses Google Sheets
- SerajUAE RAG Agent (AI Agent): runs an AI agent, with model: Gemini Flash (RAG); 1 tool (SerajUAE Knowledge Base)
- Filter: keeps only the items that match a condition
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- All Done (Edit Fields (Set)): sets or maps fields
- Seraj or Drive? (If): checks a condition and branches into true / false
- Fetch File Page (HTTP Request): calls an HTTP API
- Extract Drive File ID + Title (Code): runs custom JavaScript code
- Extract PDF URL + Title (Code): runs custom JavaScript code
- Download PDF (Drive) (Google Drive): download
…plus 9 more steps. See the full node list below.
Services it uses
Other Google Gemini + Google Sheets templates (819) · Other Google Drive + Google Sheets templates (720) · Other Google Gemini + Google Drive templates (272)
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (18)
- Extract from File
n8n-nodes-base.extractFromFile - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Filter
n8n-nodes-base.filter - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Drive
n8n-nodes-base.googleDrive - Wait
n8n-nodes-base.wait - Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini - Schedule Trigger
n8n-nodes-base.scheduleTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger
From the author
Quick Overview This workflow ingests educational PDF URLs from Google Sheets, extracts and chunks their text, generates embeddings with Google Gemini, and stores them in a Supabase pgvector table for retrieval, while also exposing a public chat webhook that…