Automate your RAG system updates. This n8n workflow watches Google Drive changes, extracts text, generates OpenAI embeddings, and updates your Supabase vector database instantly.
Download this n8n workflow template and start using it instantly.
Users maintaining an AI-powered RAG system.
Developers seeking robust n8n templates for knowledge base synchronization.
Businesses needing automated, real-time updates for their internal documentation chatbots.
Anyone utilizing Supabase as a vector store with Google Drive as the source of truth.
Maintaining a Retrieval-Augmented Generation (RAG) system requires ensuring your knowledge base is always up-to-date. This sophisticated n8n workflow solves the problem of manual synchronization by automatically reacting to file modifications in a designated Google Drive folder. When a file is updated, the n8n workflow cleans out the old vectors from your Supabase vector database, processes the new document content (handling various formats like PDF, Excel, and Google Docs), calculates a new version number using an OpenAI n8n node, splits the text into optimal chunks, generates fresh embeddings, and inserts the data back into Supabase. This guarantees your RAG chatbot or application uses the latest available information, making this a crucial piece of the n8n automation pipeline for high-integrity AI services.
Set File ID n8n node. A conditional If check may filter recent file creations before proceeding.Delete Old Doc Rows Supabase n8n node removes all existing vector embeddings in the documents table associated with the updated file ID, ensuring clean data management.Set Version) is used after a Limit n8n node to automatically calculate and increment the document's version number (e.g., from v1 to v2).Switch n8n node routes the data based on the file type (PDF, Google Doc, Excel, or proprietary Word formats). Windows document files are converted into Google Docs format via an HTTP Request n8n node before processing.Extract from File n8n node for PDFs and text. Extracted Excel data is aggregated and concatenated using the Summarize n8n node.Recursive Character Text Splitter to create optimal chunks. The Enhanced Default Data Loader n8n node attaches critical metadata, including the file ID, new version number, and timestamps, to each chunk.Embeddings n8n node generates vector representations using the specified model. Finally, the Insert into Supabase Vectorstore n8n node inserts these high-quality, up-to-date document chunks into the designated Supabase vector table, completing this powerful n8n workflow.File Updated n8n trigger, Download File n8n node, and conversion nodes. Ensure read/write access to the monitored folder.Delete Old Doc Rows and Insert into Supabase Vectorstore n8n node. This needs appropriate database access.Set Version and Embeddings OpenAI n8n node for calculation and vector generation.File Updated n8n trigger to select the specific Google Drive folder you wish to monitor.documents) is correctly configured and indexed for vector search. File Updated (Google Drive n8n trigger): The starting point. This n8n trigger monitors a specific folder for file modification events.
Set File ID (Set n8n node): A utility n8n node that extracts the crucial fileid and filetype from the incoming trigger data.
Delete Old Doc Rows (Supabase n8n node): Executes a database operation to delete previous versions of the document from the documents vector table using the file ID as a filter.
Set Version (OpenAI n8n node): Utilizes GPT-4o-mini to calculate the next sequential version number for robust document tracking metadata.
Switch (Switch n8n node): Manages flow control, routing the data path based on the document's MIME type to ensure the appropriate extraction method is selected (PDF, Excel, etc.).
Recursive Character Text Splitter (LangChain n8n node): An essential RAG component that breaks down large documents into smaller, manageable chunks (configured here at 2000 characters with 200 overlap).
Enhanced Default Data Loader (LangChain n8n node): Structures the resulting document chunks and applies rich, custom metadata gathered earlier in the n8n workflow.
Embeddings OpenAI (LangChain n8n node): Generates high-quality vector embeddings for the text chunks, necessary for efficient similarity search.
Implement a robust K-Nearest Neighbors (KNN) image classifier using this advanced n8n workflow. Integrate Voyage AI multimodal embeddings and Qdrant vector storage to automate visual classification tasks.

Use this comprehensive n8n workflow to automatically sync Jotform webinar registrations to KlickTipp, handling data cleanup, date conversion, URL validation, and dynamic tag creation. A perfect n8n template for marketing automation.

Automate your JotForm sales pipeline using this advanced n8n workflow. Sync orders to Google Sheets, generate Zoho Invoices, and send immediate Telegram confirmations, managing Chat ID acquisition seamlessly.

Automate monitoring new mechanical keyboard Interest Checks and Group Buys from GeekHack forums. This n8n workflow uses RSS, custom scripting, and PostgreSQL for robust deduplication before sending rich, image-filled Discord notifications.









































