Index documents (PDF/TXT) from Supabase Storage into a vector database using this advanced n8n workflow. This automation enables real-time AI agents to answer complex queries based on your file content.
Download this n8n workflow template and start using it instantly.
Data Engineers or Developers needing automated RAG pipeline deployment.
Businesses using Supabase for document storage who require AI-powered search capabilities.
Users looking for advanced n8n templates integrating LangChain functionality with external databases.
n8n Automation Specialists setting up complex, two-part automated systems (indexing and querying).
Manually retrieving and analyzing specific information from large document repositories is time-consuming. This powerful n8n workflow solves this by creating a robust Retrieval-Augmented Generation (RAG) system using Supabase and OpenAI.
This single n8n workflow is divided into two main scenarios:
n8n node, and stores them in a Supabase vector store.This n8n workflow operates in two distinct, integrated stages:
When clicking ‘Test workflow’ manual n8n trigger. It first queries the Supabase files table to get a list of already indexed documents.n8n node retrieves a list of all files in the Supabase Storage bucket.Loop Over Items node processes each file. An If conditional node checks two criteria: 1) Is the file ID already present in the indexed list? 2) Is the file name not an .emptyFolderPlaceholder? Only new, valid files continue.Switch node routes the binary data based on the file extension (PDF or TXT/other).Extract Document PDF n8n node extracts the text content. All data streams merge together.Recursive Character Text Splitter breaks the large document text into manageable chunks. The Default Data Loader formats the data, and the Embeddings OpenAI n8n node generates high-quality vector embeddings (text-embedding-3-small).Insert into Supabase Vectorstore n8n node stores these vectors in the dedicated documents table, completing the indexing. Finally, a record of the processed file is added to the Supabase files table.When chat message received LangChain n8n trigger, listening for user input.AI Agent n8n node (using the OpenAI Chat Model1 as its brain) processes the user query.Vector Store Tool1.Vector Store Tool1 uses the Embeddings OpenAI2 node to vectorize the user query and searches the connected Supabase Vector Store for the 8 most relevant document chunks (Top K: 8).To deploy this expert-level n8n workflow, follow these setup steps:
Get All Files, Get All files, Download, Create File record2, and Insert into Supabase Vectorstore n8n nodes. Ensure your Supabase RLS policies allow for listing, downloading, and database insertion.Embeddings OpenAI n8n node with an OpenAI API key for vector generation.OpenAI Chat Model1 (Agent Brain), OpenAI Chat Model2 (Tool LLM), and Embeddings OpenAI2 (Tool Embeddings). Note that the example uses different keys for the chat components (OpenAi club, Test club key).Get All files and Download HTTP Request n8n nodes match your exact Supabase configuration. When clicking ‘Test workflow’ (n8n trigger): Initiates the file indexing process manually.
Get All Files / Create File record2 (Supabase node): Manages the internal database record of processed files (files table) to prevent duplicate processing.
Get All files / Download (HTTP Request n8n node): Handles interaction with the Supabase Storage API, listing files and downloading the binary content for processing. Requires custom Supabase URL configuration.
If (n8n node): Implements the core deduplication logic, skipping files that already exist in the database or are placeholder files.
Switch (n8n node): Directs the flow based on binary file extension, specifically routing PDFs to the extraction step.
Extract Document PDF (n8n node): Specialized tool used to parse text content out of PDF binary data.
Recursive Character Text Splitter (LangChain node): Breaks down large text documents into smaller, context-rich chunks (configured for 500 characters with 200 overlap).
Embeddings OpenAI (LangChain n8n node): Generates numerical vector representations (text-embedding-3-small) of the text chunks, ready for storage.
Insert into Supabase Vectorstore (LangChain n8n node): Connects the vectors to the Supabase database (documents table), completing the RAG indexing.
When chat message received (n8n trigger): The primary n8n trigger for the chat application, activating the AI Agent upon receiving user input.
AI Agent (LangChain n8n node): The core intelligence orchestrating the RAG retrieval and response generation, using an LLM and the knowledge_base tool.
Vector Store Tool1 (LangChain n8n node): Provides the agent with the ability to query the indexed knowledge base.
Deploy a robust Retrieval-Augmented Generation (RAG) system using this advanced n8n workflow. Index files from Supabase Storage and Google Drive, vectorize data with OpenAI, and power an AI chat agent using a Supabase vector store for contextual answers.

Deploy a powerful n8n workflow that serves as an AI tool for Customer.io. Enable AI Agents to manage users, track events, and analyze campaigns using this specialized n8n node setup.

Use this robust n8n workflow as an AI Agent tool server. It enables AI models to create, retrieve, update, and delete Google Contacts using a dedicated n8n node setup.

Use this advanced n8n workflow to automatically process meeting transcripts (via Fireflies), generate structured project tasks in Airtable, schedule follow-ups, and notify clients—all driven by an intelligent AI Agent.

I am a business analyst with a development background, dedicated to helping small businesses and entrepreneurs leverage cloud services for increased efficiency. My expertise lies in automating manual workflows, integrating data from multiple cloud service providers, creating insightful dashboards, and building custom CRM systems.







































