Document Ingestion, RAG Chatbot, and Qdrant Vector Storage - n8n Workflow

Use this comprehensive n8n workflow to automate document processing. It integrates Google Drive or a file upload form with OpenAI embeddings and Qdrant, forming a powerful RAG knowledge base queryable via a Gemini-powered chatbot. This n8n template enhances document searchability.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical teams building scalable knowledge bases.

  • Users needing to automate document ingestion into a vector database.

  • Developers creating Retrieval-Augmented Generation (RAG) applications using n8n.

  • Organizations requiring high-performance semantic search capabilities through an n8n node.

Overview

This sophisticated n8n workflow provides a complete solution for continuous document ingestion and semantic search capability. It addresses the common challenge of converting unstructured files (like PDFs and documents) into structured, queryable vectors in Qdrant. The n8n automation includes two primary ingestion methods: automated monitoring of a Google Drive folder or manual file uploads via a web form. After ingestion, the data is chunked, embedded using OpenAI's powerful embedding model, and indexed in Qdrant. Crucially, the n8n template includes a warning and a functional step to delete processed files from Google Drive to maintain a clean source folder, making this a complete 'process and purge' system. Finally, the third path of this n8n workflow demonstrates a RAG chatbot endpoint using Google Gemini and the newly populated Qdrant vector store, showcasing the power of combining modern AI tools within a single n8n execution flow.

How it Works

This n8n workflow operates across three parallel processing paths.

Path 1: Google Drive Ingestion (Auto or Manual Trigger)


  1. The flow starts with either the New File In Google Drive Folder n8n trigger or the Manually Trigger Workflow n8n node.

  2. The List Files in Google Drive Folder node fetches files (one at a time due to batching logic).

  3. Download File retrieves the document, converting it to PDF format for consistent processing.

  4. The file passes through the Data Loader and Recursive Character Text Splitter (chunk size 1500, overlap 250) to break the document into digestible parts.

  5. Embeddings OpenAI creates vector representations using the text-embedding-3-large model.

  6. Insert to Qdrant stores these vectors in the specified collection.

  7. A critical step: Delete File removes the source file from Google Drive. Using this n8n node ensures files are processed only once.

Path 2: File Upload Form Ingestion


  1. The File Upload Form n8n trigger captures uploaded files.

  2. A Code n8n node (Split Form Files) handles multi-file uploads by separating them into individual items.

  3. Split Form Batches processes each file sequentially.

  4. The files are chunked, embedded via a dedicated Embeddings OpenAI 1 n8n node, and inserted into Qdrant using Insert to Qdrant 1.

Path 3: RAG Chatbot Endpoint


  1. The When chat message received n8n trigger activates the chatbot logic.

  2. The AI Agent uses Simple Memory to maintain context.

  3. It leverages the Google Gemini Chat Model for responses.

  4. The agent uses the Qdrant Vector Store as a tool, querying the indexed knowledge base (with Embeddings OpenAI 2) to retrieve relevant documents before formulating an answer. This powerful n8n automation allows for immediate querying of newly processed documents.

Installation Guide

To use this n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Drive Setup: Configure the Google Drive OAuth2 API credential with permissions to read, download, and delete files in the specified folder. Update the folder ID in both the New File In Google Drive Folder trigger and the List Files in Google Drive Folder n8n node.

  3. OpenAI Credentials: Set up the OpenAI API Key credential for the three Embeddings OpenAI nodes. These are necessary to generate high-quality vector embeddings.

  4. Qdrant Connection: Configure the Qdrant API credential, providing the API key and endpoint for your cloud Qdrant instance. Ensure the collection name ('fairwork' in this n8n template) is correct across all Qdrant nodes.

  5. Gemini Setup (Optional for Chatbot): Configure the Google Gemini (PaLM) Api credential if you intend to use the RAG chatbot feature.

  6. Activate: Save the n8n workflow and set it to active.

Node Details


  • New File In Google Drive Folder (n8n Trigger): Automatically starts the processing pipeline whenever a new file is detected in the monitored Google Drive folder.

  • List Files in Google Drive Folder (n8n Node): Used alongside the manual trigger. It is configured to limit results to one file at a time, ensuring sequential processing and allowing for the file deletion step.

  • Download File (n8n Node): Downloads the file and converts formats (like Docs, Sheets) to PDF binary data for uniform downstream processing.

  • Embeddings OpenAI (n8n Node): A crucial LangChain n8n node that converts text chunks into high-dimensional vectors using the text-embedding-3-large model.

  • Recursive Character Text Splitter (n8n Node): Breaks large documents into smaller chunks (1500 characters with 250 character overlap) to optimize vector search precision.

  • Insert to Qdrant (n8n Node): Stores the generated vectors and associated text metadata into the Qdrant vector database collection (named 'fairwork' in this n8n workflow).

  • Delete File (n8n Node): WARNING: This node permanently removes the processed file from Google Drive after successful Qdrant ingestion.

  • File Upload Form (n8n Trigger): Provides a public webhook endpoint to allow manual file submission, offering a flexible input path to the n8n workflow.

  • AI Agent (n8n Node): Orchestrates the RAG process, utilizing the Google Gemini Chat Model and the Qdrant Vector Store tool to intelligently answer user questions based on the stored document data.

Related n8n Workflows

Free

Nodes: 16 Nodes
Updated: December 26 2025
View all
Created by

I'm passionate about combining traditional web development with AI and automation to create impactful online solutions. As Founder & CEO of Jezweb, an award-winning Newcastle, Australia agency, I lead a 30+ person team delivering high-quality web design, development, and hosting services to over 3000 clients.

Featured*