{
  "id": "OvyBQyKUIrh1wEO_Y0oHI",
  "name": "AI engineering governance system with multi-agent safety and risk routing",
  "tags": [],
  "nodes": [
    {
      "id": "29c0ea5e-f51e-4bdc-a8b9-bb9a57a9ca15",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -16,
        656
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6fcc9469-82d8-4978-89a5-3c0d6bd1a99d",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        656
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "designSpecsApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Design Specifications API URL__>"
            },
            {
              "id": "id-2",
              "name": "operationalDataApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Operational Data API URL__>"
            },
            {
              "id": "id-3",
              "name": "slackChannelId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack Channel ID for alerts__>"
            },
            {
              "id": "id-4",
              "name": "criticalRiskThreshold",
              "type": "number",
              "value": 80
            },
            {
              "id": "id-5",
              "name": "highRiskThreshold",
              "type": "number",
              "value": 60
            },
            {
              "id": "id-6",
              "name": "mediumRiskThreshold",
              "type": "number",
              "value": 40
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "8d4164dc-dd18-46e1-8e57-fb9b0b632c4f",
      "name": "Fetch Design Specifications",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        432,
        560
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.designSpecsApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "259913ca-c039-46c2-802a-6cef052d5a7d",
      "name": "Fetch Operational Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        432,
        752
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.operationalDataApiUrl }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "3f270a6a-3a59-439b-af8c-a0b54b135c38",
      "name": "Merge Engineering Data",
      "type": "n8n-nodes-base.set",
      "position": [
        656,
        656
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "designSpecs",
              "type": "object",
              "value": "={{ $('Fetch Design Specifications').first().json }}"
            },
            {
              "id": "id-2",
              "name": "operationalData",
              "type": "object",
              "value": "={{ $('Fetch Operational Data').first().json }}"
            },
            {
              "id": "id-3",
              "name": "timestamp",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            },
            {
              "id": "id-4",
              "name": "projectId",
              "type": "string",
              "value": "={{ $('Fetch Design Specifications').first().json.projectId || 'UNKNOWN' }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "74502f13-d5b3-40aa-869c-5bbbaa6b94dd",
      "name": "Design Validation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1312,
        48
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are a Design Validation Specialist Agent responsible for comprehensive analysis of engineering design specifications, CAD models, simulations, materials, and components.\n\nYour task is to:\n1. Analyze design specifications for structural integrity, performance characteristics, and manufacturability\n2. Identify structural weaknesses, stress concentration points, and potential failure modes\n3. Evaluate material selection against design requirements and environmental conditions\n4. Assess component compatibility and integration risks\n5. Detect design non-conformances against engineering standards\n6. Call Compliance Verification Agent Tool to verify regulatory compliance (ISO, ASME, IEC standards)\n7. Call Resource Coordination Agent Tool to assess manufacturing resource requirements\n8. Call Testing Validation Agent Tool to recommend validation testing protocols\n9. Calculate design risk score (0-100) based on identified issues\n10. Provide detailed validation report with findings and recommendations\n\nConsider: load-bearing capacity, thermal management, vibration tolerance, corrosion resistance, and lifecycle durability.\n\nReturn structured validation results with risk assessment and actionable recommendations."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "72bb3638-3552-4096-8a28-72afa56c0342",
      "name": "Safety Optimization Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1392,
        736
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are a Safety Optimization Specialist Agent responsible for identifying and mitigating safety hazards in engineering systems.\n\nYour task is to:\n1. Analyze design and operational data for safety hazards and failure scenarios\n2. Identify critical safety risks including mechanical failures, electrical hazards, thermal events, and human factors\n3. Evaluate safety margins and redundancy mechanisms\n4. Assess emergency shutdown systems and fail-safe mechanisms\n5. Detect potential cascading failure scenarios\n6. Call Compliance Verification Agent Tool to verify safety standards compliance (OSHA, NFPA, IEC 61508)\n7. Call Resource Coordination Agent Tool to coordinate safety equipment and personnel requirements\n8. Call Testing Validation Agent Tool to recommend safety testing protocols\n9. Calculate safety risk score (0-100) based on hazard severity and likelihood\n10. Provide safety optimization recommendations with mitigation strategies\n\nConsider: hazard severity, exposure frequency, detection probability, and consequence analysis.\n\nReturn structured safety analysis with risk prioritization and mitigation actions."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "f028e673-64e3-43d3-bcf1-fa942b8fcd66",
      "name": "Predictive Maintenance Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1520,
        1120
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are a Predictive Maintenance Specialist Agent responsible for analyzing operational data and predicting maintenance requirements.\n\nYour task is to:\n1. Analyze real-time operational data including temperature, vibration, pressure, flow rates, and performance metrics\n2. Identify degradation patterns and anomalies indicating impending failures\n3. Predict remaining useful life (RUL) for critical components\n4. Assess performance bottlenecks and efficiency degradation\n5. Detect early warning signs of bearing failures, seal degradation, and wear patterns\n6. Call Compliance Verification Agent Tool to verify maintenance compliance with regulatory schedules\n7. Call Resource Coordination Agent Tool to coordinate maintenance resources, parts, and personnel\n8. Call Testing Validation Agent Tool to recommend diagnostic testing procedures\n9. Calculate maintenance urgency score (0-100) based on failure probability and impact\n10. Provide predictive maintenance schedule with prioritized interventions\n\nConsider: failure modes, operational history, environmental conditions, and business impact.\n\nReturn structured maintenance predictions with timeline and resource requirements."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "3d13b92e-f2d5-470f-9990-d7ce520fddb8",
      "name": "Compliance Verification Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1024,
        256
      ],
      "parameters": {
        "text": "={{ $fromAI('engineeringData', 'Engineering design, safety, or maintenance data requiring compliance verification', 'json') }}",
        "options": {
          "systemMessage": "You are a Compliance Verification Specialist Agent responsible for verifying regulatory and standards compliance.\n\nYour task is to:\n1. Analyze engineering data against applicable regulatory frameworks (ISO, ASME, IEC, OSHA, NFPA, FDA)\n2. Identify compliance gaps and non-conformances\n3. Verify documentation completeness for regulatory submissions\n4. Assess certification requirements and testing protocols\n5. Evaluate traceability and audit trail adequacy\n6. Determine compliance risk level (COMPLIANT, MINOR_GAP, MAJOR_GAP, NON_COMPLIANT)\n7. Provide detailed compliance report with gap analysis and remediation steps\n\nConsider: industry-specific regulations, regional requirements, and certification timelines.\n\nReturn structured compliance assessment with findings and action items."
        },
        "hasOutputParser": true,
        "toolDescription": "Verifies regulatory compliance against engineering standards (ISO, ASME, IEC, OSHA, NFPA) and identifies compliance gaps"
      },
      "typeVersion": 3
    },
    {
      "id": "a9bffa47-38d3-4787-871e-f2712ef1f556",
      "name": "Resource Coordination Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1312,
        256
      ],
      "parameters": {
        "text": "={{ $fromAI('resourceRequirements', 'Resource requirements for manufacturing, maintenance, or testing activities', 'json') }}",
        "options": {
          "systemMessage": "You are a Resource Coordination Specialist Agent responsible for cross-system resource allocation and scheduling.\n\nYour task is to:\n1. Analyze resource requirements for manufacturing, maintenance, and testing activities\n2. Assess resource availability including personnel, equipment, materials, and facilities\n3. Identify resource conflicts and bottlenecks\n4. Optimize resource allocation across multiple projects and priorities\n5. Calculate resource utilization efficiency and capacity constraints\n6. Coordinate cross-functional teams and equipment scheduling\n7. Provide resource allocation plan with timelines and dependencies\n\nConsider: skill requirements, equipment capabilities, material lead times, and priority levels.\n\nReturn structured resource coordination plan with allocation schedule and contingencies."
        },
        "hasOutputParser": true,
        "toolDescription": "Coordinates cross-system resource allocation including personnel, equipment, materials, and facilities for engineering activities"
      },
      "typeVersion": 3
    },
    {
      "id": "27356240-2b2f-4723-b722-279fbfca7b32",
      "name": "Testing Validation Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1600,
        256
      ],
      "parameters": {
        "text": "={{ $fromAI('testingRequirements', 'Testing requirements for design validation, safety verification, or maintenance diagnostics', 'json') }}",
        "options": {
          "systemMessage": "You are a Testing Validation Specialist Agent responsible for closed-loop testing and validation protocols.\n\nYour task is to:\n1. Analyze testing requirements for design validation, safety verification, and maintenance diagnostics\n2. Design comprehensive test protocols including functional, stress, environmental, and lifecycle testing\n3. Define test acceptance criteria and pass/fail thresholds\n4. Identify required test equipment, instrumentation, and measurement systems\n5. Assess test coverage and identify gaps in validation strategy\n6. Recommend test sequencing and dependencies\n7. Provide detailed testing plan with procedures, resources, and timelines\n\nConsider: test standards, measurement accuracy, repeatability, and documentation requirements.\n\nReturn structured testing validation plan with protocols and success criteria."
        },
        "hasOutputParser": true,
        "toolDescription": "Designs closed-loop testing and validation protocols for design validation, safety verification, and maintenance diagnostics"
      },
      "typeVersion": 3
    },
    {
      "id": "b15d49ec-b3c5-4af9-9a76-a4a5e7db7a9a",
      "name": "Design Validation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1888,
        256
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"validationStatus\": \"PASS | FAIL | CONDITIONAL\",\n  \"designRiskScore\": 0,\n  \"structuralWeaknesses\": [\n    {\n      \"location\": \"Component or area identifier\",\n      \"severity\": \"CRITICAL | HIGH | MEDIUM | LOW\",\n      \"description\": \"Detailed weakness description\",\n      \"recommendation\": \"Mitigation action\"\n    }\n  ],\n  \"materialIssues\": [\n    {\n      \"material\": \"Material name\",\n      \"issue\": \"Issue description\",\n      \"impact\": \"Performance impact\"\n    }\n  ],\n  \"complianceFindings\": [],\n  \"resourceRequirements\": {},\n  \"testingRecommendations\": [],\n  \"overallAssessment\": \"Summary of validation findings\",\n  \"criticalActions\": [\"Action 1\", \"Action 2\"],\n  \"confidenceScore\": 0\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "33754639-45b5-4feb-9854-8f102f290873",
      "name": "Safety Optimization Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1616,
        896
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"safetyStatus\": \"SAFE | AT_RISK | UNSAFE\",\n  \"safetyRiskScore\": 0,\n  \"identifiedHazards\": [\n    {\n      \"hazardType\": \"MECHANICAL | ELECTRICAL | THERMAL | CHEMICAL | HUMAN_FACTORS\",\n      \"severity\": \"CATASTROPHIC | CRITICAL | MARGINAL | NEGLIGIBLE\",\n      \"likelihood\": \"FREQUENT | PROBABLE | OCCASIONAL | REMOTE | IMPROBABLE\",\n      \"description\": \"Hazard description\",\n      \"affectedSystems\": [\"System 1\", \"System 2\"],\n      \"mitigationStrategy\": \"Recommended mitigation\"\n    }\n  ],\n  \"failureScenarios\": [\n    {\n      \"scenario\": \"Failure scenario description\",\n      \"cascadingEffects\": [\"Effect 1\", \"Effect 2\"],\n      \"preventionMeasures\": [\"Measure 1\", \"Measure 2\"]\n    }\n  ],\n  \"safetyMargins\": {},\n  \"complianceStatus\": {},\n  \"resourceNeeds\": {},\n  \"testingProtocols\": [],\n  \"prioritizedActions\": [\"Action 1\", \"Action 2\"],\n  \"confidenceScore\": 0\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "cd467ade-7f63-450d-aaea-ab298a02d1c8",
      "name": "Predictive Maintenance Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1776,
        1312
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"maintenanceUrgency\": \"IMMEDIATE | URGENT | SCHEDULED | ROUTINE\",\n  \"maintenanceRiskScore\": 0,\n  \"predictedFailures\": [\n    {\n      \"component\": \"Component identifier\",\n      \"failureMode\": \"Failure mode description\",\n      \"remainingUsefulLife\": \"Time estimate\",\n      \"failureProbability\": 0,\n      \"businessImpact\": \"HIGH | MEDIUM | LOW\",\n      \"earlyWarningSignals\": [\"Signal 1\", \"Signal 2\"]\n    }\n  ],\n  \"performanceBottlenecks\": [\n    {\n      \"system\": \"System identifier\",\n      \"bottleneck\": \"Bottleneck description\",\n      \"efficiencyLoss\": \"Percentage or metric\",\n      \"optimizationAction\": \"Recommended action\"\n    }\n  ],\n  \"degradationPatterns\": [],\n  \"maintenanceSchedule\": [\n    {\n      \"activity\": \"Maintenance activity\",\n      \"priority\": \"CRITICAL | HIGH | MEDIUM | LOW\",\n      \"recommendedDate\": \"Date or timeframe\",\n      \"estimatedDuration\": \"Duration estimate\"\n    }\n  ],\n  \"complianceStatus\": {},\n  \"resourceAllocation\": {},\n  \"diagnosticTests\": [],\n  \"confidenceScore\": 0\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "2b00996f-9cf2-4362-9157-be3dacc260bd",
      "name": "Compliance Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1168,
        464
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"complianceStatus\": \"COMPLIANT | MINOR_GAP | MAJOR_GAP | NON_COMPLIANT\",\n  \"applicableStandards\": [\"ISO 9001\", \"ASME BPVC\", \"IEC 61508\"],\n  \"complianceGaps\": [\n    {\n      \"standard\": \"Standard identifier\",\n      \"requirement\": \"Requirement description\",\n      \"gapSeverity\": \"CRITICAL | HIGH | MEDIUM | LOW\",\n      \"currentState\": \"Current compliance state\",\n      \"requiredState\": \"Required compliance state\",\n      \"remediationAction\": \"Action to close gap\"\n    }\n  ],\n  \"documentationStatus\": \"COMPLETE | INCOMPLETE | MISSING\",\n  \"certificationRequirements\": [],\n  \"auditReadiness\": \"READY | NEEDS_WORK | NOT_READY\",\n  \"complianceRiskScore\": 0,\n  \"recommendations\": [\"Recommendation 1\", \"Recommendation 2\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "227a6331-4bfe-48f6-a2a7-a976f084e544",
      "name": "Resource Coordination Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1472,
        464
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"resourceAllocationStatus\": \"ALLOCATED | PARTIAL | CONFLICT | UNAVAILABLE\",\n  \"personnelRequirements\": [\n    {\n      \"role\": \"Role or skill required\",\n      \"quantity\": 0,\n      \"availability\": \"AVAILABLE | LIMITED | UNAVAILABLE\",\n      \"assignedPersonnel\": [\"Person 1\", \"Person 2\"]\n    }\n  ],\n  \"equipmentRequirements\": [\n    {\n      \"equipment\": \"Equipment identifier\",\n      \"quantity\": 0,\n      \"availability\": \"AVAILABLE | SCHEDULED | UNAVAILABLE\",\n      \"scheduledTime\": \"Time slot\"\n    }\n  ],\n  \"materialRequirements\": [\n    {\n      \"material\": \"Material identifier\",\n      \"quantity\": \"Quantity with units\",\n      \"leadTime\": \"Lead time estimate\",\n      \"supplier\": \"Supplier name\"\n    }\n  ],\n  \"resourceConflicts\": [],\n  \"allocationPlan\": {},\n  \"utilizationEfficiency\": 0,\n  \"contingencyOptions\": [\"Option 1\", \"Option 2\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7181aaff-a3a9-4600-b39f-27e098ecee20",
      "name": "Testing Validation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1744,
        464
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"testingStrategy\": \"COMPREHENSIVE | TARGETED | MINIMAL\",\n  \"testProtocols\": [\n    {\n      \"testType\": \"FUNCTIONAL | STRESS | ENVIRONMENTAL | LIFECYCLE | SAFETY\",\n      \"testName\": \"Test protocol name\",\n      \"objective\": \"Test objective\",\n      \"procedure\": \"Test procedure summary\",\n      \"acceptanceCriteria\": \"Pass/fail criteria\",\n      \"estimatedDuration\": \"Duration estimate\"\n    }\n  ],\n  \"requiredEquipment\": [],\n  \"testSequence\": [],\n  \"coverageAnalysis\": \"Test coverage assessment\",\n  \"testGaps\": [],\n  \"documentationRequirements\": [],\n  \"estimatedCost\": \"Cost estimate\",\n  \"recommendations\": [\"Recommendation 1\", \"Recommendation 2\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "4307be8e-5028-4d2e-aed9-0ad0441a9f7a",
      "name": "Anthropic Model - Design Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        896,
        256
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "5232995b-a46f-46f2-ac97-b1f0f390409c",
      "name": "Anthropic Model - Safety Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1232,
        912
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c3fc0e20-7ee0-45e6-8797-a14538efc472",
      "name": "Anthropic Model - Maintenance Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1472,
        1312
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f2cfab73-db1a-40c3-b543-d54606d97104",
      "name": "Anthropic Model - Compliance Tool",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1024,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "48f68337-17f0-4260-a9c4-67290263c396",
      "name": "Anthropic Model - Resource Tool",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1312,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0840c22a-625a-4232-8331-599a43f16341",
      "name": "Anthropic Model - Testing Tool",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1600,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-5-20250929",
          "cachedResultName": "Claude Sonnet 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "31e1981e-0249-4105-8e3c-d81a3f7d8623",
      "name": "Consolidate Analysis Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        2096,
        696
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "d36b84db-b77b-44da-b43f-85d891b2d94d",
      "name": "Calculate Risk Scores",
      "type": "n8n-nodes-base.code",
      "position": [
        2320,
        712
      ],
      "parameters": {
        "jsCode": "// Calculate Risk Scores from Agent Outputs\n// Consolidates analysis from Design Validation, Safety Optimization, and Predictive Maintenance agents\n\nconst items = $input.all();\nconst results = [];\n\n// Get workflow configuration thresholds\nconst config = $('Workflow Configuration').first().json;\nconst criticalThreshold = config.criticalRiskThreshold || 80;\nconst highThreshold = config.highRiskThreshold || 60;\nconst mediumThreshold = config.mediumRiskThreshold || 40;\n\nfor (const item of items) {\n  const json = item.json;\n  \n  // Extract risk scores from each agent's output\n  const designRisk = json.designValidation?.riskScore || 0;\n  const safetyRisk = json.safetyOptimization?.riskScore || 0;\n  const maintenanceRisk = json.predictiveMaintenance?.riskScore || 0;\n  \n  // Calculate weighted overall risk score\n  // Design: 30%, Safety: 40%, Maintenance: 30%\n  const overallRiskScore = Math.round(\n    (designRisk * 0.3) + \n    (safetyRisk * 0.4) + \n    (maintenanceRisk * 0.3)\n  );\n  \n  // Determine risk level based on thresholds\n  let riskLevel = 'low';\n  if (overallRiskScore >= criticalThreshold) {\n    riskLevel = 'critical';\n  } else if (overallRiskScore >= highThreshold) {\n    riskLevel = 'high';\n  } else if (overallRiskScore >= mediumThreshold) {\n    riskLevel = 'medium';\n  }\n  \n  // Compile all issues from agents\n  const allIssues = [\n    ...(json.designValidation?.issues || []),\n    ...(json.safetyOptimization?.issues || []),\n    ...(json.predictiveMaintenance?.issues || [])\n  ];\n  \n  // Count issues by severity\n  const issueCounts = {\n    critical: allIssues.filter(i => i.severity === 'critical').length,\n    high: allIssues.filter(i => i.severity === 'high').length,\n    medium: allIssues.filter(i => i.severity === 'medium').length,\n    low: allIssues.filter(i => i.severity === 'low').length\n  };\n  \n  results.push({\n    json: {\n      ...json,\n      riskAnalysis: {\n        overallRiskScore,\n        riskLevel,\n        componentScores: {\n          design: designRisk,\n          safety: safetyRisk,\n          maintenance: maintenanceRisk\n        },\n        issueCounts,\n        allIssues,\n        timestamp: new Date().toISOString(),\n        thresholdsUsed: {\n          critical: criticalThreshold,\n          high: highThreshold,\n          medium: mediumThreshold\n        }\n      }\n    }\n  });\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "ff468557-cb06-4b2e-8d08-677f0650f3a8",
      "name": "Route by Risk Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        2544,
        680
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "CRITICAL",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.overallRiskScore }}",
                    "rightValue": "={{ $('Workflow Configuration').item.json.criticalRiskThreshold }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "HIGH",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.overallRiskScore }}",
                    "rightValue": "={{ $('Workflow Configuration').item.json.highRiskThreshold }}"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "MEDIUM",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.overallRiskScore }}",
                    "rightValue": "={{ $('Workflow Configuration').item.json.mediumRiskThreshold }}"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "LOW"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "145abb6c-9963-4ed7-87b1-03d31eda3e99",
      "name": "Alert Critical Issues",
      "type": "n8n-nodes-base.slack",
      "position": [
        2768,
        320
      ],
      "parameters": {
        "text": "=\ud83d\udea8 *CRITICAL ENGINEERING ALERT*\n\n*Project:* {{ $json.projectId }}\n*Overall Risk Score:* {{ $json.overallRiskScore }}/100\n*Timestamp:* {{ $json.timestamp }}\n\n*Design Validation:* {{ $json.designValidation.validationStatus }} (Risk: {{ $json.designValidation.designRiskScore }})\n*Safety Analysis:* {{ $json.safetyOptimization.safetyStatus }} (Risk: {{ $json.safetyOptimization.safetyRiskScore }})\n*Maintenance Prediction:* {{ $json.predictiveMaintenance.maintenanceUrgency }} (Risk: {{ $json.predictiveMaintenance.maintenanceRiskScore }})\n\n*Critical Actions Required:*\n{{ $json.criticalActions.map((action, i) => `${i+1}. ${action}`).join('\\n') }}\n\n*Immediate Attention Required* \u26a0\ufe0f",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannelId }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "d17a6f8a-75c2-4744-9be2-c96a4332e971",
      "name": "Alert High Priority Issues",
      "type": "n8n-nodes-base.slack",
      "position": [
        2768,
        520
      ],
      "parameters": {
        "text": "=\u26a0\ufe0f *HIGH PRIORITY ENGINEERING ALERT*\n\n*Project:* {{ $json.projectId }}\n*Overall Risk Score:* {{ $json.overallRiskScore }}/100\n*Timestamp:* {{ $json.timestamp }}\n\n*Design Validation:* {{ $json.designValidation.validationStatus }} (Risk: {{ $json.designValidation.designRiskScore }})\n*Safety Analysis:* {{ $json.safetyOptimization.safetyStatus }} (Risk: {{ $json.safetyOptimization.safetyRiskScore }})\n*Maintenance Prediction:* {{ $json.predictiveMaintenance.maintenanceUrgency }} (Risk: {{ $json.predictiveMaintenance.maintenanceRiskScore }})\n\n*Priority Actions:*\n{{ $json.priorityActions.map((action, i) => `${i+1}. ${action}`).join('\\n') }}\n\n*Review and address within 24 hours*",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannelId }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "8338bfa3-1248-4e9f-83ce-adf8c67012d4",
      "name": "Log Medium Priority Issues",
      "type": "n8n-nodes-base.set",
      "position": [
        2768,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "logLevel",
              "type": "string",
              "value": "MEDIUM"
            },
            {
              "id": "id-2",
              "name": "logMessage",
              "type": "string",
              "value": "={{ 'Medium priority issues logged for project ' + $json.projectId }}"
            },
            {
              "id": "id-3",
              "name": "loggedAt",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d1a5ae1-aa9e-4353-be23-2d2ee66495e5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -304
      ],
      "parameters": {
        "width": 672,
        "height": 272,
        "content": "## How It Works\nThis workflow automates engineering governance by deploying a multi-agent AI system that validates designs, checks compliance, optimises safety, and predicts maintenance needs. Designed for engineering teams, quality assurance officers, and operations managers in regulated industries, it eliminates manual review bottlenecks and ensures systemic risk issues are escalated promptly. A schedule trigger fetches design specifications and operational data, merges them, then routes to three parallel agent tracks: Design Validation (with Compliance Verification, Resource Coordination, and Testing Validation sub-agents), Safety Optimisation, and Predictive Maintenance. All outputs consolidate into a risk score calculator, which routes by risk level\u2014critical and high issues trigger Slack alerts immediately, while medium and low issues are logged for review.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e28aa4e1-34ea-40d6-8b72-2418741d4fc2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        -304
      ],
      "parameters": {
        "width": 480,
        "height": 240,
        "content": "## Setup Steps\n1. Set schedule trigger interval to match governance review frequency.\n2. Add Anthropic API credentials to all Anthropic Model nodes.\n3. Connect design specification and operational data sources to fetch nodes.\n4. Configure Slack credentials for critical and high-priority alert channels.\n5. Define risk scoring thresholds in the Calculate Risk Scores node."
      },
      "typeVersion": 1
    },
    {
      "id": "aee29c0c-df18-43a5-8736-97c500c3f265",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -400
      ],
      "parameters": {
        "color": 5,
        "width": 544,
        "height": 320,
        "content": "## Prerequisites\n- Slack workspace with bot token\n- Design and operational data sources (API or database)\n## Use Cases\n- Automated design compliance auditing for aerospace or manufacturing\n- Real-time safety risk detection in industrial operations\n## Customization\n- Add sub-agents for environmental, cost, or regulatory compliance\n## Benefits\n- Automates multi-dimensional engineering governance on a schedule"
      },
      "typeVersion": 1
    },
    {
      "id": "aef8a71b-4706-4250-8e06-832cea586d50",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        288
      ],
      "parameters": {
        "color": 7,
        "width": 848,
        "height": 784,
        "content": "## Merge Engineering Data\n**What** \u2013 Combines design and operational inputs into unified context.\n**Why** \u2013 Provides all agents with complete, consistent data for accurate analysis."
      },
      "typeVersion": 1
    },
    {
      "id": "4447214e-31eb-4ee6-a9b0-f9067e324438",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 1200,
        "height": 656,
        "content": "## Design Validation Agent\n**What** \u2013 Runs compliance, resource coordination, and testing validation sub-agents.\n**Why** \u2013 Covers all design governance dimensions in a single orchestrated pass."
      },
      "typeVersion": 1
    },
    {
      "id": "71493d0c-1f03-4884-bf0a-5c0d3a32e702",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        624
      ],
      "parameters": {
        "color": 7,
        "width": 1184,
        "height": 432,
        "content": "## Safety Optimisation Agent\n**What** \u2013 Analyses merged data for safety risks and optimisation opportunities.\n**Why** \u2013 Proactively identifies hazards before they escalate to incidents."
      },
      "typeVersion": 1
    },
    {
      "id": "2cb760c9-cfc3-4785-88b5-4d9a0b13c6a4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        1088
      ],
      "parameters": {
        "color": 7,
        "width": 1168,
        "height": 368,
        "content": "## Predictive Maintenance Agent\n**What** \u2013 Forecasts maintenance needs from operational data patterns.\n**Why** \u2013 Prevents unplanned downtime through early intervention signals."
      },
      "typeVersion": 1
    },
    {
      "id": "1640d8ab-77aa-40c9-bb73-e93785bcf5b7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 896,
        "height": 720,
        "content": "## Consolidate, Score & Route\n**What** \u2013 Merges all outputs, calculates risk scores, routes by severity level.\n**Why** \u2013 Ensures critical and high-risk findings trigger immediate Slack alerts.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "d9908947-28dc-487d-9728-e05bd73c4150",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Risk Level": {
      "main": [
        [
          {
            "node": "Alert Critical Issues",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Alert High Priority Issues",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Medium Priority Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Risk Scores": {
      "main": [
        [
          {
            "node": "Route by Risk Level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Operational Data": {
      "main": [
        [
          {
            "node": "Merge Engineering Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Engineering Data": {
      "main": [
        [
          {
            "node": "Design Validation Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Safety Optimization Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Predictive Maintenance Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Design Specifications",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Operational Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Design Validation Agent": {
      "main": [
        [
          {
            "node": "Consolidate Analysis Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compliance Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Compliance Verification Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Safety Optimization Agent": {
      "main": [
        [
          {
            "node": "Consolidate Analysis Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Fetch Design Specifications": {
      "main": [
        [
          {
            "node": "Merge Engineering Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate Analysis Results": {
      "main": [
        [
          {
            "node": "Calculate Risk Scores",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Predictive Maintenance Agent": {
      "main": [
        [
          {
            "node": "Consolidate Analysis Results",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Testing Validation Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Design Validation Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Safety Optimization Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Predictive Maintenance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Design Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Design Validation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Safety Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Safety Optimization Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Testing Tool": {
      "ai_languageModel": [
        [
          {
            "node": "Testing Validation Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Resource Tool": {
      "ai_languageModel": [
        [
          {
            "node": "Resource Coordination Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Design Validation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Design Validation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Resource Coordination Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Design Validation Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Safety Optimization Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Predictive Maintenance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Testing Validation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Testing Validation Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Compliance Tool": {
      "ai_languageModel": [
        [
          {
            "node": "Compliance Verification Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Safety Optimization Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Safety Optimization Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Compliance Verification Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Design Validation Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Safety Optimization Agent",
            "type": "ai_tool",
            "index": 0
          },
          {
            "node": "Predictive Maintenance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Model - Maintenance Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Predictive Maintenance Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Resource Coordination Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Resource Coordination Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Predictive Maintenance Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Predictive Maintenance Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}