AutomationFlowsAI & RAG › Detect Financial Risk and Orchestrate Compliance with Gpt‑4o, Slack and Email

Detect Financial Risk and Orchestrate Compliance with Gpt‑4o, Slack and Email

ByCheng Siong Chin @cschin on n8n.io

This workflow automates comprehensive risk signal detection and regulatory compliance management across financial and claims data sources. Designed for risk management teams, compliance officers, and financial auditors, it solves the critical challenge of identifying potential…

Cron / scheduled trigger★★★★★ complexityAI-powered32 nodesHTTP RequestAgentOpenAI ChatOutput Parser StructuredEmail SendAgent ToolSlackGoogle Sheets
AI & RAG Trigger: Cron / scheduled Nodes: 32 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13141 — 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 →

Download .json
{
  "id": "xeqOB5QSx18smMC09SZVS",
  "name": "Smart Risk Assessment and Compliance Orchestration Automation System",
  "tags": [],
  "nodes": [
    {
      "id": "12ad4a65-f0b1-4b8f-8e02-7d42a1cb3426",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2416,
        432
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6e710822-eae9-477a-b8e2-f0c42fcc71d9",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -2192,
        432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "riskDataApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Risk and Exposure API Endpoint URL__>"
            },
            {
              "id": "id-2",
              "name": "claimsDataApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Claims Data API Endpoint URL__>"
            },
            {
              "id": "id-3",
              "name": "complianceEmail",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Compliance Team Email Address__>"
            },
            {
              "id": "id-4",
              "name": "riskThresholdHigh",
              "type": "number",
              "value": 75
            },
            {
              "id": "id-5",
              "name": "riskThresholdMedium",
              "type": "number",
              "value": 50
            },
            {
              "id": "id-6",
              "name": "slackChannel",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack Channel ID for Critical Alerts__>"
            },
            {
              "id": "id-7",
              "name": "auditSheetId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Google Sheets ID for Audit Trail__>"
            },
            {
              "id": "id-8",
              "name": "criticalRiskThreshold",
              "type": "number",
              "value": 90
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "253f058d-f1ac-41b7-8821-0f63ba4fd037",
      "name": "Fetch Risk Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1968,
        336
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.riskDataApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "275d2744-0db4-4b31-980b-48f60eb4d108",
      "name": "Fetch Claims Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1968,
        528
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.claimsDataApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "70a98042-01e3-4d93-8300-80c0db6d4e88",
      "name": "Merge Financial Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1744,
        432
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "0b9c93a9-d341-426f-9e5f-0058164d5fbd",
      "name": "Risk Signal Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1296,
        432
      ],
      "parameters": {
        "text": "=Risk Data: {{ JSON.stringify($json) }}",
        "options": {
          "systemMessage": "You are a Risk Signal Agent specialized in evaluating structured financial risk, exposure, and claims data from multiple systems.\n\nYour role is to:\n1. Analyze risk metrics, exposure levels, and claims history data\n2. Calculate aggregate risk scores (0-100) based on multiple factors including:\n   - Total exposure amount and concentration\n   - Claims frequency and severity trends\n   - Loss ratios and reserve adequacy\n   - Geographic and sector concentration risks\n   - Historical volatility patterns\n3. Identify risk signals and anomalies requiring attention\n4. Categorize overall risk level (Low, Medium, High, Critical)\n5. Flag specific risk factors contributing to the assessment\n6. Provide reasoning for risk classification\n\nIMPORTANT CONSTRAINTS:\n- You are NOT authorized to make underwriting decisions\n- You are NOT authorized to approve or deny transactions\n- Your role is purely analytical and advisory\n- Focus on risk identification and measurement only\n\nConsider:\n- Exposure concentration by geography, industry, and counterparty\n- Claims trends over time (frequency and severity)\n- Loss development patterns and reserve adequacy\n- Regulatory capital requirements and compliance thresholds\n- Market conditions and external risk factors\n\nReturn structured JSON output with risk score, risk level, key risk factors, and detailed reasoning."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "d1074860-7e4f-4d4b-b490-ce37cd78a6d4",
      "name": "OpenAI Model - Risk Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1312,
        640
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3cc1e4cf-6d99-4cea-9d26-7484c5b3449b",
      "name": "Risk Assessment Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1120,
        672
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"riskScore\": {\n      \"type\": \"number\",\n      \"description\": \"Overall risk score from 0-100\"\n    },\n    \"riskLevel\": {\n      \"type\": \"string\",\n      \"description\": \"Risk classification: Low, Medium, High, or Critical\"\n    },\n    \"keyRiskFactors\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"description\": \"List of primary risk factors identified\"\n    },\n    \"exposureConcentration\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"geographic\": {\"type\": \"string\"},\n        \"industry\": {\"type\": \"string\"},\n        \"counterparty\": {\"type\": \"string\"}\n      }\n    },\n    \"claimsTrends\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"frequency\": {\"type\": \"string\"},\n        \"severity\": {\"type\": \"string\"},\n        \"lossRatio\": {\"type\": \"number\"}\n      }\n    },\n    \"reasoning\": {\n      \"type\": \"string\",\n      \"description\": \"Detailed explanation of risk assessment\"\n    }\n  },\n  \"required\": [\"riskScore\", \"riskLevel\", \"keyRiskFactors\", \"reasoning\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6c061e59-afce-4c2c-8e26-1c5c5504b9c3",
      "name": "Route by Risk Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        -720,
        304
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "High Risk",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.riskScore }}",
                    "rightValue": 75
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Medium Risk",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.riskScore }}",
                    "rightValue": 50
                  },
                  {
                    "operator": {
                      "type": "number",
                      "operation": "lt"
                    },
                    "leftValue": "={{ $json.riskScore }}",
                    "rightValue": 75
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Low Risk"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "50f9512d-519d-4538-a545-c1149142838a",
      "name": "Compliance Orchestration Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        16,
        96
      ],
      "parameters": {
        "text": "=Risk Assessment: {{ JSON.stringify($json.output) }}",
        "options": {
          "systemMessage": "You are a Compliance Orchestration Agent responsible for coordinating approval workflows, exception handling, regulatory reporting, and audit-ready evidence packaging.\n\nYour role is to:\n1. Coordinate approval workflows based on risk levels:\n   - High/Critical risk: Escalate to senior management with detailed briefing\n   - Medium risk: Route to compliance review with supporting documentation\n   - Low risk: Document for audit trail with standard procedures\n2. Handle exceptions by:\n   - Identifying deviations from standard risk thresholds\n   - Documenting exception rationale and supporting evidence\n   - Recommending appropriate escalation paths\n3. Prepare regulatory reporting requirements:\n   - Identify applicable regulatory frameworks\n   - Compile required data points and disclosures\n   - Flag reporting deadlines and submission requirements\n4. Package audit-ready evidence including:\n   - Complete risk assessment documentation\n   - Decision workflow and approval chain\n   - Supporting data sources and calculations\n   - Compliance checklist and verification steps\n   - Timestamp and audit trail metadata\n\nIMPORTANT CONSTRAINTS:\n- You are NOT authorized to make transactional decisions\n- You are NOT authorized to approve or deny underwriting\n- Your role is coordination, documentation, and process orchestration only\n- All decisions must be routed to appropriate human authorities\n\nConsider:\n- Regulatory requirements (SOX, Basel III, Solvency II, etc.)\n- Internal governance policies and approval hierarchies\n- Audit trail completeness and documentation standards\n- Exception handling procedures and escalation protocols\n- Evidence preservation and retention requirements\n\nReturn structured JSON output with workflow actions, required approvals, regulatory items, and audit package."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "d079ceeb-e17d-4b71-a447-2e0fa2b55e08",
      "name": "OpenAI Model - Compliance Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -80,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "12160acb-2fc0-4e8d-95f8-ceead87b5778",
      "name": "Compliance Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        448,
        432
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"workflowActions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"action\": {\"type\": \"string\"},\n          \"assignedTo\": {\"type\": \"string\"},\n          \"priority\": {\"type\": \"string\"},\n          \"deadline\": {\"type\": \"string\"}\n        }\n      },\n      \"description\": \"List of workflow actions and assignments\"\n    },\n    \"requiredApprovals\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"approver\": {\"type\": \"string\"},\n          \"approvalType\": {\"type\": \"string\"},\n          \"rationale\": {\"type\": \"string\"}\n        }\n      },\n      \"description\": \"Required approvals and escalations\"\n    },\n    \"regulatoryItems\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"framework\": {\"type\": \"string\"},\n          \"requirement\": {\"type\": \"string\"},\n          \"deadline\": {\"type\": \"string\"},\n          \"status\": {\"type\": \"string\"}\n        }\n      },\n      \"description\": \"Regulatory reporting requirements\"\n    },\n    \"auditPackage\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"documentationComplete\": {\"type\": \"boolean\"},\n        \"evidenceSources\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n        \"complianceChecklist\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n        \"auditTrail\": {\"type\": \"string\"}\n      },\n      \"description\": \"Audit-ready evidence package\"\n    },\n    \"exceptionHandling\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"exceptionsIdentified\": {\"type\": \"array\", \"items\": {\"type\": \"string\"}},\n        \"escalationRequired\": {\"type\": \"boolean\"},\n        \"escalationPath\": {\"type\": \"string\"}\n      },\n      \"description\": \"Exception handling and escalation details\"\n    },\n    \"summary\": {\n      \"type\": \"string\",\n      \"description\": \"Executive summary of compliance coordination\"\n    }\n  },\n  \"required\": [\"workflowActions\", \"requiredApprovals\", \"regulatoryItems\", \"auditPackage\", \"summary\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b91c2674-04b4-4ff8-9b9b-a89d91bccef8",
      "name": "Consolidate Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        880,
        288
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "a206a244-e4e3-4507-9ef0-9b88e18a52fc",
      "name": "Send Compliance Report",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1104,
        288
      ],
      "parameters": {
        "html": "=<html>\n<head>\n<style>\nbody { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }\n.header { background-color: #2c3e50; color: white; padding: 20px; text-align: center; }\n.section { margin: 20px; padding: 15px; border-left: 4px solid #3498db; background-color: #f8f9fa; }\n.risk-high { border-left-color: #e74c3c; }\n.risk-medium { border-left-color: #f39c12; }\n.risk-low { border-left-color: #27ae60; }\n.label { font-weight: bold; color: #2c3e50; }\n.value { margin-left: 10px; }\nul { margin: 10px 0; }\nli { margin: 5px 0; }\n.footer { margin-top: 30px; padding: 15px; background-color: #ecf0f1; text-align: center; font-size: 12px; }\n</style>\n</head>\n<body>\n<div class=\"header\">\n<h1>Risk Assessment & Compliance Orchestration Report</h1>\n<p>Generated: {{ $now.toFormat('yyyy-MM-dd HH:mm:ss') }}</p>\n</div>\n\n<div class=\"section risk-{{ $json.output.riskLevel.toLowerCase() }}\">\n<h2>Risk Assessment Summary</h2>\n<p><span class=\"label\">Risk Score:</span><span class=\"value\">{{ $json.output.riskScore }}/100</span></p>\n<p><span class=\"label\">Risk Level:</span><span class=\"value\">{{ $json.output.riskLevel }}</span></p>\n<p><span class=\"label\">Key Risk Factors:</span></p>\n<ul>\n{{ $json.output.keyRiskFactors.map(factor => `<li>${factor}</li>`).join('') }}\n</ul>\n<p><span class=\"label\">Assessment Reasoning:</span></p>\n<p>{{ $json.output.reasoning }}</p>\n</div>\n\n<div class=\"section\">\n<h2>Compliance Orchestration</h2>\n<p><span class=\"label\">Executive Summary:</span></p>\n<p>{{ $json.output.summary }}</p>\n\n<h3>Required Approvals</h3>\n<ul>\n{{ $json.output.requiredApprovals.map(approval => `<li><strong>${approval.approver}</strong> - ${approval.approvalType}: ${approval.rationale}</li>`).join('') }}\n</ul>\n\n<h3>Workflow Actions</h3>\n<ul>\n{{ $json.output.workflowActions.map(action => `<li><strong>${action.action}</strong> (Assigned to: ${action.assignedTo}, Priority: ${action.priority}, Deadline: ${action.deadline})</li>`).join('') }}\n</ul>\n\n<h3>Regulatory Requirements</h3>\n<ul>\n{{ $json.output.regulatoryItems.map(item => `<li><strong>${item.framework}</strong>: ${item.requirement} (Deadline: ${item.deadline}, Status: ${item.status})</li>`).join('') }}\n</ul>\n</div>\n\n<div class=\"section\">\n<h2>Audit Package</h2>\n<p><span class=\"label\">Documentation Complete:</span><span class=\"value\">{{ $json.output.auditPackage.documentationComplete ? 'Yes' : 'No' }}</span></p>\n<p><span class=\"label\">Evidence Sources:</span></p>\n<ul>\n{{ $json.output.auditPackage.evidenceSources.map(source => `<li>${source}</li>`).join('') }}\n</ul>\n<p><span class=\"label\">Compliance Checklist:</span></p>\n<ul>\n{{ $json.output.auditPackage.complianceChecklist.map(item => `<li>${item}</li>`).join('') }}\n</ul>\n<p><span class=\"label\">Audit Trail:</span></p>\n<p>{{ $json.output.auditPackage.auditTrail }}</p>\n</div>\n\n<div class=\"section\">\n<h2>Exception Handling</h2>\n<p><span class=\"label\">Escalation Required:</span><span class=\"value\">{{ $json.output.exceptionHandling.escalationRequired ? 'Yes' : 'No' }}</span></p>\n{{ $json.output.exceptionHandling.escalationRequired ? `<p><span class=\"label\">Escalation Path:</span><span class=\"value\">${$json.output.exceptionHandling.escalationPath}</span></p>` : '' }}\n<p><span class=\"label\">Exceptions Identified:</span></p>\n<ul>\n{{ $json.output.exceptionHandling.exceptionsIdentified.map(exception => `<li>${exception}</li>`).join('') }}\n</ul>\n</div>\n\n<div class=\"footer\">\n<p>This is an automated report generated by the Risk Assessment and Compliance Orchestration system.</p>\n<p>For questions or concerns, please contact the Compliance Team.</p>\n</div>\n</body>\n</html>",
        "options": {},
        "subject": "=Risk Assessment & Compliance Report - {{ $now.toFormat('yyyy-MM-dd') }}",
        "toEmail": "={{ $('Workflow Configuration').first().json.complianceEmail }}",
        "fromEmail": "<__PLACEHOLDER_VALUE__Sender Email Address__>"
      },
      "typeVersion": 2.1
    },
    {
      "id": "aa7a4291-59f0-4515-8e2d-966e5964fa03",
      "name": "Calculate Risk Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        -1520,
        496
      ],
      "parameters": {
        "jsCode": "// Calculate Advanced Risk Metrics from Merged Financial Data\n// This code processes risk and claims data to compute volatility, concentration indices, and trend analysis\n\nconst items = $input.all();\n\n// Initialize aggregated metrics\nlet totalExposure = 0;\nlet totalClaims = 0;\nlet claimsHistory = [];\nlet exposureByGeography = {};\nlet exposureByIndustry = {};\nlet exposureByCounterparty = {};\n\n// Process each item to extract risk and claims data\nfor (const item of items) {\n  const data = item.json;\n  \n  // Aggregate exposure data\n  if (data.exposure) {\n    totalExposure += data.exposure.amount || 0;\n    \n    // Geographic concentration\n    const geo = data.exposure.geography || 'Unknown';\n    exposureByGeography[geo] = (exposureByGeography[geo] || 0) + (data.exposure.amount || 0);\n    \n    // Industry concentration\n    const industry = data.exposure.industry || 'Unknown';\n    exposureByIndustry[industry] = (exposureByIndustry[industry] || 0) + (data.exposure.amount || 0);\n    \n    // Counterparty concentration\n    const counterparty = data.exposure.counterparty || 'Unknown';\n    exposureByCounterparty[counterparty] = (exposureByCounterparty[counterparty] || 0) + (data.exposure.amount || 0);\n  }\n  \n  // Aggregate claims data\n  if (data.claims) {\n    totalClaims += data.claims.amount || 0;\n    claimsHistory.push({\n      date: data.claims.date || new Date().toISOString(),\n      amount: data.claims.amount || 0,\n      severity: data.claims.severity || 'Unknown'\n    });\n  }\n}\n\n// Calculate concentration indices (Herfindahl-Hirschman Index)\nconst calculateHHI = (distribution, total) => {\n  let hhi = 0;\n  for (const key in distribution) {\n    const share = distribution[key] / total;\n    hhi += share * share;\n  }\n  return hhi * 10000; // Scale to 0-10000\n};\n\nconst geoConcentrationIndex = calculateHHI(exposureByGeography, totalExposure);\nconst industryConcentrationIndex = calculateHHI(exposureByIndustry, totalExposure);\nconst counterpartyConcentrationIndex = calculateHHI(exposureByCounterparty, totalExposure);\n\n// Calculate claims volatility (standard deviation)\nconst calculateVolatility = (values) => {\n  if (values.length === 0) return 0;\n  const mean = values.reduce((sum, val) => sum + val, 0) / values.length;\n  const variance = values.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / values.length;\n  return Math.sqrt(variance);\n};\n\nconst claimsAmounts = claimsHistory.map(c => c.amount);\nconst claimsVolatility = calculateVolatility(claimsAmounts);\n\n// Calculate loss ratio\nconst lossRatio = totalExposure > 0 ? (totalClaims / totalExposure) * 100 : 0;\n\n// Trend analysis - calculate moving average and trend direction\nconst calculateTrend = (values) => {\n  if (values.length < 2) return 'Stable';\n  const recentAvg = values.slice(-3).reduce((sum, val) => sum + val, 0) / Math.min(3, values.length);\n  const olderAvg = values.slice(0, -3).reduce((sum, val) => sum + val, 0) / Math.max(1, values.length - 3);\n  \n  if (recentAvg > olderAvg * 1.1) return 'Increasing';\n  if (recentAvg < olderAvg * 0.9) return 'Decreasing';\n  return 'Stable';\n};\n\nconst claimsTrend = calculateTrend(claimsAmounts);\n\n// Calculate frequency metrics\nconst claimsFrequency = claimsHistory.length;\nconst avgClaimSeverity = claimsAmounts.length > 0 ? claimsAmounts.reduce((sum, val) => sum + val, 0) / claimsAmounts.length : 0;\n\n// Determine top concentrations\nconst getTopConcentrations = (distribution, total, limit = 3) => {\n  return Object.entries(distribution)\n    .map(([key, value]) => ({ name: key, amount: value, percentage: (value / total * 100).toFixed(2) }))\n    .sort((a, b) => b.amount - a.amount)\n    .slice(0, limit);\n};\n\nconst topGeographies = getTopConcentrations(exposureByGeography, totalExposure);\nconst topIndustries = getTopConcentrations(exposureByIndustry, totalExposure);\nconst topCounterparties = getTopConcentrations(exposureByCounterparty, totalExposure);\n\n// Return comprehensive risk metrics\nreturn [{\n  json: {\n    riskMetrics: {\n      totalExposure,\n      totalClaims,\n      lossRatio: lossRatio.toFixed(2),\n      claimsVolatility: claimsVolatility.toFixed(2),\n      claimsFrequency,\n      avgClaimSeverity: avgClaimSeverity.toFixed(2),\n      claimsTrend\n    },\n    concentrationIndices: {\n      geographic: geoConcentrationIndex.toFixed(2),\n      industry: industryConcentrationIndex.toFixed(2),\n      counterparty: counterpartyConcentrationIndex.toFixed(2)\n    },\n    topConcentrations: {\n      geographies: topGeographies,\n      industries: topIndustries,\n      counterparties: topCounterparties\n    },\n    claimsHistory,\n    timestamp: new Date().toISOString()\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "38008399-921b-4890-be8c-ddb9f0346328",
      "name": "Check Critical Risk",
      "type": "n8n-nodes-base.if",
      "position": [
        -944,
        544
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "id-1",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.riskScore }}",
              "rightValue": "={{ $('Workflow Configuration').first().json.riskThresholdHigh }}"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "a249e947-fc09-4d6f-b753-5c8d688a66b2",
      "name": "Regulatory Analysis Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -128,
        432
      ],
      "parameters": {
        "text": "={{ $fromAI('riskData', 'Risk assessment data requiring regulatory analysis', 'json') }}",
        "options": {
          "systemMessage": "You are a Regulatory Analysis Specialist.\n\nYour task is to:\n1. Analyze risk assessment data against applicable regulatory frameworks\n2. Identify specific regulatory requirements triggered by the risk profile\n3. Determine reporting obligations (SOX, Basel III, Solvency II, Dodd-Frank, etc.)\n4. Calculate regulatory capital requirements and reserve adequacy\n5. Flag compliance gaps or violations\n6. Recommend remediation actions\n\nReturn structured analysis with framework identification, requirements, deadlines, and compliance status."
        },
        "hasOutputParser": true,
        "toolDescription": "Analyzes risk data against regulatory frameworks and identifies compliance requirements, reporting obligations, and capital adequacy"
      },
      "typeVersion": 3
    },
    {
      "id": "6c7b1380-6177-4420-9f6e-012c08be3e05",
      "name": "OpenAI Model - Regulatory Tool",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -112,
        640
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.1
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c20042aa-5152-470a-9f68-9b7c2c16521f",
      "name": "Regulatory Tool Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        32,
        640
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"applicableFrameworks\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"},\n      \"description\": \"List of applicable regulatory frameworks\"\n    },\n    \"complianceRequirements\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"framework\": {\"type\": \"string\"},\n          \"requirement\": {\"type\": \"string\"},\n          \"deadline\": {\"type\": \"string\"},\n          \"status\": {\"type\": \"string\"}\n        }\n      }\n    },\n    \"capitalRequirements\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"minimumCapital\": {\"type\": \"number\"},\n        \"currentCapital\": {\"type\": \"number\"},\n        \"adequacyRatio\": {\"type\": \"number\"}\n      }\n    },\n    \"complianceGaps\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"}\n    },\n    \"remediationActions\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"}\n    }\n  },\n  \"required\": [\"applicableFrameworks\", \"complianceRequirements\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "363d2dc7-63b5-44e3-9836-8cba7e5ea089",
      "name": "Exception Handler Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        160,
        432
      ],
      "parameters": {
        "text": "={{ $fromAI('riskData', 'Risk assessment data requiring exception analysis', 'json') }}",
        "options": {
          "systemMessage": "You are an Exception Handling Specialist.\n\nYour task is to:\n1. Identify exceptions and deviations from standard risk thresholds\n2. Analyze root causes of exceptions\n3. Assess severity and potential impact\n4. Determine appropriate escalation paths based on exception type\n5. Document exception rationale with supporting evidence\n6. Recommend mitigation strategies\n\nReturn structured exception analysis with identified exceptions, severity assessment, escalation recommendations, and mitigation strategies."
        },
        "hasOutputParser": true,
        "toolDescription": "Analyzes risk exceptions, determines escalation paths, and provides mitigation recommendations"
      },
      "typeVersion": 3
    },
    {
      "id": "35ca2d3b-4a0d-4690-ad8e-bbf17ed8861d",
      "name": "OpenAI Model - Exception Tool",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        640
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.1
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "523ae5b3-8626-4cfa-b4e8-38bf7e2bd9b9",
      "name": "Exception Tool Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        304,
        640
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"exceptionsIdentified\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"exceptionType\": {\"type\": \"string\"},\n          \"description\": {\"type\": \"string\"},\n          \"severity\": {\"type\": \"string\"},\n          \"rootCause\": {\"type\": \"string\"}\n        }\n      }\n    },\n    \"escalationRequired\": {\"type\": \"boolean\"},\n    \"escalationPath\": {\"type\": \"string\"},\n    \"mitigationStrategies\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"}\n    },\n    \"impactAssessment\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"financialImpact\": {\"type\": \"string\"},\n        \"reputationalImpact\": {\"type\": \"string\"},\n        \"operationalImpact\": {\"type\": \"string\"}\n      }\n    }\n  },\n  \"required\": [\"exceptionsIdentified\", \"escalationRequired\", \"mitigationStrategies\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e4d7bed0-6c15-4d08-ab95-e029dc1113e0",
      "name": "Send Critical Alert to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -720,
        544
      ],
      "parameters": {
        "text": "=CRITICAL RISK ALERT\n\nRisk Score: {{ $json.output.riskScore }}/100\nRisk Level: {{ $json.output.riskLevel }}\n\nKey Risk Factors:\n{{ $json.output.keyRiskFactors.map(f => `\u2022 ${f}`).join('\\n') }}\n\nExposure Concentration:\n\u2022 Geographic: {{ $json.output.exposureConcentration?.geographic || 'N/A' }}\n\u2022 Industry: {{ $json.output.exposureConcentration?.industry || 'N/A' }}\n\u2022 Counterparty: {{ $json.output.exposureConcentration?.counterparty || 'N/A' }}\n\nClaims Trends:\n\u2022 Frequency: {{ $json.output.claimsTrends?.frequency || 'N/A' }}\n\u2022 Severity: {{ $json.output.claimsTrends?.severity || 'N/A' }}\n\u2022 Loss Ratio: {{ $json.output.claimsTrends?.lossRatio || 'N/A' }}\n\nImmediate review required by senior management.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannel }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "46da6cc6-36c9-4d6c-a2fd-cdf9c10a17ab",
      "name": "Log to Audit Trail Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        880,
        512
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "workflowExecutionId"
          ]
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Audit Trail"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.auditSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7c37aa8a-4229-4f4e-8763-c456475054c6",
      "name": "Generate Audit Metadata",
      "type": "n8n-nodes-base.code",
      "position": [
        656,
        304
      ],
      "parameters": {
        "jsCode": "// Generate comprehensive audit metadata for compliance tracking\nconst workflowId = $workflow.id;\nconst executionId = $execution.id;\nconst executionMode = $execution.mode;\nconst timestamp = new Date().toISOString();\n\n// Get input data from Compliance Orchestration Agent\nconst complianceData = $input.all();\n\n// Extract risk assessment data from the workflow\nconst riskAssessment = $('Risk Signal Agent').first().json;\n\n// Generate data lineage tracking\nconst dataLineage = {\n  sourceNodes: [\n    'Fetch Risk Data',\n    'Fetch Claims Data',\n    'Merge Financial Data',\n    'Risk Signal Agent',\n    'Compliance Orchestration Agent'\n  ],\n  processingSteps: [\n    {\n      step: 1,\n      node: 'Fetch Risk Data',\n      timestamp: timestamp,\n      action: 'Retrieved risk and exposure data from external API'\n    },\n    {\n      step: 2,\n      node: 'Fetch Claims Data',\n      timestamp: timestamp,\n      action: 'Retrieved claims history data from external API'\n    },\n    {\n      step: 3,\n      node: 'Merge Financial Data',\n      timestamp: timestamp,\n      action: 'Combined risk and claims datasets'\n    },\n    {\n      step: 4,\n      node: 'Risk Signal Agent',\n      timestamp: timestamp,\n      action: 'AI-powered risk assessment and scoring'\n    },\n    {\n      step: 5,\n      node: 'Compliance Orchestration Agent',\n      timestamp: timestamp,\n      action: 'Compliance workflow coordination and audit packaging'\n    }\n  ]\n};\n\n// Generate compliance checksums for data integrity\nconst generateChecksum = (data) => {\n  const str = JSON.stringify(data);\n  let hash = 0;\n  for (let i = 0; i < str.length; i++) {\n    const char = str.charCodeAt(i);\n    hash = ((hash << 5) - hash) + char;\n    hash = hash & hash;\n  }\n  return Math.abs(hash).toString(16);\n};\n\nconst checksums = {\n  riskAssessment: generateChecksum(riskAssessment),\n  complianceData: generateChecksum(complianceData),\n  combined: generateChecksum({ riskAssessment, complianceData })\n};\n\n// User context and system information\nconst userContext = {\n  workflowName: $workflow.name,\n  workflowActive: $workflow.active,\n  executionMode: executionMode,\n  triggeredBy: 'Schedule Trigger',\n  n8nVersion: $version || 'unknown'\n};\n\n// Compliance metadata\nconst complianceMetadata = {\n  auditId: `AUDIT-${executionId}-${Date.now()}`,\n  workflowExecutionId: executionId,\n  workflowId: workflowId,\n  executionTimestamp: timestamp,\n  processingDate: new Date().toISOString().split('T')[0],\n  processingTime: new Date().toISOString().split('T')[1],\n  dataLineage: dataLineage,\n  checksums: checksums,\n  userContext: userContext,\n  riskScore: riskAssessment?.riskScore || null,\n  riskLevel: riskAssessment?.riskLevel || null,\n  complianceStatus: complianceData[0]?.json?.auditPackage?.documentationComplete ? 'Complete' : 'Incomplete',\n  retentionPolicy: '7 years',\n  regulatoryFrameworks: complianceData[0]?.json?.regulatoryItems?.map(item => item.framework) || [],\n  auditTrailComplete: true,\n  dataIntegrityVerified: true,\n  version: '1.0'\n};\n\n// Return enriched data with audit metadata\nreturn complianceData.map(item => ({\n  json: {\n    ...item.json,\n    auditMetadata: complianceMetadata\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "bc32edb1-799d-424c-aca1-5cd7d1aa3192",
      "name": "Merge Critical Path",
      "type": "n8n-nodes-base.merge",
      "position": [
        -496,
        544
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "ef2f1b92-d303-4b52-9625-35476c2f70ed",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -448
      ],
      "parameters": {
        "color": 5,
        "width": 592,
        "height": 352,
        "content": "## Prerequisites\nOpenAI or Nvidia API credentials for AI-powered risk analysis, financial data API access\n## Use Cases\nInsurance companies monitoring claims fraud patterns, financial institutions detecting transaction anomalies\n## Customization\nAdjust risk scoring algorithms for industry-specific thresholds\n## Benefits\nReduces risk detection time by 80%, eliminates manual compliance monitoring"
      },
      "typeVersion": 1
    },
    {
      "id": "5910dbd2-4a00-45af-885d-9473b997a99c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        -448
      ],
      "parameters": {
        "width": 464,
        "height": 336,
        "content": "## Setup Steps\n1. Configure Schedule Trigger with risk monitoring frequency\n2. Connect Workflow Configuration node with data source parameters\n3. Set up Fetch B2B Data and Fetch Claims Data nodes with respective API credentials\n4. Configure Merge Financial Data node for data consolidation\n5. Connect Calculate Risk Metrics node with risk scoring algorithms\n6. Set up Risk Signal Agent with OpenAI/Nvidia API credentials for anomaly detection\n7. Configure parallel output parsers\n8. Connect Check Critical Risk node with severity routing logic\n9. Set up Route by Risk Level node for workflow branching"
      },
      "typeVersion": 1
    },
    {
      "id": "11f55641-2b1f-4d3f-afdb-ffa6fd3f633d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2304,
        -464
      ],
      "parameters": {
        "width": 656,
        "height": 368,
        "content": "## How It Works\nThis workflow automates comprehensive risk signal detection and regulatory compliance management across financial and claims data sources. Designed for risk management teams, compliance officers, and financial auditors, it solves the critical challenge of identifying potential risks while ensuring timely regulatory reporting and stakeholder notifications.\nThe system operates on scheduled intervals, fetching data from multiple sources including financial APIs and claims databases, then merging these streams for unified analysis. It employs an AI-powered risk signal agent to detect anomalies, regulatory violations, and compliance issues. The workflow intelligently routes findings based on risk severity, orchestrating parallel processes for critical risks requiring immediate escalation and standard risks needing documentation. It manages multi-channel notifications through Slack and email, generates comprehensive compliance documentation, and maintains detailed audit trails. By coordinating regulatory analysis, exception handling, and evidence collection, it ensures complete risk visibility while automating compliance workflows."
      },
      "typeVersion": 1
    },
    {
      "id": "ff620bea-ae54-435e-90c4-c52fa9da2087",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1168,
        "height": 880,
        "content": "## AI-Powered Risk Detection\n**What:** Processes merged data through risk signal agent with parallel output parsing for regulatory and operational risk identification\n**Why:** Leverages AI to detect complex risk patterns and compliance violations that rule-based systems miss\n"
      },
      "typeVersion": 1
    },
    {
      "id": "348c507e-099a-4473-94ee-c5aef73aa26e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 1408,
        "height": 1216,
        "content": "## Severity-Based Orchestration\n**What:** Routes risks through severity-specific workflows with parallel processing for compliance documentation, stakeholder alerts, and audit logging\n**Why:** Ensures critical risks receive immediate multi-channel escalation while standard risks follow proper documentation procedures without bottlenecks"
      },
      "typeVersion": 1
    },
    {
      "id": "97a2808d-0715-4aea-8ead-71c4a8164cc1",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2464,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 1072,
        "height": 928,
        "content": "## Multi-Source Risk Aggregation\n**What:** Fetches and merges financial metrics and claims data on scheduled intervals for unified risk analysis\n**Why:** Ensures comprehensive risk coverage by correlating financial anomalies with operational claims data for complete visibility\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "fb6540b5-94dc-41ba-aa43-24c7025d2602",
  "connections": {
    "Fetch Risk Data": {
      "main": [
        [
          {
            "node": "Merge Financial Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Claims Data": {
      "main": [
        [
          {
            "node": "Merge Financial Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Risk Signal Agent": {
      "main": [
        [
          {
            "node": "Route by Risk Level",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Critical Risk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Critical Risk": {
      "main": [
        [
          {
            "node": "Send Critical Alert to Slack",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Route by Risk Level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate Results": {
      "main": [
        [
          {
            "node": "Send Compliance Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Critical Path": {
      "main": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Risk Level": {
      "main": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Critical Path",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Consolidate Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Financial Data": {
      "main": [
        [
          {
            "node": "Risk Signal Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Calculate Risk Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Risk Metrics": {
      "main": [
        [
          {
            "node": "Risk Signal Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Risk Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Claims Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audit Metadata": {
      "main": [
        [
          {
            "node": "Log to Audit Trail Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Consolidate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compliance Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Risk Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Risk Signal Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Exception Handler Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Exception Tool Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Exception Handler Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Send Critical Alert to Slack": {
      "main": [
        [
          {
            "node": "Merge Critical Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Exception Tool": {
      "ai_languageModel": [
        [
          {
            "node": "Exception Handler Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Regulatory Tool Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Regulatory Analysis Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Risk Assessment Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Risk Signal Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Compliance Orchestration Agent": {
      "main": [
        [
          {
            "node": "Consolidate Results",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Audit Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Regulatory Tool": {
      "ai_languageModel": [
        [
          {
            "node": "Regulatory Analysis Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Regulatory Analysis Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Compliance Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Compliance Orchestration Agent",
            "type": "ai_languageModel",
            "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates comprehensive risk signal detection and regulatory compliance management across financial and claims data sources. Designed for risk management teams, compliance officers, and financial auditors, it solves the critical challenge of identifying potential…

Source: https://n8n.io/workflows/13141/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Created by: Peyton Leveillee Last updated: October 2025

OpenAI Chat, Google Sheets, HTTP Request +5
AI & RAG

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

Form Trigger, Agent, OpenAI Chat +11
AI & RAG

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

Agent, OpenAI Chat, Output Parser Structured +10
AI & RAG

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

Agent, OpenAI Chat, Output Parser Structured +12
AI & RAG

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

Agent, OpenAI Chat, Output Parser Structured +10