Build a multi-tenant RAG search engine with Qdrant and OpenAI GPT-4o
Ready for 3.0What this workflow does
This workflow has 11 nodes and runs when an HTTP POST request hits its webhook URL. It uses only n8n's built-in nodes. It also calls api.openai.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Tenant Auth & Payload Middleware (Code): runs custom JavaScript code
- Is Tenant Authenticated? (If): checks a condition and branches into true / false
- Generate Vector Embeddings (HTTP Request): calls api.openai.com (POST)
- Respond Unauthorized (Respond to Webhook): sends the response back to the webhook caller
- Build Qdrant Tenant Filter (Code): runs custom JavaScript code
- Qdrant Vector Search (HTTP Request): calls an HTTP API (POST)
- Format Context & Citations (Code): runs custom JavaScript code
- OpenAI RAG Synthesis Agent (HTTP Request): calls api.openai.com (POST)
- Assemble RAG Response (Code): runs custom JavaScript code
- Respond to RAG Client (Respond to Webhook): sends the response back to the webhook caller
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (5)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow exposes a POST webhook that authenticates a tenant, embeds the user query with OpenAI, searches tenant-scoped vectors in Qdrant, and uses GPT-4o to return a grounded answer with bracketed citations and usage metrics. How it works…