Skip to main content

Build a RAG agent with n8n, Qdrant & OpenAI

Workflow preview

Workflow preview
100%
Build a RAG agent with n8n, Qdrant & OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This template helps you to create an intelligent document assistant that can answer questions from uploaded files. It shows a complete single vector RAG (Retrieval Augmented Generation) system that...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.googledrivetrigger, n8n-nodes-base.httprequest, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.vectorstoreqdrant, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.chattrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Yulia.

Original n8n.io source

1.1 Workflow description

Title
Build a RAG agent with n8n, Qdrant & OpenAI
Workflow name
Build a RAG agent with n8n, Qdrant & OpenAI

This template helps you to create an intelligent document assistant that can answer questions from uploaded files.

It shows a complete single-vector RAG (Retrieval-Augmented Generation) system that automatically processes documents, lets you chat with it in natural language and provides accurate, source-cited responses.

The workflow consists of two parts: the data loading pipeline and RAG AI Agent that answers your questions based on the uploaded documents.

To test tis workflow, you can use the following example files in a shared Google Drive folder.

💡 Find more information on creating RAG AI agents in n8n on the official page.

🔗Example files

The template uses the following example files in the Google Docs format:

  1. German Data Protection law: Bundesdatenschutzgesetz (BDSG)
  2. Computer Security Incident Handling Guide (NIST.SP.800-61r2)
  3. Berkshire Hathaway letter to shareholders from 2024

🚀How to get started

  1. Copy or import the template to your n8n instance.
  2. Create your Google Drive credentials via the Google Cloud Console and add them to the trigger node "Detect New Files". A detailed walk-through can be found in the n8n docs.
  3. Create a Qdrant API key and add it to the "Insert into Vector Store" node credentials. The API key will be displayed after you have logged into Qdrant and created a Cluster.
  4. Create or activate your OpenAI API key.

1️⃣ Import your data and store it in a vector database

✅ Upload files to Google Drive.

IMPORTANT: This template supports files in Google Docs format. New files will be downloaded in HTML format and converted to Markdown. This preserves the overall document structure and improves the quality of responses.

  • Open the shared Google Drive folder
  • Create a new folder on your Google Drive
  • Activate the workflow
  • Copy the files from the shared folder to your new folder

The webhook will catch the added files and you will see the execution in your "Executions" tab.

Note: If the webhook doesn’t see the files you copied, try adding them to your Google Drive folder from the opened shared files via the Move to feature.

✅ Chunk, embed, and store your data with a connected OpenAI embedding model and Qdrant vector store.

A Qdrant collection – vector storage for your data – will be created automatically after the n8n webhook has caught your data from Google Drive. You can name your collection in the "Insert into Vector Store" node.

2️⃣ Add retrieval capabilities and chat with your data

✅ Select the database with imported data in the “Search Documents” sub-node of an AI Agent.

✅ Start a chat with your agent via the chat interface: it will retrieve data from the vector store and provide a response.

❓You can ask the following questions based on the example files to test this workflow:

  • What are the main steps in incident handling?
  • What does Warren Buffett say about mistakes at Berkshire?
  • What are the requirements for processing personal data?
  • Do any documents mention data breach notification?

🌟Adapt the workflow to your own use case

  • Knowledge management - Query company docs, policies, and procedures
  • Research assistance - Search through academic papers and reports
  • Customer support - Build agents that reference product documentation
  • Legal/compliance - Query contracts, regulations, and legal documents
  • Personal productivity - Chat with your notes, articles, and saved content

The workflow automatically detects new files, processes them into searchable vector chunks, and maintains conversation context. Just drop files in your Google Drive folder and start asking questions.

💻 📞Get in touch with me if you want to customise this workflow or have any questions.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Detect New Files

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 2 - Download as Markdown

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Add Metadata

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 4 - Insert into Vector Store

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.3

Block 5 - Load File Content & Metadata

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 6 - Split into Chunks

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 7 - Generate Embeddings

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 8 - Chat with a RAG Agent

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 9 - Answer Questions

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 10 - Generate Response

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 11 - Search Documents

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreQdrant - vectorStoreQdrant
Config choices
Version 1.3

Block 12 - Store Conversation

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 13 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Build a RAG agent with n8n, Qdrant & OpenAI
Complexity advanced
Nodes 15
Categories Internal Wiki, AI RAG
Author Yulia
Published 03 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11468/11468.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build a RAG agent with n8n, Qdrant & OpenAI do?

This template helps you to create an intelligent document assistant that can answer questions from uploaded files. It shows a complete single vector RAG (Retrieval Augmented Generation) system that...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.