Automated document compliance validation with AI and vector database
Needs changesWhat this workflow does
This AI workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects Embeddings Ollama, Qdrant Vector Store and Ollama Chat Model.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Fetch Document (Microsoft Graph) (HTTP Request): calls an HTTP API
- Format Procedure Payload (Code): runs custom JavaScript code
- Delete Old Document Vectors (LangChain Code): uses LangChain Code
- AI Compliance Validator (AI Agent): runs an AI agent, with model: Language Model (AI Agent); 1 tool (Retrieve Relevant Document Chunks); output parser: Parse AI Response
- Extract PDF Text (Extract from File): extracts data from a file (pdf)
- Return Compliance Report (Respond to Webhook): sends the response back to the webhook caller
- Insert Vectors into Qdrant (Qdrant Vector Store): stores documents in the Qdrant vector store, with embeddings: Generate Document Embeddings; document loader: Load Document Metadata
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- LangChain Code (legacy) in Delete Old Document Vectors: no direct replacement.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| LangChain Code (legacy) Delete Old Document Vectors | No direct replacement |
Nodes used (13)
- Webhook
n8n-nodes-base.webhook - HTTP Request
n8n-nodes-base.httpRequest - LangChain Code
@n8n/n8n-nodes-langchain.code - Extract from File
n8n-nodes-base.extractFromFile - Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama - Qdrant Vector Store
@n8n/n8n-nodes-langchain.vectorStoreQdrant - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - Ollama Chat Model
@n8n/n8n-nodes-langchain.lmChatOllama - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Description This workflow automates compliance validation between a policy/procedure and a corresponding uploaded document. It leverages an AI agent to determine whether the content of the document aligns with the expectations outlined in the provided…