{"product_id":"multi-tenant-rag-search-n8n-workflow-qdrant-gpt-4o","title":"Multi-Tenant RAG Search n8n Workflow: Qdrant + GPT-4o","description":"\u003ch3\u003eMulti-Tenant RAG answers from Qdrant + GPT-4o—via a single n8n POST webhook\u003c\/h3\u003e\n\u003cp\u003eBring Retrieval-Augmented Generation (RAG) to your SaaS: this n8n workflow receives a tenant-scoped query, embeds it with OpenAI, searches the correct Qdrant vectors, and returns a grounded GPT-4o answer with bracketed citations and usage metrics—without leaking data across tenants.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExposes a POST webhook\u003c\/strong\u003e that accepts a user query plus tenant identifiers (e.g., \u003ccode\u003ex-tenant-id\u003c\/code\u003e in headers).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates inputs\u003c\/strong\u003e (tenant ID and query). Missing\/invalid requests are routed to an HTTP error response.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates a vector embedding\u003c\/strong\u003e using OpenAI Embeddings (\u003ccode\u003etext-embedding-3-small\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePerforms multi-tenant Qdrant search\u003c\/strong\u003e with payload filters enforcing \u003ccode\u003etenant_id\u003c\/code\u003e, plus optional \u003ccode\u003eworkspace_id\u003c\/code\u003e and \u003ccode\u003ecategory\u003c\/code\u003e, along with a similarity threshold.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFormats retrieved chunks into a single context block\u003c\/strong\u003e and builds a structured citations list from the payload.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates a grounded response\u003c\/strong\u003e using OpenAI Chat Completions with \u003cstrong\u003eGPT-4o\u003c\/strong\u003e, instructing it to use only the provided context and cite sources like \u003ccode\u003e[Source 1]\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns a final JSON response\u003c\/strong\u003e including answer, citations, similarity metrics, and token usage.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eTenant-specific support Q\u0026amp;A where each workspace’s knowledge base must remain isolated.\u003c\/li\u003e\n  \u003cli\u003eSaaS operators building an internal “ask your docs” feature with Qdrant-backed RAG.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers deploying a webhook-driven RAG endpoint for chat or agent workflows.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes:\u003c\/strong\u003e \u003ccode\u003ewebhook\u003c\/code\u003e, \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003ehttp request\u003c\/code\u003e, \u003ccode\u003erespond to webhook\u003c\/code\u003e, plus a \u003ccode\u003esticky note\u003c\/code\u003e for guidance.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e OpenAI (embeddings + GPT-4o) and Qdrant (vector search with multi-tenant payload filters).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEnvironment\/config:\u003c\/strong\u003e set \u003ccode\u003eOPENAI_API_KEY\u003c\/code\u003e, and configure Qdrant connection details such as \u003ccode\u003eQDRANT_HOST\u003c\/code\u003e and \u003ccode\u003eQDRANT_API_KEY\u003c\/code\u003e if required.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45891848470707,"sku":"N8N-18617","price":45.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/teR9exzKqeQtcJbxF_VVI_btLUa427.png?v=1787562501","url":"https:\/\/buyflowscripts.com\/products\/multi-tenant-rag-search-n8n-workflow-qdrant-gpt-4o","provider":"N8N Commerce","version":"1.0","type":"link"}