# Filter by keyword within given documents with OpenAI: n8n workflow

> Started by an event in a connected app, and works across Qdrant. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply...

Source: https://millionrounds.com/workflow/filter-by-keyword-within-given-documents-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Filter by keyword within given documents with OpenAI

Started by an event in a connected app, and works across Qdrant. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 18 steps, 1 branch: a working afternoon to understand properly.

Medium Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Ffilter-by-keyword-within-given-documents-with-openai)

**18 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**0** Loops or waits

**1** Service it connects to

## The flow

Starts it 1 Model 10 Logic 5 Service 2

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

- 1 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 2 **Recursive Character Text Splitter** Text Splitter Recursive Character Text Splitter *Model*
- 3 **Execute Workflow Trigger** Execute Workflow trigger *Starts it*
- 4 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 5 **Embeddings OpenAI2** Embeddings Open Ai *Model*
- 6 **Recursive Character Text Splitter1** Text Splitter Recursive Character Text Splitter *Model*
- 7 **Qdrant Vector Store** Vector Store Qdrant *Model*
- 8 **Default Data Loader** Document Default Data Loader *Model*
- 9 **Set input** Set *Logic*
- 10 **Qdrant Vector Store1** Vector Store Qdrant *Model*
- 11 **Qdrant Vector Store2** Vector Store Qdrant *Model*
- 12 **Default Data Loader1** Document Default Data Loader *Model*
- 13 **Merge** Merge *Logic*
- 14 **Split Out keyword** Split Out *Logic*
- 15 **If no document** If *Logic*
- 16 **Average score grouped by paper id** Summarize *Service*
- 17 **Set output** Set *Logic*
- 18 **Get paper PDF** Http Request *Service*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 18, with 1 branch
- **Size:** Medium: a working afternoon
- **Connects to:** Qdrant
- **Model:** 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 Qdrant account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

Yes. It calls 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?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

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 18 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%2Ffilter-by-keyword-within-given-documents-with-openai)
- **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.

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

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Automated document compliance validation with a local model** 17 steps · calls a model · Qdrant](https://millionrounds.com/workflow/automated-document-compliance-validation-with-a-local-model)
- [**Index and query financial documents with Qdrant and Mistral** 16 steps · Qdrant](https://millionrounds.com/workflow/index-and-query-financial-documents-with-qdrant-and-mistral)
- [**Sync documentation vectors from GitHub with Ollama and Qdrant** 14 steps · Qdrant](https://millionrounds.com/workflow/sync-documentation-vectors-from-github-with-ollama-and-qdran)
- [**Build a financial documents assistant with Qdrant and Mistral** 23 steps · calls a model · Qdrant](https://millionrounds.com/workflow/build-a-financial-documents-assistant-with-qdrant-and-mistra)
- [**Process documents & build semantic search with OpenAI** 23 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/process-documents-and-build-semantic-search-with-openai)
- [**Build a document-based AI chatbot with Google Drive and Llama** 11 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/build-a-document-based-ai-chatbot-with-google-drive-and-llam)
