{
  "id": "HYOpIEXLFrGPvvGt",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Tracking Legal Risks & Litigation Threats with Bright Data & n8n",
  "tags": [],
  "nodes": [
    {
      "id": "050ecff7-23c6-4d2a-bcd6-cdd5ce472a47",
      "name": "Start Legal Scan",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -4464,
        912
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b9160154-5e68-4fe3-94cb-691417f1a145",
      "name": "Scenario Configuration Loader",
      "type": "n8n-nodes-base.set",
      "position": [
        -4272,
        912
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ba6ae02d-56f8-4d3c-a24e-809889d6596b",
              "name": "scenario_types",
              "type": "array",
              "value": "[\"litigation_monitoring\"]"
            },
            {
              "id": "1cd8ce78-54ab-4df0-a360-a21ae35cc72c",
              "name": "companies",
              "type": "array",
              "value": "[\"Google\",\"Amazon\",\"Meta\"]"
            },
            {
              "id": "d56a5342-0df2-4602-ad9c-4fe159d8a2c1",
              "name": "target_company",
              "type": "string",
              "value": "OpenAI"
            },
            {
              "id": "8af6735f-5e60-464d-93d9-122c3c4a201f",
              "name": "jurisdictions",
              "type": "string",
              "value": "United States"
            },
            {
              "id": "6b225511-38ee-401d-904a-2aef4fd1aa03",
              "name": "courts",
              "type": "array",
              "value": "[\"U.S. District Court SDNY\",\"U.S. District Court ND California\",\"U.S. Supreme Court\"]"
            },
            {
              "id": "845ef686-9163-41fc-9cbf-5e3884e7ea8d",
              "name": "regulators",
              "type": "array",
              "value": "[\"SEC\",\"FTC\",\"DOJ Antitrust Division\",\"CFPB\"]"
            },
            {
              "id": "cb8f2ff8-5200-4d17-b365-5d333b002c77",
              "name": "legal_topics",
              "type": "array",
              "value": "[\"antitrust\",\"securities\",\"data privacy\",\"consumer protection\",\"labor law\"]"
            },
            {
              "id": "50172f4a-aa1c-4645-86db-ad7b09148070",
              "name": "batch_mode",
              "type": "boolean",
              "value": true
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0f9d0e61-cb8a-4035-82b6-135561dd63c5",
      "name": "Scenario Router \u2013 Litigation Monitoring",
      "type": "n8n-nodes-base.if",
      "position": [
        -3680,
        912
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "18cbb73a-a367-496e-a870-57a9c6c51f68",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.scenario_types.includes(\"litigation_monitoring\") }}\n",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.3
    },
    {
      "id": "e9728472-19f7-4d25-9565-b741367a36b8",
      "name": "Company \u00d7 Court Matrix Expander",
      "type": "n8n-nodes-base.code",
      "position": [
        -3424,
        768
      ],
      "parameters": {
        "jsCode": "const input = items[0].json;\n\nconst out = [];\n\nfor (const company of input.companies) {\n  for (const court of input.courts) {\n    out.push({\n      json: {\n        ...input,\n        companies: company,\n        courts: court\n      }\n    });\n  }\n}\n\nreturn out;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "abef017c-0a7d-401f-ab82-eec3318a57d7",
      "name": "Search Query & URL Builder",
      "type": "n8n-nodes-base.code",
      "position": [
        -3216,
        768
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n\n  const company = item.json.companies;\n  const court = item.json.courts;\n\n  const query = `${company} ${court} lawsuit`;\n\n  const searchUrl =\n    'https://www.google.com/search?q=' +\n    encodeURIComponent(query);\n\n  return {\n    json: {\n      ...item.json,\n      search_query: query,\n      search_url: searchUrl\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ba78d6b3-798f-4bb6-88c9-c967954357d8",
      "name": "Bright Data Error Formatter",
      "type": "n8n-nodes-base.set",
      "position": [
        -2544,
        1008
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4f8f57ce-73db-42bc-9fa4-294fec6c7d9e",
              "name": "errorSource",
              "type": "string",
              "value": "Bright Data Scraper"
            },
            {
              "id": "37d40aca-228d-4fd6-abc4-6dceac00692e",
              "name": "errorMessage",
              "type": "string",
              "value": "={{$json.error?.message || $json.message || 'Unknown Bright Data Error'}}"
            },
            {
              "id": "99865e11-6ac4-46b3-b5bb-69e9d9f09ae1",
              "name": "errorCode",
              "type": "string",
              "value": "={{$json.statusCode || $json.code || 'N/A'}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "57df20a7-4780-4196-850c-59bb7f187175",
      "name": "Error Log \u2013 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2304,
        1008
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "={{ $json.errorSource }}",
            "error_code": "={{ $json.errorCode }}",
            "error_message": "={{ $json.errorMessage }}"
          },
          "schema": [
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error_message",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "error_message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "error_code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "error_code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1673422217,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit#gid=1673422217",
          "cachedResultName": "BD log error"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit?usp=drivesdk",
          "cachedResultName": "1. Bright Data Legal Risk & Litigation Early\u2011Warning Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a40b555e-a114-41f1-ac62-a2d5989ef285",
      "name": "HTML Extractor \u2013 Titles, Links, Snippets",
      "type": "n8n-nodes-base.html",
      "position": [
        -2544,
        480
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "dataPropertyName": "body",
        "extractionValues": {
          "values": [
            {
              "key": "titles",
              "cssSelector": "h3",
              "returnArray": true
            },
            {
              "key": "link",
              "attribute": "href",
              "cssSelector": "a:has(h3)",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "snippet",
              "cssSelector": "div.VwiC3b",
              "returnArray": true
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "965d2396-1b69-46f4-8952-52a112ac89ac",
      "name": "Search Result Normalizer",
      "type": "n8n-nodes-base.code",
      "position": [
        -2304,
        480
      ],
      "parameters": {
        "jsCode": "const finalResults = [];\n\nfor (const item of items) {\n  \n  const titles = item.json.titles || [];\n  const links = item.json.link || [];\n  const snippets = item.json.snippet || [];\n\n  const maxLength = Math.max(titles.length, links.length, snippets.length);\n\n  for (let i = 0; i < maxLength; i++) {\n\n    if (!links[i]) continue; // null ya empty links skip\n\n    finalResults.push({\n      json: {\n        title: titles[i] || null,\n        link: links[i] || null,\n        snippet: snippets[i] || null,\n        source: \"Google\",\n        extracted_at: new Date().toISOString()\n      }\n    });\n\n  }\n}\n\nreturn finalResults;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "f760a441-4287-45c4-8317-2e24af2967e8",
      "name": "Legal Signal Keyword Scorer",
      "type": "n8n-nodes-base.code",
      "position": [
        -2080,
        480
      ],
      "parameters": {
        "jsCode": "const legalKeywords = [\n  \"v.\", \"vs.\", \"court\", \"district\", \"supreme\",\n  \"complaint\", \"order\", \"ruling\", \"injunction\",\n  \"settlement\", \"antitrust\", \"lawsuit\", \"litigation\",\n  \"filed\", \"motion\", \"dismiss\", \"appeal\"\n];\n\nlet scored = items.map(item => {\n  let score = 0;\n  const text = (item.json.title + \" \" + item.json.snippet).toLowerCase();\n\n  legalKeywords.forEach(keyword => {\n    if (text.includes(keyword)) score += 2;\n  });\n\n  if (item.json.link.includes(\".pdf\")) score += 3;\n  if (item.json.link.includes(\"court\")) score += 3;\n  if (item.json.link.includes(\"gov\")) score += 3;\n\n  item.json.legal_score = score;\n  return item;\n});\n\n// sort by score descending\nscored.sort((a,b) => b.json.legal_score - a.json.legal_score);\n\n// keep only high value\nreturn scored.slice(0, 5);\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1e94c83f-391d-47b2-8b30-64fda68b987a",
      "name": "AI Legal Case Classifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1808,
        480
      ],
      "parameters": {
        "text": "=Input:\nTitle: {{ $json.title }}\nLink: {{ $json.link }}\nSnippet: {{ $json.snippet }}",
        "options": {
          "systemMessage": "You are a legal intelligence classifier.\n\nFor each result:\n1. Determine if this is an actual legal case, regulatory action, or official court filing.\n2. Classify the legal topic.\n3. Identify jurisdiction if possible.\n4. Identify court level (district, appellate, supreme, regulator).\n5. Assign risk level: LOW / MEDIUM / HIGH.\n6. Mark primary_source = true if official court/government site.\n\nReturn structured JSON only."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "0b5d3eed-3842-439a-a951-5d5dac1d151b",
      "name": "Legal Classification Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1648,
        736
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"is_legal_case\": {\n      \"type\": \"boolean\"\n    },\n    \"type\": {\n      \"type\": \"string\",\n      \"enum\": [\"legal_case\", \"regulatory_action\", \"court_filing\", \"other\"]\n    },\n    \"title\": {\n      \"type\": \"string\"\n    },\n    \"citation\": {\n      \"type\": \"string\"\n    },\n    \"date\": {\n      \"type\": \"string\"\n    },\n    \"legal_topic\": {\n      \"type\": \"string\"\n    },\n    \"jurisdiction\": {\n      \"type\": \"string\"\n    },\n    \"court_level\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"Supreme Court\",\n        \"Appellate Court\",\n        \"District Court\",\n        \"State Supreme Court\",\n        \"Federal Agency\",\n        \"Other\"\n      ]\n    },\n    \"risk_level\": {\n      \"type\": \"string\",\n      \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\"]\n    },\n    \"primary_source\": {\n      \"type\": \"boolean\"\n    },\n    \"source_url\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"is_legal_case\",\n    \"legal_topic\",\n    \"jurisdiction\",\n    \"court_level\",\n    \"risk_level\",\n    \"primary_source\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "297608bb-ff47-43c0-bdc8-4be1440e4ea1",
      "name": "Duplicate Legal Event Filter",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -1456,
        480
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "output.title, output.source_url"
      },
      "typeVersion": 2
    },
    {
      "id": "42dc9f84-4541-4b06-b0a9-2bea3bd5975f",
      "name": "Legal Event Normalizer & Confidence Scorer",
      "type": "n8n-nodes-base.code",
      "position": [
        -1248,
        480
      ],
      "parameters": {
        "jsCode": "// ===============================\n// Legal Signal Engine \u2013 Stage 1\n// Parsing + Normalization + Confidence Scoring\n// ===============================\n\nfunction safeDate(dateStr) {\n  if (!dateStr) return null;\n  const d = new Date(dateStr);\n  return isNaN(d.getTime()) ? null : d.toISOString().split(\"T\")[0];\n}\n\nfunction computeConfidence(record) {\n  let score = 50; // base score\n\n  if (record.primary_source) score += 20;\n  if (record.court_level === \"Supreme Court\") score += 15;\n  if (record.risk_level === \"HIGH\") score += 10;\n  if (record.citation && record.citation.length > 0) score += 5;\n  if (record.source_url && record.source_url.startsWith(\"https\")) score += 5;\n\n  if (score > 100) score = 100;\n\n  let band = \"LOW\";\n  if (score >= 80) band = \"HIGH\";\n  else if (score >= 60) band = \"MEDIUM\";\n\n  return { score, band };\n}\n\nconst normalizedResults = [];\n\nfor (const item of $input.all()) {\n\n  let raw = item.json.output;\n\n  // Safety guard\n  if (!raw || raw.is_legal_case !== true) continue;\n\n  const normalized = {\n    event_id: raw.source_url ? raw.source_url.toLowerCase() : null,\n    title: raw.title || null,\n    citation: raw.citation || null,\n    filing_date: safeDate(raw.date),\n    legal_topic: raw.legal_topic || \"Unknown\",\n    jurisdiction: raw.jurisdiction || \"Unknown\",\n    court_level: raw.court_level || \"Unknown\",\n    risk_level: raw.risk_level || \"UNKNOWN\",\n    primary_source: raw.primary_source === true,\n    source_url: raw.source_url || null,\n    event_type: raw.type || \"legal_event\",\n    ingestion_timestamp: new Date().toISOString()\n  };\n\n  const confidence = computeConfidence(normalized);\n\n  normalizedResults.push({\n    normalized_legal_event: normalized,\n    confidence_score: confidence.score,\n    confidence_band: confidence.band\n  });\n}\n\nreturn normalizedResults;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "dfda4edd-9cdf-4097-a671-3bf35744cc0f",
      "name": "High-Risk Legal Event Gate",
      "type": "n8n-nodes-base.if",
      "position": [
        -1040,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "ec0fb99b-7179-4e3d-be8c-bde895921cf9",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.normalized_legal_event.risk_level }}",
              "rightValue": "HIGH"
            },
            {
              "id": "7fb6396b-d3a0-4163-99de-0fb6083772d6",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.confidence_score }}",
              "rightValue": 70
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "fee88595-072e-418f-8c64-cfe39f5f03dc",
      "name": "Legal Correlation & Clustering Engine",
      "type": "n8n-nodes-base.code",
      "position": [
        -528,
        144
      ],
      "parameters": {
        "jsCode": "// =============================\n// LEGAL CORRELATION LAYER\n// Jurisdiction + Topic Clustering\n// =============================\n\nconst jurisdictionClusters = {};\nconst topicClusters = [];\nconst correlatedEvents = [];\n\n// Normalize helper\nfunction normalizeKey(value) {\n  if (!value) return \"UNKNOWN\";\n  return value.toString().trim().toLowerCase();\n}\n\n// Step 1: Collect + Cluster\nfor (const item of $input.all()) {\n\n  const record = item.json;\n  const event = record.normalized_legal_event;\n\n  if (!event) continue;\n\n  const jurisdictionKey = normalizeKey(event.jurisdiction);\n  const topicKey = normalizeKey(event.legal_topic);\n\n  // ----------------------------\n  // Jurisdiction Clustering\n  // ----------------------------\n  if (!jurisdictionClusters[jurisdictionKey]) {\n    jurisdictionClusters[jurisdictionKey] = {\n      jurisdiction: event.jurisdiction || \"UNKNOWN\",\n      total_events: 0,\n      high_risk_count: 0,\n      events: []\n    };\n  }\n\n  jurisdictionClusters[jurisdictionKey].total_events += 1;\n\n  if (event.risk_level === \"HIGH\") {\n    jurisdictionClusters[jurisdictionKey].high_risk_count += 1;\n  }\n\n  jurisdictionClusters[jurisdictionKey].events.push(event);\n\n  // ----------------------------\n  // Topic Clustering\n  // ----------------------------\n  let topicCluster = topicClusters.find(\n    t => normalizeKey(t.topic) === topicKey\n  );\n\n  if (!topicCluster) {\n    topicCluster = {\n      topic: event.legal_topic || \"UNKNOWN\",\n      total_events: 0,\n      jurisdictions: [],\n      events: []\n    };\n    topicClusters.push(topicCluster);\n  }\n\n  topicCluster.total_events += 1;\n\n  if (!topicCluster.jurisdictions.includes(event.jurisdiction)) {\n    topicCluster.jurisdictions.push(event.jurisdiction);\n  }\n\n  topicCluster.events.push(event);\n\n  // ----------------------------\n  // Correlated Event Record\n  // ----------------------------\n  correlatedEvents.push({\n    event_id: event.event_id,\n    title: event.title,\n    jurisdiction: event.jurisdiction,\n    legal_topic: event.legal_topic,\n    risk_level: event.risk_level,\n    confidence_score: record.confidence_score\n  });\n}\n\n// =============================\n// RETURN STRUCTURED CORRELATION\n// =============================\n\nreturn [\n  {\n    json: {\n      correlated_events: correlatedEvents,\n      jurisdiction_clusters: jurisdictionClusters,\n      topic_clusters: topicClusters\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "41b622ae-8cce-413a-9360-5bb9d5bbebf5",
      "name": "Litigation Events Extractor",
      "type": "n8n-nodes-base.set",
      "position": [
        -128,
        -176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b4fdd60d-0b55-4283-8221-292aa216b708",
              "name": "litigation_events",
              "type": "array",
              "value": "={{ $json.correlated_events }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bd9974ab-ff01-4761-b164-2c10fd90a079",
      "name": "Litigation Event Splitter",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        112,
        -176
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "litigation_events"
      },
      "typeVersion": 1
    },
    {
      "id": "60b28130-4882-4072-8378-579da8e0e509",
      "name": "High-Risk Escalation Filter",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        -176
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1336c2fd-e3af-4072-9376-08e6997042e2",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.risk_level }}",
              "rightValue": "HIGH"
            },
            {
              "id": "7cccfb82-3bcd-4a99-b255-af555c529ea3",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.confidence_score }}",
              "rightValue": 70
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "256723e6-fb94-4ab3-96c4-16412fd839df",
      "name": "Monitoring Branch Placeholder",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -528,
        880
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "eab0f4dc-8ffb-46b7-977e-ffaeb828dab9",
      "name": "High-Risk Alerts \u2013 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1264,
        -544
      ],
      "parameters": {
        "columns": {
          "value": {
            "case_name": "={{ $json.output.case_name }}",
            "risk_level": "={{ $json.output.risk_level }}",
            "alert_title": "={{ $json.output.alert_title }}",
            "jurisdiction": "={{ $json.output.jurisdiction }}",
            "market_impact": "={{ $json.output.business_impact.market_impact }}",
            "financial_risk": "={{ $json.output.exposure.financial_risk }}",
            "resource_impact": "={{ $json.output.business_impact.resource_impact }}",
            "structural_risk": "={{ $json.output.exposure.structural_risk }}",
            "judicial_profile": "={{ $json.output.jurisdiction_risk.judicial_profile }}",
            "plaintiff_profile": "={{ $json.output.jurisdiction_risk.plaintiff_profile }}",
            "regulatory_impact": "={{ $json.output.business_impact.regulatory_impact }}",
            "reputational_risk": "={{ $json.output.exposure.reputational_risk }}",
            "court_significance": "={{ $json.output.jurisdiction_risk.court_significance }}",
            "operational_impact": "={{ $json.output.business_impact.operational_impact }}",
            "recommended_action": "={{ $json.output.recommended_action }}"
          },
          "schema": [
            {
              "id": "alert_title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "alert_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "case_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "case_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "jurisdiction",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "jurisdiction",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "financial_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "financial_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "structural_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "structural_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reputational_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reputational_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "court_significance",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "court_significance",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "judicial_profile",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "judicial_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "plaintiff_profile",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "plaintiff_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "operational_impact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "operational_impact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "market_impact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "market_impact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "regulatory_impact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "regulatory_impact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "resource_impact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "resource_impact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recommended_action",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "recommended_action",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 597519032,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit#gid=597519032",
          "cachedResultName": "High Risk Alerts"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit?usp=drivesdk",
          "cachedResultName": "1. Bright Data Legal Risk & Litigation Early\u2011Warning Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bcf346b4-ba2d-4eee-912f-6e0bc125d4d5",
      "name": "High-Risk Alert Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1056,
        -304
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"alert_title\": {\n      \"type\": \"string\"\n    },\n    \"case_name\": {\n      \"type\": \"string\"\n    },\n    \"jurisdiction\": {\n      \"type\": \"string\"\n    },\n    \"risk_level\": {\n      \"type\": \"string\",\n      \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\"]\n    },\n    \"exposure\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"financial_risk\": { \"type\": \"string\" },\n        \"structural_risk\": { \"type\": \"string\" },\n        \"reputational_risk\": { \"type\": \"string\" }\n      },\n      \"required\": [\"financial_risk\"]\n    },\n    \"jurisdiction_risk\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"court_significance\": { \"type\": \"string\" },\n        \"judicial_profile\": { \"type\": \"string\" },\n        \"plaintiff_profile\": { \"type\": \"string\" }\n      }\n    },\n    \"business_impact\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"operational_impact\": { \"type\": \"string\" },\n        \"market_impact\": { \"type\": \"string\" },\n        \"regulatory_impact\": { \"type\": \"string\" },\n        \"resource_impact\": { \"type\": \"string\" }\n      }\n    },\n    \"recommended_action\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"alert_title\",\n    \"case_name\",\n    \"jurisdiction\",\n    \"risk_level\",\n    \"exposure\",\n    \"business_impact\",\n    \"recommended_action\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "648901d4-b158-4d38-908e-6a6b57581a38",
      "name": "AI High-Risk Litigation Alert Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        912,
        -544
      ],
      "parameters": {
        "text": "=Event:\n{{ JSON.stringify($json) }}",
        "options": {
          "systemMessage": "Summarize this litigation escalation for a legal executive.\nFocus on exposure, jurisdiction risk and business impact."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "b7674cdf-319e-4912-9a30-4dd0a58397c1",
      "name": "Monitoring Event Aggregator",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        896,
        96
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "monitoring_events"
      },
      "typeVersion": 1
    },
    {
      "id": "d6cb0bc1-839e-44af-8990-de03d45c1eec",
      "name": "AI Litigation Monitoring Summary Generator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1104,
        96
      ],
      "parameters": {
        "text": "=Monitoring Events:\n{{ JSON.stringify($json.monitoring_events) }}\n\nGenerate a concise ongoing litigation & enforcement monitoring brief.\nFocus on:\n- New developments\n- Medium-risk patterns\n- Repeated jurisdictions\n- Escalation signals\n- Watchlist recommendation\n",
        "options": {
          "systemMessage": "You are a legal monitoring analyst.\nSummarize ongoing litigation events for monitoring purposes.\nHighlight trends, jurisdiction concentration, and potential escalation risk.\nKeep it executive-ready and concise.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "5571278f-4336-4144-9d2c-4a3e4ec3b114",
      "name": "Monitoring Summary Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1248,
        320
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"brief_title\": {\n      \"type\": \"string\"\n    },\n    \"key_developments\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"jurisdiction_concentration\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"primary_jurisdictions\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"concentration_risk_level\": {\n          \"type\": \"string\",\n          \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\"]\n        }\n      },\n      \"required\": [\"primary_jurisdictions\", \"concentration_risk_level\"]\n    },\n    \"risk_patterns\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"escalation_signals\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"business_impact_summary\": {\n      \"type\": \"string\"\n    },\n    \"watchlist_recommendation\": {\n      \"type\": \"string\"\n    },\n    \"overall_monitoring_risk_level\": {\n      \"type\": \"string\",\n      \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\"]\n    }\n  },\n  \"required\": [\n    \"brief_title\",\n    \"key_developments\",\n    \"jurisdiction_concentration\",\n    \"escalation_signals\",\n    \"watchlist_recommendation\",\n    \"overall_monitoring_risk_level\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6fcc35be-516d-4a89-94d4-9b7b99ca1cb1",
      "name": "Monitoring Summary \u2013 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1456,
        96
      ],
      "parameters": {
        "columns": {
          "value": {
            "brief_title": "={{ $json.output.brief_title }}",
            "risk_patterns": "={{ $json.output.risk_patterns }}",
            "key_developments": "={{ $json.output.key_developments }}",
            "escalation_signals": "={{ $json.output.escalation_signals }}",
            "primary_jurisdictions": "={{ $json.output.jurisdiction_concentration.primary_jurisdictions }}",
            "business_impact_summary": "={{ $json.output.business_impact_summary }}",
            "concentration_risk_level": "={{ $json.output.jurisdiction_concentration.concentration_risk_level }}",
            "watchlist_recommendation": "={{ $json.output.watchlist_recommendation }}",
            "overall_monitoring_risk_level": "={{ $json.output.overall_monitoring_risk_level }}"
          },
          "schema": [
            {
              "id": "brief_title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "brief_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "key_developments",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "key_developments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "primary_jurisdictions",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "primary_jurisdictions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "concentration_risk_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "concentration_risk_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_patterns",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_patterns",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "escalation_signals",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "escalation_signals",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "business_impact_summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "business_impact_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "watchlist_recommendation",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "watchlist_recommendation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "overall_monitoring_risk_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "overall_monitoring_risk_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit#gid=0",
          "cachedResultName": "Monitoring summary"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit?usp=drivesdk",
          "cachedResultName": "1. Bright Data Legal Risk & Litigation Early\u2011Warning Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "0cd6e982-4f40-4780-ad55-900af3dd2c09",
      "name": "AI M&A Legal Exposure Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -96,
        416
      ],
      "parameters": {
        "text": "=Correlated Events:\n{{ JSON.stringify($json.correlated_events) }}\n\nJurisdiction Clusters:\n{{ JSON.stringify($json.jurisdiction_clusters) }}\n\nTopic Clusters:\n{{ JSON.stringify($json.topic_clusters) }}\n\nGenerate an M&A / partnership legal exposure assessment.\n\nFocus on:\n- Concentration risk\n- High-risk litigation exposure\n- Jurisdictional dependency risk\n- Regulatory & structural threats\n- Red flags for due diligence\n- Overall transaction risk rating\n- Clear recommendation: PROCEED / PROCEED WITH CAUTION / HIGH RISK\n",
        "options": {
          "systemMessage": "You are a senior M&A legal risk advisor.\nAssess transaction exposure using litigation concentration, high-risk cases, and regulatory clustering.\nBe structured, executive-ready, and transaction-focused.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "27cc281d-9da8-4a20-909f-dfc090322204",
      "name": "M&A Exposure Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        80,
        656
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"report_type\": { \"type\": \"string\" },\n    \"overall_transaction_risk\": { \"type\": \"string\" },\n    \"risk_drivers\": {\n      \"type\": \"array\",\n      \"items\": { \"type\": \"string\" }\n    },\n    \"high_risk_cases\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"event_id\": { \"type\": \"string\" },\n          \"jurisdiction\": { \"type\": \"string\" },\n          \"legal_topic\": { \"type\": \"string\" },\n          \"risk_level\": { \"type\": \"string\" }\n        },\n        \"required\": [\"event_id\", \"jurisdiction\", \"legal_topic\", \"risk_level\"]\n      }\n    },\n    \"jurisdiction_concentration_risk\": { \"type\": \"string\" },\n    \"topic_concentration_risk\": { \"type\": \"string\" },\n    \"structural_regulatory_risk\": { \"type\": \"string\" },\n    \"due_diligence_red_flags\": {\n      \"type\": \"array\",\n      \"items\": { \"type\": \"string\" }\n    },\n    \"recommended_transaction_posture\": { \"type\": \"string\" }\n  },\n  \"required\": [\n    \"report_type\",\n    \"overall_transaction_risk\",\n    \"risk_drivers\",\n    \"recommended_transaction_posture\"\n  ]\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e4956878-3f1b-4aea-b5c4-76667da23bfd",
      "name": "M&A Exposure \u2013 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        256,
        416
      ],
      "parameters": {
        "columns": {
          "value": {
            "event_id": "={{ $json.output.high_risk_cases[0].event_id }}",
            "risk_level": "={{ $json.output.high_risk_cases[0].risk_level }}",
            "legal_topic": "={{ $json.output.high_risk_cases[0].legal_topic }}",
            "report_type": "={{ $json.output.report_type }}",
            "jurisdiction": "={{ $json.output.high_risk_cases[0].jurisdiction }}",
            "risk_drivers": "={{ $json.output.risk_drivers }}",
            "due_diligence_red_flags": "={{ $json.output.due_diligence_red_flags }}",
            "overall_transaction_risk": "={{ $json.output.overall_transaction_risk }}",
            "topic_concentration_risk": "={{ $json.output.topic_concentration_risk }}",
            "structural_regulatory_risk": "={{ $json.output.structural_regulatory_risk }}",
            "jurisdiction_concentration_risk": "={{ $json.output.jurisdiction_concentration_risk }}",
            "recommended_transaction_posture": "={{ $json.output.recommended_transaction_posture }}"
          },
          "schema": [
            {
              "id": "report_type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "report_type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "overall_transaction_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "overall_transaction_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_drivers",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_drivers",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "event_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "event_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "jurisdiction",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "jurisdiction",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "legal_topic",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "legal_topic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "risk_level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "risk_level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "jurisdiction_concentration_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "jurisdiction_concentration_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "topic_concentration_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "topic_concentration_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "structural_regulatory_risk",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "structural_regulatory_risk",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "due_diligence_red_flags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "due_diligence_red_flags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recommended_transaction_posture",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "recommended_transaction_posture",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1493454151,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit#gid=1493454151",
          "cachedResultName": "M&A / Partnership Legal Exposure Scan"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BnK0JLPzm5NK82cOb0zIcNvgNe2UyrPOrPuaxwsD4vg/edit?usp=drivesdk",
          "cachedResultName": "1. Bright Data Legal Risk & Litigation Early\u2011Warning Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b7b4688c-f48d-409a-bb47-9f9777d982e1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5248,
        96
      ],
      "parameters": {
        "color": 4,
        "width": 432,
        "height": 608,
        "content": "##  Legal Risk & Litigation Intelligence Orchestration Engine\n\nThis workflow monitors companies across courts, regulators, and jurisdictions to detect, classify, and correlate legal risk signals.\n\nIt:\n\n- Scrapes litigation data via Bright Data\n- Filters and scores real legal events\n- Applies AI-based classification and confidence scoring\n- Clusters by jurisdiction and legal topic\n- Generates executive-ready legal intelligence outputs\n\nOutput:\n\u2022 High-Risk Litigation Alerts  \n\u2022 Ongoing Monitoring Briefs  \n\nWhat you need:\n- Bright Data account (for web scraping)\n- OpenRouter API key (for AI analysis)\n- Google Sheets (for output dashboards)\n\nBuilt for strategic legal risk oversight and decision-grade intelligence.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5fcdfe06-dbb8-4fcb-bf16-0d0b71d12c2c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3408,
        432
      ],
      "parameters": {
        "color": 3,
        "width": 432,
        "height": 240,
        "content": "## Multi-Source Legal Data Collection\n\n- Expands companies \u00d7 courts matrix\n- Generates structured search queries\n- Scrapes Google via Bright Data\n- Extracts titles, links, snippets\n- Logs scraper errors automatically\n\nCreates the raw legal signal pipeline.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e5ae0ebd-b5a8-4868-b87d-42f10fd39412",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2192,
        128
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 272,
        "content": "## Legal Signal Filtering & AI Classification\n\n- Scores keyword-based legal relevance\n- Validates real court / regulatory cases\n- Classifies legal topic & jurisdiction\n- Assigns risk level (LOW / MEDIUM / HIGH)\n- Flags primary government sources\n\nRemoves noise and structures legal events.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c49c8bce-e77b-4df9-9097-be75b18750e8",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 240,
        "content": "## Normalization & Confidence Scoring\n\n- Standardizes legal event structure\n- Calculates confidence score (0\u2013100)\n- Applies court-level weighting\n- Filters high-risk escalations\n- Removes duplicate events\n\nEnsures reliability and audit integrity.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f0f3d817-55f8-4f27-9e9a-ff10dcf42883",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -464
      ],
      "parameters": {
        "color": 6,
        "width": 432,
        "height": 240,
        "content": "## Correlation & Risk Clustering\n\n- Clusters by jurisdiction concentration\n- Groups events by legal topic\n- Detects litigation density patterns\n- Identifies structural exposure risks\n- Surfaces concentration red flags\n\nReveals systemic legal vulnerability.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "bef4bad2-93dc-4437-812e-2df7ac8f2156",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -848
      ],
      "parameters": {
        "color": 2,
        "width": 432,
        "height": 240,
        "content": "## Executive Intelligence Outputs\n\nGenerates structured reports for:\n\n\u2022 High-Risk Escalation Alerts  \n\u2022 Litigation Monitoring Briefs  \n\nTransforms legal signals into board-ready decisions.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b3e89fe8-1c3d-4df5-ba80-82ec0a675619",
      "name": "Scrape Legal Data (Bright Data)",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "onError": "continueErrorOutput",
      "position": [
        -2976,
        768
      ],
      "parameters": {
        "url": "={{ $json.search_url }}",
        "zone": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_unlocker"
        },
        "format": "json",
        "country": {
          "__rl": true,
          "mode": "list",
          "value": "us"
        },
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "cf7b4480-84a8-496c-b02a-efaec72a8fa5",
      "name": "Legal Case Classifier",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1856,
        736
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2acfbab9-65a4-4933-b00b-5f2579c08768",
      "name": "M&A Exposure Analyzer",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -96,
        656
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "78f8d967-f9dd-4226-b714-f74da673ac9d",
      "name": "Monitoring Summary Generator",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1104,
        320
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "194eaad8-23c8-425b-9131-155d3fce4d79",
      "name": "High-Risk Alert Generator",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        864,
        -304
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6d1cdb8f-c69b-4587-aa29-d3cd7d5fd569",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5232,
        784
      ],
      "parameters": {
        "color": 3,
        "width": 512,
        "height": 480,
        "content": "## Setup Instructions\n\nBefore running this workflow, configure the following credentials in n8n:\n\n**1. Bright Data API** \u2014 Required for web scraping\n- Sign up at brightdata.com\n- Create an API token\n- Add as \"BrightData account\" credential in n8n\n\n**2. OpenRouter API** \u2014 Required for AI classification\n- Sign up at openrouter.ai\n- Generate an API key\n- Add as \"OpenRouter account\" credential in n8n\n\n**3. Google Sheets OAuth** \u2014 Required for output logging\n- Connect your Google account in n8n\n- See the **Google Sheets Setup** sticky note for required tabs and columns\n- Update each Google Sheets node to point to your new spreadsheet\n\nAfter connecting credentials, edit the configuration node to set your target companies, URLs, or parameters."
      },
      "typeVersion": 1
    },
    {
      "id": "ac798d90-56bf-45bf-9b17-d48f4cb7bccf",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4080,
        608
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "height": 272,
        "content": "Customize Here\n\nEdit this node to set:\n- companies: List of companies to monitor\n- jurisdictions: Country/region focus\n- courts: Specific courts to track\n- regulators: Regulatory bodies to monitor\n- legal_topics: Legal areas to scan"
      },
      "typeVersion": 1
    },
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5248,
        1200
      ],
      "parameters": {
        "color": 5,
        "width": 520,
        "height": 780,
        "content": "## Google Sheets Setup\n\nCreate a Google Spreadsheet with 4 tabs and add these column headers in row 1:\n\n**Tab: Monitoring summary**\nbrief_title | key_developments | primary_jurisdictions | concentration_risk_level | risk_patterns | escalation_signals | business_impact_summary | watchlist_recommendation | overall_monitoring_risk_level\n\n**Tab: High Risk Alerts**\nalert_title | case_name | jurisdiction | risk_level | financial_risk | structural_risk | reputational_risk | court_significance | judicial_profile | plaintiff_profile | operational_impact | market_impact | regulatory_impact | resource_impact | recommended_action\n\n**Tab: M&A / Partnership Legal Exposure Scan**\nreport_type | overall_transaction_risk | risk_drivers | event_id | jurisdiction | legal_topic | risk_level | jurisdiction_concentration_risk | topic_concentration_risk | structural_regulatory_risk | due_diligence_red_flags | recommended_transaction_posture\n\n**Tab: BD log error**\nerror_message | error_code | status\n\nAfter creating the spreadsheet, update each Google Sheets node to point to your document and select the matching tab."
      },
      "typeVersion": 1
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5248,
        2040
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 280,
        "content": "## Rate Limiting Advisory\n\nThis workflow generates Company x Court/Regulator parallel web scraping requests via Bright Data.\n\nIf monitoring many companies across multiple jurisdictions, you may hit rate limits on:\n- Bright Data API (check your plan limits)\n- OpenRouter LLM API\n- Google Sheets API (100 requests per 100 seconds per user)\n\nConsider adding Wait nodes or batching companies in smaller groups if you experience rate-limit errors."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "ffa8a0b2-06d2-4be1-b38e-5eed70e0b005",
  "connections": {
    "Start Legal Scan": {
      "main": [
        [
          {
            "node": "Scenario Configuration Loader",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Legal Case Classifier": {
      "ai_languageModel": [
        [
          {
            "node": "AI Legal Case Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "M&A Exposure Analyzer": {
      "ai_languageModel": [
        [
          {
            "node": "AI M&A Legal Exposure Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Legal Case Classifier": {
      "main": [
        [
          {
            "node": "Duplicate Legal Event Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Result Normalizer": {
      "main": [
        [
          {
            "node": "Legal Signal Keyword Scorer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High-Risk Alert Generator": {
      "ai_languageModel": [
        [
          {
            "node": "AI High-Risk Litigation Alert Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Litigation Event Splitter": {
      "main": [
        [
          {
            "node": "High-Risk Escalation Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High-Risk Legal Event Gate": {
      "main": [
        [
          {
            "node": "Legal Correlation & Clustering Engine",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Monitoring Branch Placeholder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "M&A Exposure Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI M&A Legal Exposure Analyzer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Search Query & URL Builder": {
      "main": [
        [
          {
            "node": "Scrape Legal Data (Bright Data)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bright Data Error Formatter": {
      "main": [
        [
          {
            "node": "Error Log \u2013 Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High-Risk Escalation Filter": {
      "main": [
        [
          {
            "node": "AI High-Risk Litigation Alert Generator",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Monitoring Event Aggregator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Legal Signal Keyword Scorer": {
      "main": [
        [
          {
            "node": "AI Legal Case Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Litigation Events Extractor": {
      "main": [
        [
          {
            "node": "Litigation Event Splitter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitoring Event Aggregator": {
      "main": [
        [
          {
            "node": "AI Litigation Monitoring Summary Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Duplicate Legal Event Filter": {
      "main": [
        [
          {
            "node": "Legal Event Normalizer & Confidence Scorer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitoring Summary Generator": {
      "ai_languageModel": [
        [
          {
            "node": "AI Litigation Monitoring Summary Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "High-Risk Alert Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI High-Risk Litigation Alert Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Scenario Configuration Loader": {
      "main": [
        [
          {
            "node": "Scenario Router \u2013 Litigation Monitoring",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI M&A Legal Exposure Analyzer": {
      "main": [
        [
          {
            "node": "M&A Exposure \u2013 Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Legal Data (Bright Data)": {
      "main": [
        [
          {
            "node": "HTML Extractor \u2013 Titles, Links, Snippets",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Bright Data Error Formatter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company \u00d7 Court Matrix Expander": {
      "main": [
        [
          {
            "node": "Search Query & URL Builder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitoring Summary Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Litigation Monitoring Summary Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Legal Classification Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Legal Case Classifier",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Legal Correlation & Clustering Engine": {
      "main": [
        [
          {
            "node": "Litigation Events Extractor",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI M&A Legal Exposure Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI High-Risk Litigation Alert Generator": {
      "main": [
        [
          {
            "node": "High-Risk Alerts \u2013 Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scenario Router \u2013 Litigation Monitoring": {
      "main": [
        [
          {
            "node": "Company \u00d7 Court Matrix Expander",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Litigation Monitoring Summary Generator": {
      "main": [
        [
          {
            "node": "Monitoring Summary \u2013 Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML Extractor \u2013 Titles, Links, Snippets": {
      "main": [
        [
          {
            "node": "Search Result Normalizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Legal Event Normalizer & Confidence Scorer": {
      "main": [
        [
          {
            "node": "High-Risk Legal Event Gate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}