# Build a self-updating RAG system with OpenAI and Qdrant: n8n workflow

> Started by someone opening a chat with it, and works across Google Drive and Qdrant. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn...

Source: https://millionrounds.com/workflow/build-a-self-updating-rag-system-with-openai-and-qdrant (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Build a self-updating RAG system with OpenAI and Qdrant

Started by someone opening a chat with it, and works across Google Drive and Qdrant. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 25 steps, 2 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-self-updating-rag-system-with-openai-and-qdrant)

**25 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**2** Loops or waits

**2** Services it connects to

## The flow

Starts it 3 Model 13 Logic 3 Service 6

The steps in the order they run, from what starts it.

- 1 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 2 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 3 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 4 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 5 **Recursive Character Text Splitter1** Text Splitter Recursive Character Text Splitter *Model*
- 6 **When chat message received** Chat trigger *Starts it*
- 7 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 8 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 9 **Update?** Google Drive trigger *Starts it*
- 10 **Create collection** Http Request *Service*
- 11 **Clear collection** Http Request *Service*
- 12 **Insert file** Vector Store Qdrant *Model*
- 13 **Default Data Loader1** Document Default Data Loader *Model*
- 14 **Update file** Vector Store Qdrant *Model*
- 15 **Default Data Loader** Document Default Data Loader *Model*
- 16 **Question and Answer Chain** Chain Retrieval Qa *Model*
- 17 **Qdrant Vector Store1** Vector Store Qdrant *Model*
- 18 **Set file_id** Set *Logic*
- 19 **Search files** Google Drive *Service*
- 20 **Wait 5 sec.** Wait *Logic*
- 21 **Vector Store Retriever** Retriever Vector Store *Model*
- 22 **Delete points by file_id** Http Request *Service*
- 23 **Get file** Google Drive *Service*
- 24 **Loop Over Items** Split In Batches *Logic*
- 25 **Get files** Google Drive *Service*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 25, 2 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Qdrant
- **Model:** Gemini, OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Google Drive and Qdrant accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini and OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 25 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 25 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-self-updating-rag-system-with-openai-and-qdrant)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Qdrant](https://millionrounds.com/workflows?service=Qdrant#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**AI inbox assistant with OpenAI and Gmail** 25 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/ai-inbox-assistant-with-openai-and-gmail)
- [**Automating WhatsApp replies with Go High Level and Redis** 25 steps · calls a model · Google Drive, Redis](https://millionrounds.com/workflow/automating-whatsapp-replies-with-go-high-level-and-redis)
- [**Building RAG chatbot for movie recommendations with Qdrant** 25 steps · calls a model · GitHub, Qdrant](https://millionrounds.com/workflow/building-rag-chatbot-for-movie-recommendations-with-qdrant-2)
- [**Building RAG chatbot for movie recommendations with Qdrant** 25 steps · calls a model · GitHub, Qdrant](https://millionrounds.com/workflow/building-rag-chatbot-for-movie-recommendations-with-qdrant)
- [**Turn your portfolio into an AI assistant with OpenAI** 25 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/turn-your-portfolio-into-an-ai-assistant-with-openai)
- [**Build a RAG system with Qdrant and Gemini** 24 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/build-a-rag-system-with-qdrant-and-gemini)
