This workflow corresponds to n8n.io template #14434 — we link there as the canonical source.
This workflow follows the Agent → Agenttool recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "JKhm3YE1kwUXHx3d",
"name": "AI-powered legal contract governance with risk routing and compliance validation",
"tags": [],
"nodes": [
{
"id": "0bc983f1-44e6-470f-a501-84bd32a8f9f5",
"name": "Contract Upload Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
256,
496
],
"parameters": {
"path": "contract-review",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "33c48222-abae-4ace-8057-54a687583393",
"name": "Extract Contract Text",
"type": "n8n-nodes-base.extractFromFile",
"position": [
480,
496
],
"parameters": {
"options": {},
"operation": "text"
},
"typeVersion": 1.1
},
{
"id": "fc89d3c3-1de8-4093-9495-56cc5379894b",
"name": "Legal Governance Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1120,
464
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "You are a Legal Governance Agent responsible for orchestrating contract review workflows. You coordinate the Contract Review Agent and Compliance Validation Agent to analyze legal agreements. Your role is to: 1) Delegate contract analysis to the Contract Review Agent, 2) Validate compliance requirements through the Compliance Validation Agent, 3) Determine risk levels and approval requirements, 4) Generate comprehensive legal summaries, 5) Produce audit-ready documentation. Always provide structured output with risk classification, compliance status, identified obligations, and recommended actions."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "933fff8a-e22b-46e9-bd9b-9669c8e4b012",
"name": "Governance Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
720,
624
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {
"temperature": 0.2
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "a24e1ef0-89b3-4503-ad4d-9637fed5e7c5",
"name": "Contract Review Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
912,
640
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "46804fdc-710c-40f5-bbed-2bbace1610d0",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1696,
928
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"contractId\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"Unique identifier for the contract\"\n\t\t},\n\t\t\"riskLevel\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"low\", \"medium\", \"high\", \"critical\"],\n\t\t\t\"description\": \"Overall risk classification of the contract\"\n\t\t},\n\t\t\"riskClauses\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"clauseText\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"The text of the risky clause\"\n\t\t\t\t\t},\n\t\t\t\t\t\"riskType\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"Type of risk identified\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"clauseText\", \"riskType\"]\n\t\t\t},\n\t\t\t\"description\": \"Array of identified risky clauses\"\n\t\t},\n\t\t\"obligations\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"obligationDescription\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"Description of the obligation\"\n\t\t\t\t\t},\n\t\t\t\t\t\"partyResponsible\": {\n\t\t\t\t\t\t\"type\": \"string\",\n\t\t\t\t\t\t\"description\": \"Party responsible for fulfilling the obligation\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"required\": [\"obligationDescription\", \"partyResponsible\"]\n\t\t\t},\n\t\t\t\"description\": \"Array of contractual obligations\"\n\t\t},\n\t\t\"complianceStatus\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"enum\": [\"compliant\", \"non-compliant\", \"requires-review\"],\n\t\t\t\"description\": \"Overall compliance status of the contract\"\n\t\t},\n\t\t\"complianceIssues\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": \"Array of identified compliance issues\"\n\t\t},\n\t\t\"regulatoryRequirements\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": \"Array of applicable regulatory requirements\"\n\t\t},\n\t\t\"approvalRequired\": {\n\t\t\t\"type\": \"boolean\",\n\t\t\t\"description\": \"Whether approval is required for this contract\"\n\t\t},\n\t\t\"approvers\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": \"Array of required approvers\"\n\t\t},\n\t\t\"legalSummary\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"Comprehensive legal summary of the contract\"\n\t\t},\n\t\t\"auditNotes\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"Notes for audit purposes\"\n\t\t},\n\t\t\"recommendedActions\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t},\n\t\t\t\"description\": \"Array of recommended actions\"\n\t\t},\n\t\t\"timestamp\": {\n\t\t\t\"type\": \"string\",\n\t\t\t\"description\": \"Timestamp of the review\"\n\t\t}\n\t},\n\t\"required\": [\"contractId\", \"riskLevel\", \"riskClauses\", \"obligations\", \"complianceStatus\", \"complianceIssues\", \"regulatoryRequirements\", \"approvalRequired\", \"approvers\", \"legalSummary\", \"auditNotes\", \"recommendedActions\", \"timestamp\"]\n}"
},
"typeVersion": 1.3
},
{
"id": "1c6c55b3-1543-4dd9-8844-26e9d003efb1",
"name": "Contract Review Agent",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
992,
928
],
"parameters": {
"text": "={{ $fromAI('contract_text', 'The full contract text to analyze') }}",
"options": {
"systemMessage": "You are a Contract Review Agent specialized in legal contract analysis. Your expertise includes: 1) Identifying high-risk clauses (unlimited liability, broad indemnification, unfavorable termination terms, IP assignment issues), 2) Extracting all contractual obligations and responsibilities for each party, 3) Flagging ambiguous or problematic language, 4) Assessing financial exposure and liability caps, 5) Identifying missing standard protections. Provide detailed, clause-specific analysis with risk ratings and specific concerns."
},
"toolDescription": "Analyzes legal contracts to identify risk clauses, obligations, liability terms, indemnification clauses, termination conditions, and contractual commitments. Returns detailed risk assessment with clause-level analysis."
},
"typeVersion": 3
},
{
"id": "c7f00a95-affb-43e8-9cd1-bbe492bad09c",
"name": "Contract Review Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
992,
1136
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {
"temperature": 0.2
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "8718bafd-56e2-4261-a105-d7182dc2c299",
"name": "Compliance Validation Agent",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
1280,
928
],
"parameters": {
"text": "={{ $fromAI('contract_text', 'The contract text to validate for compliance') }}",
"options": {
"systemMessage": "You are a Compliance Validation Agent specialized in regulatory compliance analysis. Your expertise includes: 1) GDPR data protection requirements, 2) SOC2 security and privacy controls, 3) HIPAA healthcare data regulations, 4) Industry-specific compliance (financial services, healthcare, technology), 5) Corporate governance and policy adherence. Identify specific compliance gaps, cite relevant regulations, assess compliance risk levels, and recommend remediation steps."
},
"toolDescription": "Validates contracts against regulatory requirements including GDPR, SOC2, HIPAA, industry-specific regulations, and corporate compliance policies. Identifies compliance gaps and regulatory risks."
},
"typeVersion": 3
},
{
"id": "a9b0bf2c-7f74-4172-a971-1e045c4f67ef",
"name": "Compliance Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1232,
1136
],
"parameters": {
"model": {
"__rl": true,
"mode": "id",
"value": "gpt-4o"
},
"options": {
"temperature": 0.2
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "af509a3c-75cd-4da0-8f8c-64b6c0375c0f",
"name": "Regulatory Database Tool",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
1424,
1136
],
"parameters": {
"url": "<__PLACEHOLDER_VALUE__regulatory_api_endpoint__>",
"options": {},
"toolDescription": "Queries external regulatory databases and legal reference systems to validate compliance requirements and retrieve current regulatory standards"
},
"typeVersion": 4.4
},
{
"id": "1b9e919f-b632-4bb8-8dc6-d8c4b89bad1e",
"name": "Slack Alert Tool",
"type": "n8n-nodes-base.slackTool",
"position": [
1568,
928
],
"parameters": {
"text": "={{ $fromAI('message', 'Alert message content') }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "={{ $fromAI('channel', 'Slack channel for legal alerts', 'string', '#legal-alerts') }}"
},
"otherOptions": {},
"authentication": "oAuth2",
"descriptionType": "manual",
"toolDescription": "Sends Slack notifications for high-risk contract alerts, approval requests, and compliance issues to the legal team channel"
},
"credentials": {
"slackOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.4
},
{
"id": "f6d3dfdb-32a4-472e-8bf4-3c67f1a9aa29",
"name": "Route by Risk Level",
"type": "n8n-nodes-base.switch",
"position": [
1984,
880
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Critical Risk",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.riskLevel }}",
"rightValue": "critical"
}
]
},
"renameOutput": true
},
{
"outputKey": "High Risk",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.riskLevel }}",
"rightValue": "high"
}
]
},
"renameOutput": true
},
{
"outputKey": "Medium Risk",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.riskLevel }}",
"rightValue": "medium"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3.4
},
{
"id": "4647641e-2198-4b7b-8cd5-bd01c7ec31b2",
"name": "Prepare Critical Alert",
"type": "n8n-nodes-base.set",
"position": [
2240,
832
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "alertType",
"type": "string",
"value": "CRITICAL"
},
{
"id": "id-2",
"name": "priority",
"type": "string",
"value": "P0"
},
{
"id": "id-3",
"name": "requiresImmediateAction",
"type": "boolean",
"value": true
},
{
"id": "id-4",
"name": "notificationChannel",
"type": "string",
"value": "#legal-critical"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "dd2d5d77-345b-4ae0-93f5-c95fb32ebc55",
"name": "Prepare High Risk Alert",
"type": "n8n-nodes-base.set",
"position": [
2240,
1024
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "alertType",
"type": "string",
"value": "HIGH_RISK"
},
{
"id": "id-2",
"name": "priority",
"type": "string",
"value": "P1"
},
{
"id": "id-3",
"name": "requiresImmediateAction",
"type": "boolean",
"value": true
},
{
"id": "id-4",
"name": "notificationChannel",
"type": "string",
"value": "#legal-alerts"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "80a9ad58-61a8-4f29-a485-b11f3e647979",
"name": "Prepare Standard Review",
"type": "n8n-nodes-base.set",
"position": [
2240,
1216
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "alertType",
"type": "string",
"value": "STANDARD_REVIEW"
},
{
"id": "id-2",
"name": "priority",
"type": "string",
"value": "P2"
},
{
"id": "id-3",
"name": "requiresImmediateAction",
"type": "boolean",
"value": false
},
{
"id": "id-4",
"name": "notificationChannel",
"type": "string",
"value": "#legal-reviews"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "74bb6062-c08d-41a7-9c78-9c3aba06ed22",
"name": "Track Contract Reviews",
"type": "n8n-nodes-base.dataTable",
"position": [
2656,
816
],
"parameters": {
"columns": {
"value": null,
"mappingMode": "autoMapInputData"
},
"options": {},
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "<__PLACEHOLDER_VALUE__contract_reviews_audit_trail__>"
}
},
"typeVersion": 1.1
},
{
"id": "b45d496d-eda6-4e05-9ef4-ed69f6df89c0",
"name": "Prepare Audit Record",
"type": "n8n-nodes-base.set",
"position": [
2464,
1024
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "contractId",
"type": "string",
"value": "={{ $json.contractId }}"
},
{
"id": "id-2",
"name": "riskLevel",
"type": "string",
"value": "={{ $json.riskLevel }}"
},
{
"id": "id-3",
"name": "complianceStatus",
"type": "string",
"value": "={{ $json.complianceStatus }}"
},
{
"id": "id-4",
"name": "approvalRequired",
"type": "boolean",
"value": "={{ $json.approvalRequired }}"
},
{
"id": "id-5",
"name": "legalSummary",
"type": "string",
"value": "={{ $json.legalSummary }}"
},
{
"id": "id-6",
"name": "auditNotes",
"type": "string",
"value": "={{ $json.auditNotes }}"
},
{
"id": "id-7",
"name": "reviewTimestamp",
"type": "string",
"value": "={{ $json.timestamp }}"
},
{
"id": "id-8",
"name": "alertType",
"type": "string",
"value": "={{ $json.alertType }}"
},
{
"id": "id-9",
"name": "priority",
"type": "string",
"value": "={{ $json.priority }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9647d447-a83a-4b36-9173-df7b42cefcfc",
"name": "Store Risk Clauses",
"type": "n8n-nodes-base.dataTable",
"position": [
3104,
1056
],
"parameters": {
"columns": {
"value": null,
"mappingMode": "autoMapInputData"
},
"options": {},
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "<__PLACEHOLDER_VALUE__risk_clauses_tracking__>"
}
},
"typeVersion": 1.1
},
{
"id": "0abd9451-e1f9-42c3-b678-54977f037ac2",
"name": "Split Risk Clauses",
"type": "n8n-nodes-base.splitOut",
"position": [
2656,
1056
],
"parameters": {
"options": {},
"fieldToSplitOut": "riskClauses"
},
"typeVersion": 1
},
{
"id": "24fd1714-6109-46ba-af03-e508ed796eb3",
"name": "Check Approval Required",
"type": "n8n-nodes-base.if",
"position": [
2880,
816
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "id-1",
"operator": {
"type": "boolean",
"operation": "true"
},
"leftValue": "={{ $json.output.approvalRequired }}"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "44f9787b-863a-42d3-9a29-928e12f2e2ed",
"name": "Log Approval Decision",
"type": "n8n-nodes-base.dataTable",
"position": [
3328,
752
],
"parameters": {
"columns": {
"value": null,
"mappingMode": "autoMapInputData"
},
"options": {},
"dataTableId": {
"__rl": true,
"mode": "list",
"value": "<__PLACEHOLDER_VALUE__approval_decisions_log__>"
}
},
"typeVersion": 1.1
},
{
"id": "9bf79d50-049a-48ee-b2eb-7e8eada22054",
"name": "Prepare Final Summary",
"type": "n8n-nodes-base.set",
"position": [
3552,
816
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "workflowStatus",
"type": "string",
"value": "COMPLETED"
},
{
"id": "id-2",
"name": "processingTimestamp",
"type": "string",
"value": "={{ $now.toISO() }}"
},
{
"id": "id-3",
"name": "auditReady",
"type": "boolean",
"value": true
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "25751ace-bef8-4b78-a66e-7946b5d615d7",
"name": "Prepare Risk Clause Record",
"type": "n8n-nodes-base.set",
"position": [
2880,
1056
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "contractId",
"type": "string",
"value": "={{ $('Prepare Audit Record').item.json.contractId }}"
},
{
"id": "id-2",
"name": "clauseText",
"type": "string",
"value": "={{ $json.clauseText }}"
},
{
"id": "id-3",
"name": "riskType",
"type": "string",
"value": "={{ $json.riskType }}"
},
{
"id": "id-4",
"name": "riskLevel",
"type": "string",
"value": "={{ $('Prepare Audit Record').item.json.riskLevel }}"
},
{
"id": "id-5",
"name": "identifiedAt",
"type": "string",
"value": "={{ $now.toISO() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "47becb91-2724-4b93-a7bf-006b2e3724ba",
"name": "Prepare Approval Log",
"type": "n8n-nodes-base.set",
"position": [
3104,
752
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "contractId",
"type": "string",
"value": "={{ $json.contractId }}"
},
{
"id": "id-2",
"name": "approvalStatus",
"type": "string",
"value": "APPROVED"
},
{
"id": "id-3",
"name": "approver",
"type": "string",
"value": "={{ $json.approvers }}"
},
{
"id": "id-4",
"name": "approvalTimestamp",
"type": "string",
"value": "={{ $now.toISO() }}"
},
{
"id": "id-5",
"name": "riskLevel",
"type": "string",
"value": "={{ $json.riskLevel }}"
},
{
"id": "id-6",
"name": "complianceStatus",
"type": "string",
"value": "={{ $json.complianceStatus }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "80900f43-f92c-4af3-be16-09a272ab9b89",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
624
],
"parameters": {
"color": 7,
"width": 592,
"height": 768,
"content": "\n## Audit Record, Approval Tracking & Risk Clause Storage\n**Why** \u2014 Generates auditable records for every contract, checks approval requirements, logs decisions, and stores extracted risk clauses separately for targeted downstream review."
},
"typeVersion": 1
},
{
"id": "45ffe489-f45f-4f08-b2f1-892ae23548a5",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
192,
816
],
"parameters": {
"color": 7,
"width": 2224,
"height": 592,
"content": "## Compliance Validation & Risk Routing\n**Why** \u2014 Cross-references clauses against live regulatory data, then routes contracts by risk level \u2014 critical, high, or standard \u2014 ensuring proportionate response without manual triage."
},
"typeVersion": 1
},
{
"id": "6b0f31c3-29e9-4608-a0e7-3dab48c98dea",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
176,
272
],
"parameters": {
"color": 7,
"width": 1216,
"height": 512,
"content": "## Contract Upload, Extraction & Governance Orchestration\n**Why** \u2014 Webhook ingestion and text extraction feed the Legal Governance Agent, which coordinates Contract Review, Compliance Validation, and Slack alerting in parallel using shared memory for context continuity."
},
"typeVersion": 1
},
{
"id": "3183e5ce-295a-414c-8ccf-b6ed498a200a",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
3056,
576
],
"parameters": {
"color": 7,
"width": 672,
"height": 768,
"content": "## Prepare Final Summary\n**Why** \u2014 Consolidates review outcomes, approval status, and risk findings into a single structured summary for stakeholders.\n"
},
"typeVersion": 1
},
{
"id": "498cdd99-742a-483f-b85b-2bb85ea510b9",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1472,
-64
],
"parameters": {
"color": 4,
"width": 752,
"height": 368,
"content": "## Prerequisites\n- OpenAI API key (or compatible LLM)\n- Slack workspace with bot credentials\n- Google Sheets with review and risk log tabs pre-created\n- Regulatory database API endpoint access\n## Use Cases\n- Legal teams auto-triaging uploaded vendor contracts by compliance risk level\n## Customisation\n- Swap the Regulatory Database Tool endpoint to target jurisdiction-specific compliance frameworks (GDPR, CCPA, MAS)\n## Benefits\n- Eliminates manual contract triage, reducing review cycle time significantly"
},
"typeVersion": 1
},
{
"id": "23f684cc-066c-4a2e-b18e-6e0e8a208c2e",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
928,
-48
],
"parameters": {
"width": 496,
"height": 256,
"content": "## Setup Steps\n1. Import workflow; configure the Contract Upload Webhook trigger URL.\n2. Add AI model credentials to the Legal Governance Agent, Contract Review Agent, and Compliance Validation Agent nodes.\n3. Connect Slack credentials to the Slack Alert Tool node.\n4. Link Google Sheets credentials; set sheet IDs for Contract Reviews, Approval Log, and Risk Clauses tabs.\n5. Configure the Regulatory Database Tool with your compliance database API endpoint and credentials."
},
"typeVersion": 1
},
{
"id": "f626b352-6bdf-4dce-9e1a-acb981b5d8d3",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
192,
-64
],
"parameters": {
"width": 704,
"height": 304,
"content": "## How It Works\nThis workflow automates end-to-end legal contract review and compliance governance for legal teams, contract managers, and risk officers. It solves the problem of manually reviewing uploaded contracts for regulatory compliance, risk classification, and approval routing, a process that is time-consuming, inconsistent, and difficult to audit at scale. Contracts are ingested via a webhook upload trigger and text is extracted immediately. The extracted content is passed to a Legal Governance Agent backed by shared memory, which coordinates three specialist components: a Contract Review Agent (using a dedicated review model and memory), a Compliance Validation Agent (referencing a Regulatory Database Tool and compliance model), and a Slack Alert Tool with structured output parsing. The agent classifies each contract by risk level and routes accordingly, critical alerts, high-risk alerts, and standard reviews each follow distinct paths. All contracts generate an audit record. High and critical cases trigger contract review tracking, approval requirement checks, approval log preparation, and a final summary. Risk clauses are extracted in parallel, split, and stored for downstream reference."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "33818793-dcfa-41e6-9d75-df777982ffac",
"connections": {
"Compliance Model": {
"ai_languageModel": [
[
{
"node": "Compliance Validation Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Governance Model": {
"ai_languageModel": [
[
{
"node": "Legal Governance Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Slack Alert Tool": {
"ai_tool": [
[
{
"node": "Legal Governance Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Split Risk Clauses": {
"main": [
[
{
"node": "Prepare Risk Clause Record",
"type": "main",
"index": 0
}
]
]
},
"Route by Risk Level": {
"main": [
[
{
"node": "Prepare Critical Alert",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare High Risk Alert",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare Standard Review",
"type": "main",
"index": 0
}
]
]
},
"Prepare Approval Log": {
"main": [
[
{
"node": "Log Approval Decision",
"type": "main",
"index": 0
}
]
]
},
"Prepare Audit Record": {
"main": [
[
{
"node": "Track Contract Reviews",
"type": "main",
"index": 0
},
{
"node": "Split Risk Clauses",
"type": "main",
"index": 0
}
]
]
},
"Contract Review Agent": {
"ai_tool": [
[
{
"node": "Legal Governance Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Contract Review Model": {
"ai_languageModel": [
[
{
"node": "Contract Review Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Extract Contract Text": {
"main": [
[
{
"node": "Legal Governance Agent",
"type": "main",
"index": 0
}
]
]
},
"Log Approval Decision": {
"main": [
[
{
"node": "Prepare Final Summary",
"type": "main",
"index": 0
}
]
]
},
"Contract Review Memory": {
"ai_memory": [
[
{
"node": "Legal Governance Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Legal Governance Agent": {
"main": [
[
{
"node": "Route by Risk Level",
"type": "main",
"index": 0
}
]
]
},
"Prepare Critical Alert": {
"main": [
[
{
"node": "Prepare Audit Record",
"type": "main",
"index": 0
}
]
]
},
"Track Contract Reviews": {
"main": [
[
{
"node": "Check Approval Required",
"type": "main",
"index": 0
}
]
]
},
"Check Approval Required": {
"main": [
[
{
"node": "Prepare Approval Log",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare Final Summary",
"type": "main",
"index": 0
}
]
]
},
"Contract Upload Webhook": {
"main": [
[
{
"node": "Extract Contract Text",
"type": "main",
"index": 0
}
]
]
},
"Prepare High Risk Alert": {
"main": [
[
{
"node": "Prepare Audit Record",
"type": "main",
"index": 0
}
]
]
},
"Prepare Standard Review": {
"main": [
[
{
"node": "Prepare Audit Record",
"type": "main",
"index": 0
}
]
]
},
"Regulatory Database Tool": {
"ai_tool": [
[
{
"node": "Compliance Validation Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Legal Governance Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Prepare Risk Clause Record": {
"main": [
[
{
"node": "Store Risk Clauses",
"type": "main",
"index": 0
}
]
]
},
"Compliance Validation Agent": {
"ai_tool": [
[
{
"node": "Legal Governance Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApislackOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates end-to-end legal contract review and compliance governance for legal teams, contract managers, and risk officers. It solves the problem of manually reviewing uploaded contracts for regulatory compliance, risk classification, and approval routing, a…
Source: https://n8n.io/workflows/14434/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates enterprise resource planning (ERP) operations across Engineering, Finance, HR, and Admin departments for operations managers, ERP administrators, and business process owners wh
This workflow automates enterprise compliance governance using a multi-agent AI architecture. It targets compliance officers, legal teams, and risk managers who need continuous, jurisdiction-aware mon
This workflow automates credit operations onboarding by running KYC verification, credit bureau checks, identity validation, and sanctions screening through a single AI-powered agent. Built for credit
This workflow automates credit operations onboarding by running KYC verification, credit bureau checks, identity validation, and sanctions screening through a single AI-powered agent. Built for credit
This workflow automates intelligent fleet operations management for transport operators, logistics companies, and smart mobility teams. It solves the problem of manually triaging high-volume vehicle t