This workflow corresponds to n8n.io template #13683 — 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": "Esf8R6W7iWxXW4A5bOWHW",
"name": "Intelligent contract governance auditor with smart risk routing",
"tags": [],
"nodes": [
{
"id": "65491d32-9b58-43b8-b606-efe6e6b2bfe7",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-32,
192
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 15
}
]
}
},
"typeVersion": 1.3
},
{
"id": "1b79bdde-4cd1-417c-96b1-79fac68e045a",
"name": "Workflow Configuration",
"type": "n8n-nodes-base.set",
"position": [
192,
192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "riskThresholdLow",
"type": "number",
"value": 30
},
{
"id": "id-2",
"name": "riskThresholdMedium",
"type": "number",
"value": 60
},
{
"id": "id-3",
"name": "riskThresholdHigh",
"type": "number",
"value": 85
},
{
"id": "id-4",
"name": "slackChannelId",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Slack Channel ID__>"
},
{
"id": "id-5",
"name": "escalationEmail",
"type": "string",
"value": "<__PLACEHOLDER_VALUE__Escalation Email Address__>"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "34698cc1-8aa1-43ff-bf37-d9600a6823ab",
"name": "Simulate Contract Audit Data",
"type": "n8n-nodes-base.code",
"position": [
416,
192
],
"parameters": {
"jsCode": "// Generate simulated contract audit data\nconst contractData = {\n contractId: `CTR-${Math.floor(Math.random() * 10000)}`,\n contractName: `SmartContract_${Math.random().toString(36).substring(7)}`,\n deploymentStatus: ['pending', 'deployed', 'failed'][Math.floor(Math.random() * 3)],\n auditScore: Math.floor(Math.random() * 100) + 1,\n securityFlags: [\n 'reentrancy_check',\n 'overflow_protection',\n 'access_control',\n 'input_validation'\n ].filter(() => Math.random() > 0.3),\n complianceChecks: {\n GDPR: Math.random() > 0.3,\n SOX: Math.random() > 0.4,\n HIPAA: Math.random() > 0.5\n },\n gasOptimization: Math.floor(Math.random() * 100) + 1,\n codeComplexity: Math.floor(Math.random() * 10) + 1,\n timestamp: new Date().toISOString()\n};\n\nreturn [{ json: contractData }];"
},
"typeVersion": 2
},
{
"id": "f3d7b5cc-014c-4531-9cda-6183a1c45e85",
"name": "Contract Validation Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
640,
192
],
"parameters": {
"text": "=Contract audit data: {{ JSON.stringify($json) }}",
"options": {
"systemMessage": "You are a Contract Validation Specialist Agent analyzing smart contract audit and deployment signals.\n\nYour task is to:\n1. Analyze contract audit scores and security flags\n2. Evaluate deployment readiness based on audit results\n3. Identify critical security vulnerabilities\n4. Assess code quality metrics (gas optimization, complexity)\n5. Validate compliance requirements\n6. Determine validation status (APPROVED, CONDITIONAL, REJECTED)\n7. Provide detailed reasoning for your assessment\n\nConsider: security best practices, gas efficiency, code complexity, and compliance requirements.\n\nReturn structured validation results with clear recommendations."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "2c1248fa-e50a-49f1-8f6f-db40c7e1e0a7",
"name": "OpenAI Chat Model - Validation",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
544,
416
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "64531d28-8d08-46fb-98cc-a14196250eae",
"name": "Structured Output Parser - Validation",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
768,
416
],
"parameters": {
"jsonSchemaExample": "{\n \"validationStatus\": \"APPROVED | CONDITIONAL | REJECTED\",\n \"securityScore\": 85,\n \"criticalIssues\": [\"Issue 1\", \"Issue 2\"],\n \"warnings\": [\"Warning 1\"],\n \"gasEfficiencyRating\": \"HIGH | MEDIUM | LOW\",\n \"complianceStatus\": {\n \"GDPR\": true,\n \"SOX\": true,\n \"HIPAA\": false\n },\n \"deploymentRecommendation\": \"Recommendation text\",\n \"reasoning\": \"Detailed reasoning for validation decision\"\n}"
},
"typeVersion": 1.3
},
{
"id": "c46ccd21-7e58-4f2b-8bce-272ef5d64019",
"name": "Governance Orchestrator Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1408,
192
],
"parameters": {
"text": "=Validation results: {{ JSON.stringify($json.output) }}",
"options": {
"systemMessage": "You are a Governance Orchestrator Agent coordinating contract approval workflows and risk escalation.\n\nYour task is to:\n1. Review validation results from the Contract Validation Agent\n2. Call the Risk Assessment Agent Tool to evaluate business and operational risks\n3. Call the Compliance Checker Agent Tool to verify regulatory requirements\n4. Use the Calculator Tool to compute risk scores and thresholds\n5. Determine overall risk level (LOW, MEDIUM, HIGH, CRITICAL)\n6. Decide on approval workflow (AUTO_APPROVE, MANUAL_REVIEW, ESCALATE)\n7. Generate stakeholder notifications\n8. Provide comprehensive governance decision with audit trail\n\nConsider: validation status, risk assessment, compliance gaps, and organizational policies.\n\nReturn structured governance decision with risk level, approval status, and recommended actions."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3.1
},
{
"id": "436c27da-1c0e-4cdb-b885-1e73adf979a7",
"name": "OpenAI Chat Model - Governance",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
992,
416
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "693944b4-0d64-49b3-99a0-5ce8c0b2e7fe",
"name": "Structured Output Parser - Governance",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1824,
416
],
"parameters": {
"jsonSchemaExample": "{\n \"riskLevel\": \"LOW | MEDIUM | HIGH | CRITICAL\",\n \"riskScore\": 45,\n \"approvalStatus\": \"AUTO_APPROVE | MANUAL_REVIEW | ESCALATE | REJECTED\",\n \"businessImpact\": \"Impact description\",\n \"complianceGaps\": [\"Gap 1\", \"Gap 2\"],\n \"requiredActions\": [\"Action 1\", \"Action 2\"],\n \"stakeholders\": [\"Legal\", \"Compliance\", \"Security\"],\n \"escalationReason\": \"Reason for escalation if applicable\",\n \"auditTrail\": {\n \"validationAgent\": \"summary\",\n \"riskAssessment\": \"summary\",\n \"complianceCheck\": \"summary\"\n },\n \"reasoning\": \"Detailed reasoning for governance decision\"\n}"
},
"typeVersion": 1.3
},
{
"id": "6c2d5dfc-076f-4e3e-a29a-6c89ba803d36",
"name": "Risk Assessment Agent Tool",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
1120,
416
],
"parameters": {
"text": "={{ $fromAI(\"validationData\", \"Contract validation results for risk assessment\", \"json\") }}",
"options": {
"systemMessage": "You are a Risk Assessment Specialist Agent evaluating business and operational risks for contract deployments.\n\nYour task is to:\n1. Analyze validation results and security findings\n2. Assess business impact and operational risks\n3. Evaluate financial exposure and liability\n4. Determine risk probability and severity\n5. Calculate overall risk score (0-100)\n6. Identify risk mitigation strategies\n7. Provide detailed risk analysis\n\nConsider: security vulnerabilities, compliance gaps, business continuity, and financial impact.\n\nReturn structured risk assessment with score, impact analysis, and mitigation recommendations."
},
"hasOutputParser": true,
"toolDescription": "Evaluates business and operational risks for contract deployments including impact analysis and risk scoring"
},
"typeVersion": 3
},
{
"id": "47c6aa74-187f-4464-a99d-8c86f621a2eb",
"name": "OpenAI Chat Model - Risk",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1072,
624
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "f5e69b47-fec9-4085-a6f8-5f6143e81c1a",
"name": "Structured Output Parser - Risk",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1232,
640
],
"parameters": {
"jsonSchemaExample": "{\n \"riskScore\": 65,\n \"riskCategory\": \"OPERATIONAL | FINANCIAL | SECURITY | COMPLIANCE\",\n \"businessImpact\": \"HIGH | MEDIUM | LOW\",\n \"financialExposure\": 50000,\n \"operationalRisks\": [\"Risk 1\", \"Risk 2\"],\n \"mitigationStrategies\": [\"Strategy 1\", \"Strategy 2\"],\n \"recommendedControls\": [\"Control 1\", \"Control 2\"],\n \"reasoning\": \"Detailed risk assessment reasoning\"\n}"
},
"typeVersion": 1.3
},
{
"id": "1875dcc6-48ad-4713-860a-1d25af8226de",
"name": "Compliance Checker Agent Tool",
"type": "@n8n/n8n-nodes-langchain.agentTool",
"position": [
1408,
416
],
"parameters": {
"text": "={{ $fromAI(\"validationData\", \"Contract validation results for compliance checking\", \"json\") }}",
"options": {
"systemMessage": "You are a Compliance Checker Specialist Agent verifying regulatory and policy requirements.\n\nYour task is to:\n1. Review contract validation and compliance status\n2. Map requirements to regulatory frameworks (GDPR, SOX, HIPAA, etc.)\n3. Identify compliance gaps and violations\n4. Assess regulatory risk and enforcement likelihood\n5. Determine required remediation actions\n6. Specify documentation and audit requirements\n7. Provide compliance status summary\n\nConsider: applicable regulations, organizational policies, industry standards, and enforcement priorities.\n\nReturn structured compliance assessment with gaps, required actions, and regulatory mapping."
},
"hasOutputParser": true,
"toolDescription": "Verifies regulatory compliance and identifies gaps in contract deployments against frameworks like GDPR, SOX, and HIPAA"
},
"typeVersion": 3
},
{
"id": "043a410b-ea8d-4928-be7b-46b9164052fe",
"name": "OpenAI Chat Model - Compliance",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1408,
624
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "9c42b638-1cbc-4a55-94cb-6eab49307f6d",
"name": "Structured Output Parser - Compliance",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1648,
640
],
"parameters": {
"jsonSchemaExample": "{\n \"complianceStatus\": \"COMPLIANT | PARTIAL | NON_COMPLIANT\",\n \"frameworks\": [\"GDPR\", \"SOX\", \"HIPAA\"],\n \"complianceGaps\": [\"Gap 1\", \"Gap 2\"],\n \"requiredActions\": [\"Action 1\", \"Action 2\"],\n \"regulatoryRisk\": \"HIGH | MEDIUM | LOW\",\n \"documentationNeeds\": [\"Document 1\", \"Document 2\"],\n \"deadlines\": [\"Deadline 1\", \"Deadline 2\"],\n \"reasoning\": \"Detailed compliance assessment reasoning\"\n}"
},
"typeVersion": 1.3
},
{
"id": "68dd851f-231e-41b1-b61c-463f7dd9a8b9",
"name": "Calculator Tool",
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"position": [
1696,
416
],
"parameters": {},
"typeVersion": 1
},
{
"id": "6ef9de90-0933-418c-979b-4648dda63e8f",
"name": "Route by Risk Level",
"type": "n8n-nodes-base.switch",
"position": [
2032,
256
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "LOW",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.riskLevel }}",
"rightValue": "LOW"
}
]
},
"renameOutput": true
},
{
"outputKey": "MEDIUM",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.riskLevel }}",
"rightValue": "MEDIUM"
}
]
},
"renameOutput": true
},
{
"outputKey": "HIGH",
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.riskLevel }}",
"rightValue": "HIGH"
},
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.riskLevel }}",
"rightValue": "CRITICAL"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra",
"renameFallbackOutput": "Unhandled"
}
},
"typeVersion": 3.4
},
{
"id": "44dba0c6-8852-4878-9f7c-0baf8e2ad3f6",
"name": "Prepare Low Risk Notification",
"type": "n8n-nodes-base.set",
"position": [
2560,
144
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "notificationType",
"type": "string",
"value": "LOW_RISK"
},
{
"id": "id-2",
"name": "message",
"type": "string",
"value": "=\u2705 Contract {{ $json.output.auditTrail.validationAgent }} - Low Risk Approved\n\nRisk Score: {{ $json.output.riskScore }}\nApproval Status: {{ $json.output.approvalStatus }}\nBusiness Impact: {{ $json.output.businessImpact }}\n\nNo escalation required."
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "6dc0e360-95c8-4415-b9b3-caa5ac25423c",
"name": "Prepare Medium Risk Notification",
"type": "n8n-nodes-base.set",
"position": [
2336,
336
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "notificationType",
"type": "string",
"value": "MEDIUM_RISK"
},
{
"id": "id-2",
"name": "message",
"type": "string",
"value": "=\u26a0\ufe0f Contract Validation - Medium Risk Detected\n\nRisk Level: {{ $json.output.riskLevel }}\nRisk Score: {{ $json.output.riskScore }}\nApproval Status: {{ $json.output.approvalStatus }}\n\nRequired Actions:\n{{ $json.output.requiredActions.join(\"\\n\") }}\n\nStakeholders: {{ $json.output.stakeholders.join(\", \") }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "923b57d9-172a-4515-aec8-14550a3c99ac",
"name": "Prepare High Risk Notification",
"type": "n8n-nodes-base.set",
"position": [
2336,
528
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "id-1",
"name": "notificationType",
"type": "string",
"value": "HIGH_RISK"
},
{
"id": "id-2",
"name": "emailSubject",
"type": "string",
"value": "=\ud83d\udea8 CRITICAL: Contract Governance Escalation - {{ $json.output.riskLevel }} Risk"
},
{
"id": "id-3",
"name": "emailBody",
"type": "string",
"value": "=<html><body style=\"font-family: Arial, sans-serif; line-height: 1.6; color: #333;\"><div style=\"background-color: #dc3545; color: white; padding: 20px; border-radius: 5px;\"><h2>\ud83d\udea8 CRITICAL CONTRACT GOVERNANCE ESCALATION</h2></div><div style=\"padding: 20px;\"><h3>Risk Assessment</h3><table style=\"width: 100%; border-collapse: collapse;\"><tr><td style=\"padding: 8px; border: 1px solid #ddd; font-weight: bold;\">Risk Level:</td><td style=\"padding: 8px; border: 1px solid #ddd;\">{{ $json.output.riskLevel }}</td></tr><tr><td style=\"padding: 8px; border: 1px solid #ddd; font-weight: bold;\">Risk Score:</td><td style=\"padding: 8px; border: 1px solid #ddd;\">{{ $json.output.riskScore }}</td></tr><tr><td style=\"padding: 8px; border: 1px solid #ddd; font-weight: bold;\">Approval Status:</td><td style=\"padding: 8px; border: 1px solid #ddd;\">{{ $json.output.approvalStatus }}</td></tr><tr><td style=\"padding: 8px; border: 1px solid #ddd; font-weight: bold;\">Business Impact:</td><td style=\"padding: 8px; border: 1px solid #ddd;\">{{ $json.output.businessImpact }}</td></tr></table><h3>Escalation Reason</h3><p style=\"background-color: #fff3cd; padding: 15px; border-left: 4px solid #ffc107;\">{{ $json.output.escalationReason }}</p><h3>Compliance Gaps</h3><ul>{{ $json.output.complianceGaps.map(gap => `<li>${gap}</li>`).join(\"\") }}</ul><h3>Required Actions</h3><ul>{{ $json.output.requiredActions.map(action => `<li>${action}</li>`).join(\"\") }}</ul><h3>Audit Trail</h3><pre style=\"background-color: #f8f9fa; padding: 15px; border-radius: 5px; overflow-x: auto;\">{{ JSON.stringify($json.output.auditTrail, null, 2) }}</pre><p style=\"margin-top: 30px; padding: 15px; background-color: #f8d7da; border-left: 4px solid #dc3545;\"><strong>\u26a0\ufe0f IMMEDIATE ACTION REQUIRED</strong><br>This case requires urgent review and decision by governance leadership.</p><p style=\"color: #666; font-size: 12px; margin-top: 30px;\">Generated: {{ $now.toFormat(\"yyyy-MM-dd HH:mm:ss\") }}</p></div></body></html>"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "336fb97d-628b-4591-a822-d7c52c979552",
"name": "Send Slack Notification",
"type": "n8n-nodes-base.slack",
"position": [
2560,
336
],
"parameters": {
"text": "={{ $json.message }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Workflow Configuration').first().json.slackChannelId }}"
},
"otherOptions": {},
"authentication": "oAuth2"
},
"credentials": {
"slackOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.4
},
{
"id": "26a54e9a-565b-4b88-9bc2-315338a5f015",
"name": "Send Email Escalation",
"type": "n8n-nodes-base.emailSend",
"position": [
2560,
528
],
"parameters": {
"html": "={{ $json.emailBody }}",
"options": {},
"subject": "={{ $json.emailSubject }}",
"toEmail": "={{ $('Workflow Configuration').first().json.escalationEmail }}",
"fromEmail": "<__PLACEHOLDER_VALUE__Sender Email Address__>"
},
"typeVersion": 2.1
},
{
"id": "6068184b-bcc3-402b-97a3-0f64a71bbe37",
"name": "Merge Notifications",
"type": "n8n-nodes-base.merge",
"position": [
2784,
240
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineAll"
},
"typeVersion": 3.2
},
{
"id": "f0ac2eae-85b2-4b90-ba8a-78202c29a01f",
"name": "Log Audit Trail",
"type": "n8n-nodes-base.code",
"position": [
3008,
240
],
"parameters": {
"jsCode": "// Log Audit Trail\n// Captures comprehensive audit information for governance tracking\n\nconst items = $input.all();\nconst auditLogs = [];\n\nfor (const item of items) {\n const timestamp = new Date().toISOString();\n const riskLevel = item.json.riskLevel || 'unknown';\n const approvalStatus = item.json.approvalStatus || item.json.status || 'pending';\n const notificationType = item.json.notificationType || item.json.notification_type || 'none';\n const governanceOutput = item.json;\n \n // Log to console for debugging\n console.log('=== AUDIT TRAIL ENTRY ===');\n console.log('Timestamp:', timestamp);\n console.log('Risk Level:', riskLevel);\n console.log('Approval Status:', approvalStatus);\n console.log('Notification Type:', notificationType);\n console.log('Full Governance Output:', JSON.stringify(governanceOutput, null, 2));\n console.log('========================');\n \n // Create structured audit log entry\n const auditEntry = {\n timestamp: timestamp,\n riskLevel: riskLevel,\n approvalStatus: approvalStatus,\n notificationType: notificationType,\n governanceOutput: governanceOutput,\n auditId: `audit-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`\n };\n \n auditLogs.push(auditEntry);\n}\n\n// Return structured audit logs\nreturn auditLogs.map(log => ({ json: log }));"
},
"typeVersion": 2
},
{
"id": "8e023136-2b83-48be-b2f8-d51aeeaaab78",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1232,
-384
],
"parameters": {
"color": 5,
"width": 640,
"height": 368,
"content": "## Prerequisites\n- Slack workspace with bot token\n- Gmail or SMTP credentials\n- Basic n8n workflow knowledge\n## Use Cases\n- Automated periodic contract risk auditing for procurement teams\n- Compliance breach detection with instant escalation to legal\n## Customization\n- Replace simulated data with live contract database or webhook input\n## Benefits\n- Eliminates manual contract review with scheduled AI auditing"
},
"typeVersion": 1
},
{
"id": "29ef40a9-ed6c-4bc4-aad6-60b334d86f92",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
736,
-272
],
"parameters": {
"width": 416,
"height": 256,
"content": "## Setup Steps\n1. Set schedule trigger interval to match audit frequency requirements.\n2. Add OpenAI API credentials to all OpenAI Chat Model nodes.\n3. Configure Slack credentials and set target channel for risk notifications.\n4. Add Gmail/SMTP credentials to the Send Email Escalation node.\n5. Define risk thresholds in the Route by Risk Level rules node."
},
"typeVersion": 1
},
{
"id": "f3d22c16-0e96-44f9-8697-57b1d2aa8697",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
48,
-272
],
"parameters": {
"width": 624,
"height": 240,
"content": "## How It Works\nThis workflow automates contract governance auditing by deploying a multi-agent AI system that validates contracts, assesses risk, checks compliance, and routes alerts based on risk level. Designed for legal, procurement, and compliance teams, it eliminates manual contract review bottlenecks and ensures timely escalation of high-risk issues. A schedule trigger initiates the workflow, simulating a contract audit data input. A Contract Validation Agent performs initial validation via OpenAI, then passes results to a Governance Orchestration Agent, which delegates to Risk Assessment and Compliance Checker sub-agents. Risk scores are routed by level\u2014low, medium, or high\u2014triggering appropriate notifications via Slack or email escalation before logging the audit trail."
},
"typeVersion": 1
},
{
"id": "35852849-21a2-4dba-9bba-2fd27f88e197",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
48
],
"parameters": {
"color": 7,
"width": 1008,
"height": 784,
"content": "## Contract Validation Agent\n**What** \u2013 Validates contract data using OpenAI with structured output parsing.\n**Why** \u2013 Ensures only well-formed, complete contracts proceed to governance review."
},
"typeVersion": 1
},
{
"id": "e0ecff6d-181a-4d67-a97c-ffd03ce0e704",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1952,
48
],
"parameters": {
"color": 7,
"width": 304,
"height": 784,
"content": "## Route by Risk Level\n**What** \u2013 Directs flow to low, medium, or high-risk notification paths.\n**Why** \u2013 Ensures proportionate responses without manual intervention."
},
"typeVersion": 1
},
{
"id": "9ff81781-2fc2-4af3-b291-f8e1f11731c1",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
944,
48
],
"parameters": {
"color": 7,
"width": 992,
"height": 784,
"content": "## Governance Orchestration Agent\n**What** \u2013 Delegates to Risk Assessment and Compliance Checker sub-agents.\n**Why** \u2013 Centralises governance logic for modular, maintainable risk processing."
},
"typeVersion": 1
},
{
"id": "6bd6ec7b-2920-4995-8e95-47a5a5d54926",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2288,
48
],
"parameters": {
"color": 7,
"width": 928,
"height": 768,
"content": "## Notifications, Escalation & Audit Trail\n**What** \u2013 Sends Slack alerts or escalation emails based on risk level\n**Why** \u2013 Ensures urgent findings are delivered immediately to the appropriate stakeholders "
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"availableInMCP": false,
"executionOrder": "v1"
},
"versionId": "b5d43d27-4ae5-410b-bb3a-7e5876f0951e",
"connections": {
"Calculator Tool": {
"ai_tool": [
[
{
"node": "Governance Orchestrator Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Workflow Configuration",
"type": "main",
"index": 0
}
]
]
},
"Merge Notifications": {
"main": [
[
{
"node": "Log Audit Trail",
"type": "main",
"index": 0
}
]
]
},
"Route by Risk Level": {
"main": [
[
{
"node": "Prepare Low Risk Notification",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare Medium Risk Notification",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare High Risk Notification",
"type": "main",
"index": 0
}
]
]
},
"Workflow Configuration": {
"main": [
[
{
"node": "Simulate Contract Audit Data",
"type": "main",
"index": 0
}
]
]
},
"Send Slack Notification": {
"main": [
[
{
"node": "Merge Notifications",
"type": "main",
"index": 1
}
]
]
},
"OpenAI Chat Model - Risk": {
"ai_languageModel": [
[
{
"node": "Risk Assessment Agent Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Contract Validation Agent": {
"main": [
[
{
"node": "Governance Orchestrator Agent",
"type": "main",
"index": 0
}
]
]
},
"Risk Assessment Agent Tool": {
"ai_tool": [
[
{
"node": "Governance Orchestrator Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simulate Contract Audit Data": {
"main": [
[
{
"node": "Contract Validation Agent",
"type": "main",
"index": 0
}
]
]
},
"Compliance Checker Agent Tool": {
"ai_tool": [
[
{
"node": "Governance Orchestrator Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Governance Orchestrator Agent": {
"main": [
[
{
"node": "Route by Risk Level",
"type": "main",
"index": 0
}
]
]
},
"Prepare Low Risk Notification": {
"main": [
[
{
"node": "Merge Notifications",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model - Compliance": {
"ai_languageModel": [
[
{
"node": "Compliance Checker Agent Tool",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model - Governance": {
"ai_languageModel": [
[
{
"node": "Governance Orchestrator Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model - Validation": {
"ai_languageModel": [
[
{
"node": "Contract Validation Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Prepare High Risk Notification": {
"main": [
[
{
"node": "Send Email Escalation",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser - Risk": {
"ai_outputParser": [
[
{
"node": "Risk Assessment Agent Tool",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Prepare Medium Risk Notification": {
"main": [
[
{
"node": "Send Slack Notification",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser - Compliance": {
"ai_outputParser": [
[
{
"node": "Compliance Checker Agent Tool",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Structured Output Parser - Governance": {
"ai_outputParser": [
[
{
"node": "Governance Orchestrator Agent",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Structured Output Parser - Validation": {
"ai_outputParser": [
[
{
"node": "Contract Validation Agent",
"type": "ai_outputParser",
"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 contract governance auditing by deploying a multi-agent AI system that validates contracts, assesses risk, checks compliance, and routes alerts based on risk level. Designed for legal, procurement, and compliance teams, it eliminates manual contract…
Source: https://n8n.io/workflows/13683/ — 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 end-to-end sustainability lifecycle management for corporate sustainability teams, ESG governance officers, and circular economy programme leads. It addresses the challenge of
This workflow automates end-to-end carbon emissions monitoring, strategy optimisation, and ESG reporting using a multi-agent AI supervisor architecture in n8n. Designed for sustainability managers, ES
This workflow automates end-to-end ESG (Environmental, Social, and Governance) sustainability reporting for enterprise sustainability teams, compliance officers, and green governance leads. It solves
This workflow automates end-to-end carbon emissions monitoring, strategy optimisation, and ESG reporting using a multi-agent AI supervisor architecture in n8n. Designed for sustainability managers, ES
This workflow automates end-to-end carbon emissions monitoring, strategy optimisation, and ESG reporting using a multi-agent AI supervisor architecture in n8n. Designed for sustainability managers, ES