Intelligent legal document review and compliance automation
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI Chat Model and Postgres.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Workflow Configuration (Edit Fields (Set)): sets 3 fields: complianceRules, riskThreshold, documentType
- Extract Document Text (Extract from File): extracts data from a file (pdf)
- Clause Analysis Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Clause Analysis; output parser: Clause Analysis Output Parser
- Compliance Check Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Compliance; output parser: Compliance Output Parser
- Alternative Wording Agent (AI Agent): runs an AI agent, with model: OpenAI Model - Alternative Wording; output parser: Alternative Wording Output Parser
- Summary Report Generator (AI Agent): runs an AI agent, with model: OpenAI Model - Summary
- Prepare Database Record (Edit Fields (Set)): sets 7 fields: document_name, review_date, risk_summary…
- Log to Contract Database (Postgres): uses Postgres
- Send Notification (HTTP Request): calls an HTTP API (POST)
Services it uses
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 (8)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Extract from File
n8n-nodes-base.extractFromFile - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Postgres
n8n-nodes-base.postgres - HTTP Request
n8n-nodes-base.httpRequest
From the author
How It Works This template automates legal document review by extracting text, analyzing clauses with OpenAI, checking compliance standards, and generating alternative wordings. Target audience: legal teams, contract managers, and compliance officers seeking…