Create a powerful RAG vector database. This n8n workflow ingests Google Drive documents, uses Gemini for embeddings, and stores results in Supabase. Essential n8n templates for AI data pipelines.
Download this n8n workflow template and start using it instantly.
This specialized n8n workflow provides a complete, scalable solution for transforming unstructured document data from Google Drive into a structured vector database suitable for Retrieval-Augmented Generation (RAG). By automating the crucial steps—document loading, text extraction, embedding generation (via Google Gemini), and final storage in Supabase (Postgres with pgvector)—this n8n automation eliminates manual data preparation. This sophisticated n8n template demonstrates advanced integration between cloud services (Drive), AI providers (Gemini), and managed databases (Supabase), providing a ready-to-use n8n workflow for building high-quality AI knowledge bases quickly and efficiently.
The entire process is managed efficiently within a single n8n workflow structure:
When Executed by Another Workflow n8n trigger node, which accepts a Google Drive folder link as input. A subsequent Code in JavaScript n8n node then parses this URL using regex to reliably extract the necessary folder ID for Google Drive API interactions.Execute a SQL query n8n node connects to Supabase (Postgres) to initialize the vector store environment. This step is critical: it drops any existing documents table to ensure a clean slate, installs the pgvector extension, and defines the crucial match_documents SQL function used for vector similarity search.Google Drive n8n node searches for and retrieves a list of all files found within the specified Drive folder using the extracted folder ID. The Loop Over Items n8n node ensures that each document is processed sequentially.Google Drive n8n node downloads the file content. For document types (like Google Docs), it uses file conversion options to extract the content as plain text. The Default Data Loader n8n node then standardizes this content for embedding.Insert into Supabase Vectorstore n8n node. This node utilizes the globally connected Embeddings Google Gemini n8n node to convert the document text into 768-dimensional vectors. It then handles the efficient bulk insertion of the document content, metadata, and the new embedding vectors directly into the designated Supabase documents table, completing the knowledge ingestion n8n workflow.To deploy and run this powerful n8n workflow, you need to configure the following credentials:
Search files and folders and Download File n8n node operations. Ensure the associated account has read access to the target folder.Execute a SQL query n8n node, pointing it to your Supabase project connection string and database details.Embeddings Google Gemini4 n8n node. This is vital for generating the high-quality vector embeddings.DriveFolderlink URL. When Executed by Another Workflow (n8n trigger): Serves as the primary execution trigger, expecting a JSON input payload containing the DriveFolderlink to the source material.
Execute a SQL query (Postgres n8n node): Responsible for the critical database provisioning step. It connects to Supabase, drops the existing RAG table (for idempotency), installs pgvector, and defines the necessary semantic similarity search function (match_documents).
Search files and folders (Google Drive n8n node): Retrieves the comprehensive list of all source documents within the Google Drive folder that require embedding.
Download File (Google Drive n8n node): Downloads the content of each file sequentially, utilizing built-in options to convert proprietary Google document formats (like Google Docs) into extractable plain text for processing.
Embeddings Google Gemini4 (LangChain n8n node): Provides the embedding service backbone for this n8n workflow, generating 768-dimension vectors for RAG using the Google Gemini model. This connection enables the vectorization step.
Insert into Supabase Vectorstore (LangChain n8n node): The final action n8n node. It orchestrates the entire RAG pipeline, using the document loader and the Gemini embedding model to calculate the vectors and store the document chunks and embeddings into the documents table in Supabase. This specific n8n node handles the complex vector storage logic seamlessly.
Use this comprehensive n8n workflow to automatically create QuickBooks Online customers and sales receipts immediately following a successful Stripe payment. Ensure accurate financial synchronization.

Use this advanced n8n workflow to automate finding, qualifying, and enriching leads from LinkedIn Sales Navigator. Leverage OpenAI to score companies and generate personalized cold call scripts.

Use this comprehensive n8n workflow to automatically generate structured, professional project summaries from raw meeting transcripts via GPT-4 and securely save them in Google Docs. Leverage powerful n8n templates for AI integration.

Automate professional AI image generation using the CyberRealistic Pony v36 model via Replicate. This robust n8n workflow template features an intelligent status polling loop for reliable results.

Automate daily company data digests using an n8n workflow, Super Assistant AI, and Slack. Use this n8n template for scheduled internal reporting and progress tracking.

Al Automation Expert || Al Agents || n8n || Python || LangChain || Helping businesses scale revenue and reduce costs with Al driven automation .







































