Skip to main content

Index legal documents for hybrid search with Qdrant, OpenAI & BM25

Workflow preview

Workflow preview
100%
Index legal documents for hybrid search with Qdrant, OpenAI & BM25 preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Index Legal Dataset to Qdrant for Hybrid Retrieval This pipeline is the first part of "Hybrid Search with Qdrant & n8n, Legal AI" . The second part, [ "Hybrid Search with Qdrant & n8n, Legal AI: Re...

Best for

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

Tools used

n8n-nodes-qdrant.qdrant, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.splitout, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches, n8n-nodes-base.aggregate

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Index legal documents for hybrid search with Qdrant, OpenAI & BM25
Workflow name
Index legal documents for hybrid search with Qdrant, OpenAI & BM25

Index Legal Dataset to Qdrant for Hybrid Retrieval

*This pipeline is the first part of "Hybrid Search with Qdrant & n8n, Legal AI".
The second part, "Hybrid Search with Qdrant & n8n, Legal AI: Retrieval", covers retrieval and simple evaluation.*

Overview

This pipeline transforms a Q&A legal corpus from Hugging Face (isaacus) into vector representations and indexes them to Qdrant, providing the foundation for running Hybrid Search, combining:

After running this pipeline, you will have a Qdrant collection with your legal dataset ready for hybrid retrieval on BM25 and dense embeddings: either mxbai-embed-large-v1 or text-embedding-3-small.

Options for Embedding Inference

This pipeline equips you with two approaches for generating dense vectors:

  1. Using Qdrant Cloud Inference, conversion to vectors handled directly in Qdrant;
  2. Using external provider, e.g. OpenAI for generating embeddings.
Prerequisites
  • A cluster on Qdrant Cloud
    • Paid cluster in the US region if you want to use Qdrant Cloud Inference
    • Free Tier Cluster if using an external provider (here OpenAI)
  • Qdrant Cluster credentials:
    • You'll be guided on how to obtain both the URL and API_KEY from the Qdrant Cloud UI when setting up your cluster;
  • An OpenAI API key (if you’re not using Qdrant’s Cloud Inference);
P.S.

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 - Create Collection

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 2 - Check Collection Exists

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 3 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - Sticky Note

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

Block 5 - Index Dataset from HuggingFace

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

Block 6 - Split Them All Out

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

Block 7 - Get Dataset Splits

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

Block 8 - Divide Per Row

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

Block 9 - Loop Over Batches

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Aggregate a Batch

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

Block 11 - Upsert Points

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 12 - Limit

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

Block 13 - Merge

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

Block 14 - Sum them Up

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 15 - Get the Average Text Length

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Loop Over Batches1

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 17 - Upsert Points1

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 18 - Create Collection1

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 19 - Check Collection Exists1

Type / Role
n8n-nodes-qdrant.qdrant - qdrant
Config choices
Version 1

Block 20 - If1

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 21 - Merge1

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

Block 22 - Split Out

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

Block 23 - Get OpenAI embeddings

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

Block 24 - Sticky Note1

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

Showing the first 24 of 37 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Index legal documents for hybrid search with Qdrant, OpenAI & BM25
Complexity advanced
Nodes 37
Categories AI RAG, Multimodal AI
Author Jenny
Published 27 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7945/7945.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 Index legal documents for hybrid search with Qdrant, OpenAI & BM25 do?

Index Legal Dataset to Qdrant for Hybrid Retrieval This pipeline is the first part of "Hybrid Search with Qdrant & n8n, Legal AI" . The second part, [ "Hybrid Search with Qdrant & n8n, Legal AI: Re...

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 AI RAG, Multimodal AI use case.