{
  "name": "Route legal contract risks with GPT-4o, Slack, Google Sheets and a regulatory API",
  "nodes": [
    {
      "id": "0bc983f1-44e6-470f-a501-84bd32a8f9f5",
      "name": "Contract Upload Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        256,
        496
      ]
    },
    {
      "id": "33c48222-abae-4ace-8057-54a687583393",
      "name": "Extract Contract Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        480,
        496
      ]
    },
    {
      "id": "fc89d3c3-1de8-4093-9495-56cc5379894b",
      "name": "Legal Governance Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        464
      ]
    },
    {
      "id": "933fff8a-e22b-46e9-bd9b-9669c8e4b012",
      "name": "Governance Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        720,
        624
      ]
    },
    {
      "id": "a24e1ef0-89b3-4503-ad4d-9637fed5e7c5",
      "name": "Contract Review Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        912,
        640
      ]
    },
    {
      "id": "46804fdc-710c-40f5-bbed-2bbace1610d0",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1696,
        928
      ]
    },
    {
      "id": "1c6c55b3-1543-4dd9-8844-26e9d003efb1",
      "name": "Contract Review Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        992,
        928
      ]
    },
    {
      "id": "c7f00a95-affb-43e8-9cd1-bbe492bad09c",
      "name": "Contract Review Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        992,
        1136
      ]
    },
    {
      "id": "8718bafd-56e2-4261-a105-d7182dc2c299",
      "name": "Compliance Validation Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1280,
        928
      ]
    },
    {
      "id": "a9b0bf2c-7f74-4172-a971-1e045c4f67ef",
      "name": "Compliance Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1232,
        1136
      ]
    },
    {
      "id": "af509a3c-75cd-4da0-8f8c-64b6c0375c0f",
      "name": "Regulatory Database Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1424,
        1136
      ]
    },
    {
      "id": "1b9e919f-b632-4bb8-8dc6-d8c4b89bad1e",
      "name": "Slack Alert Tool",
      "type": "n8n-nodes-base.slackTool",
      "position": [
        1568,
        928
      ]
    },
    {
      "id": "f6d3dfdb-32a4-472e-8bf4-3c67f1a9aa29",
      "name": "Route by Risk Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        1984,
        880
      ]
    },
    {
      "id": "4647641e-2198-4b7b-8cd5-bd01c7ec31b2",
      "name": "Prepare Critical Alert",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        832
      ]
    },
    {
      "id": "dd2d5d77-345b-4ae0-93f5-c95fb32ebc55",
      "name": "Prepare High Risk Alert",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        1024
      ]
    },
    {
      "id": "80a9ad58-61a8-4f29-a485-b11f3e647979",
      "name": "Prepare Standard Review",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        1216
      ]
    },
    {
      "id": "74bb6062-c08d-41a7-9c78-9c3aba06ed22",
      "name": "Track Contract Reviews",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2656,
        816
      ]
    },
    {
      "id": "b45d496d-eda6-4e05-9ef4-ed69f6df89c0",
      "name": "Prepare Audit Record",
      "type": "n8n-nodes-base.set",
      "position": [
        2464,
        1024
      ]
    },
    {
      "id": "9647d447-a83a-4b36-9173-df7b42cefcfc",
      "name": "Store Risk Clauses",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3104,
        1056
      ]
    },
    {
      "id": "0abd9451-e1f9-42c3-b678-54977f037ac2",
      "name": "Split Risk Clauses",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2656,
        1056
      ]
    },
    {
      "id": "24fd1714-6109-46ba-af03-e508ed796eb3",
      "name": "Check Approval Required",
      "type": "n8n-nodes-base.if",
      "position": [
        2880,
        816
      ]
    },
    {
      "id": "44f9787b-863a-42d3-9a29-928e12f2e2ed",
      "name": "Log Approval Decision",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3328,
        752
      ]
    },
    {
      "id": "9bf79d50-049a-48ee-b2eb-7e8eada22054",
      "name": "Prepare Final Summary",
      "type": "n8n-nodes-base.set",
      "position": [
        3552,
        816
      ]
    },
    {
      "id": "25751ace-bef8-4b78-a66e-7946b5d615d7",
      "name": "Prepare Risk Clause Record",
      "type": "n8n-nodes-base.set",
      "position": [
        2880,
        1056
      ]
    },
    {
      "id": "47becb91-2724-4b93-a7bf-006b2e3724ba",
      "name": "Prepare Approval Log",
      "type": "n8n-nodes-base.set",
      "position": [
        3104,
        752
      ]
    },
    {
      "id": "80900f43-f92c-4af3-be16-09a272ab9b89",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2432,
        624
      ],
      "parameters": {
        "width": 592,
        "height": 768,
        "content": "\n## Audit Record, Approval Tracking & Risk Clause Storage\n**Why** — Generates auditable records for every contract, checks approval requirements, logs decisions, and stores extracted risk clauses sepa"
      }
    },
    {
      "id": "45ffe489-f45f-4f08-b2f1-892ae23548a5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        816
      ],
      "parameters": {
        "width": 2224,
        "height": 592,
        "content": "## Compliance Validation & Risk Routing\n**Why** — Cross-references clauses against live regulatory data, then routes contracts by risk level — critical, high, or standard — ensuring proportionate resp"
      }
    },
    {
      "id": "6b0f31c3-29e9-4608-a0e7-3dab48c98dea",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        272
      ],
      "parameters": {
        "width": 1216,
        "height": 512,
        "content": "## Contract Upload, Extraction & Governance Orchestration\n**Why** — Webhook ingestion and text extraction feed the Legal Governance Agent, which coordinates Contract Review, Compliance Validation, and"
      }
    },
    {
      "id": "3183e5ce-295a-414c-8ccf-b6ed498a200a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3056,
        576
      ],
      "parameters": {
        "width": 672,
        "height": 768,
        "content": "## Prepare Final Summary\n**Why** — Consolidates review outcomes, approval status, and risk findings into a single structured summary for stakeholders.\n"
      }
    },
    {
      "id": "498cdd99-742a-483f-b85b-2bb85ea510b9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -64
      ],
      "parameters": {
        "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 "
      }
    },
    {
      "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 "
      }
    },
    {
      "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 up"
      }
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}