AutomationFlowsAI & RAG › Coordinate Smart Factory Operations with Openai Gpt-4.1-mini and Slack Alerts

Coordinate Smart Factory Operations with Openai Gpt-4.1-mini and Slack Alerts

ByCheng Siong Chin @cschin on n8n.io

This workflow automates cross-factory operations management by deploying a multi-agent AI system that validates production data, coordinates scheduling, procurement, and quality escalation, then routes outcomes by priority. Designed for manufacturing operations managers, supply…

Cron / scheduled trigger★★★★★ complexityAI-powered31 nodesHTTP RequestOpenAI ChatOutput Parser StructuredAgentAgent ToolSlack
AI & RAG Trigger: Cron / scheduled Nodes: 31 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13709 — 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": "4mdAbPsiuKi9eBjS8DwzK",
  "name": "Smart factory operations coordinator with multi-agent scheduling alerts",
  "tags": [],
  "nodes": [
    {
      "id": "ad845c62-9140-4d49-83d5-dbf9bcb4eb85",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2672,
        192
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "03bbf651-be95-4cea-8d5c-0ae474fbebb2",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -2448,
        192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "productionApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Production API endpoint URL__>"
            },
            {
              "id": "id-2",
              "name": "supplyChainApiUrl",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Supply chain API endpoint URL__>"
            },
            {
              "id": "id-3",
              "name": "slackChannelId",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Slack channel ID for alerts__>"
            },
            {
              "id": "id-4",
              "name": "criticalThreshold",
              "type": "number",
              "value": 90
            },
            {
              "id": "id-5",
              "name": "highThreshold",
              "type": "number",
              "value": 70
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "2a801363-82a9-48df-9dfd-aa7845df059e",
      "name": "Fetch Production Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2224,
        96
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.productionApiUrl }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "46511d05-a962-4e44-a1d5-aa51c9ac79a8",
      "name": "Fetch Supply Chain Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2224,
        288
      ],
      "parameters": {
        "url": "={{ $('Workflow Configuration').first().json.supplyChainApiUrl }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "dec5ae4a-4558-475e-88bb-c2e5e1840f9e",
      "name": "Merge Operations Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2000,
        192
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "72856495-4ca3-4d55-8150-6e6633a20b16",
      "name": "OpenAI Model - Validation Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1792,
        416
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e8c97995-4f5b-431d-bc89-0263d0bd269e",
      "name": "Validation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1640,
        416
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"validationId\": {\n      \"type\": \"string\"\n    },\n    \"productLine\": {\n      \"type\": \"string\",\n      \"enum\": [\"chemicals\", \"electronics\", \"motor_vehicles\", \"furniture\", \"food_products\"]\n    },\n    \"validationStatus\": {\n      \"type\": \"string\",\n      \"enum\": [\"valid\", \"warning\", \"critical\"]\n    },\n    \"productionSignals\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"outputRate\": {\n          \"type\": \"number\"\n        },\n        \"defectRate\": {\n          \"type\": \"number\"\n        },\n        \"downtimeMinutes\": {\n          \"type\": \"number\"\n        },\n        \"utilizationPercent\": {\n          \"type\": \"number\"\n        }\n      }\n    },\n    \"inventorySignals\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"stockLevel\": {\n          \"type\": \"number\"\n        },\n        \"reorderPoint\": {\n          \"type\": \"number\"\n        },\n        \"turnoverRate\": {\n          \"type\": \"number\"\n        },\n        \"expiryRisk\": {\n          \"type\": \"number\"\n        }\n      }\n    },\n    \"supplyChainSignals\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"leadTimeDays\": {\n          \"type\": \"number\"\n        },\n        \"supplierReliability\": {\n          \"type\": \"number\"\n        },\n        \"logisticsDelay\": {\n          \"type\": \"number\"\n        },\n        \"costVariance\": {\n          \"type\": \"number\"\n        }\n      }\n    },\n    \"anomalies\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"safetyFlags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"complianceIssues\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"priorityLevel\": {\n      \"type\": \"string\",\n      \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\", \"CRITICAL\"]\n    },\n    \"recommendedActions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"reasoning\": {\n      \"type\": \"string\"\n    }\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "14193227-6a2e-4747-a06a-ca16c3ef541c",
      "name": "Operations Validation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1776,
        192
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are an Operations Validation Agent specialized in analyzing multi-product manufacturing operations across chemicals, electronics, motor vehicles, furniture, and food products.\n\nYour task is to:\n1. Inspect structured production signals (output rate, defect rate, downtime, utilization) for each product line\n2. Analyze inventory signals (stock levels, reorder points, turnover rates, expiry risks)\n3. Evaluate supply chain signals (lead times, supplier reliability, logistics delays, cost variance)\n4. Identify anomalies, safety flags, and compliance issues specific to each product category\n5. Assess priority level (LOW, MEDIUM, HIGH, CRITICAL) based on signal severity and business impact\n6. Recommend specific actions for each identified issue\n7. Provide detailed reasoning for validation assessment\n\nConsider industry-specific requirements:\n- Chemicals: Safety protocols, hazardous material handling, regulatory compliance\n- Electronics: Component availability, quality control, supply chain complexity\n- Motor Vehicles: Just-in-time inventory, assembly line efficiency, supplier coordination\n- Furniture: Material sourcing, production scheduling, seasonal demand\n- Food Products: Expiry management, cold chain integrity, food safety standards\n\nReturn structured validation output with comprehensive signal analysis and actionable recommendations."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "20c550d8-4489-4ba9-89e8-a20e1d43b6ef",
      "name": "OpenAI Model - Scheduling Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1328,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "31e00a8d-2565-47ca-9635-dac6d7be9c76",
      "name": "Scheduling Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1152,
        624
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"schedulingId\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"productLine\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"schedulingRecommendations\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"action\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"timeframe\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"resourcesRequired\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"productionSchedule\": {\n\t\t\t\"type\": \"object\",\n\t\t\t\"properties\": {\n\t\t\t\t\"shiftAdjustments\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"capacityReallocation\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t},\n\t\t\t\t\"maintenanceWindows\": {\n\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"conflictResolution\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t},\n\t\t\"estimatedImpact\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"reasoning\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "cf09ba75-21f1-42bf-b050-095cda957277",
      "name": "Scheduling Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1296,
        416
      ],
      "parameters": {
        "text": "={{ $fromAI('validationData', 'Validation results and operational signals for scheduling analysis', 'json') }}",
        "options": {
          "systemMessage": "You are a Scheduling Coordination Agent responsible for optimizing production schedules across multiple product lines and factories.\n\nYour task is to:\n1. Analyze validation results and operational signals to identify scheduling needs\n2. Recommend production schedule adjustments (shift changes, capacity reallocation, maintenance windows)\n3. Resolve scheduling conflicts between product lines and factories\n4. Prioritize scheduling actions based on urgency and business impact\n5. Calculate resource requirements and timeframes for schedule changes\n6. Estimate impact of scheduling adjustments on overall operations\n7. Provide detailed reasoning for scheduling recommendations\n\nConsider operational constraints, resource availability, and cross-factory dependencies.\n\nReturn structured scheduling recommendations with conflict resolution and impact assessment."
        },
        "hasOutputParser": true,
        "toolDescription": "Coordinates production scheduling across multiple product lines and factories, resolves conflicts, and optimizes resource allocation"
      },
      "typeVersion": 3
    },
    {
      "id": "465b74b7-07e8-4d36-ac13-391cedcd39be",
      "name": "OpenAI Model - Procurement Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1008,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8852f043-4809-4b0c-8c9f-345cbe177526",
      "name": "Procurement Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -848,
        624
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"procurementId\": {\n      \"type\": \"string\"\n    },\n    \"productLine\": {\n      \"type\": \"string\"\n    },\n    \"procurementAlerts\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"material\": {\n            \"type\": \"string\"\n          },\n          \"currentStock\": {\n            \"type\": \"number\"\n          },\n          \"reorderThreshold\": {\n            \"type\": \"number\"\n          },\n          \"urgency\": {\n            \"type\": \"string\"\n          },\n          \"supplier\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"supplierRecommendations\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"costOptimization\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"potentialSavings\": {\n          \"type\": \"number\"\n        },\n        \"alternativeSuppliers\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"bulkOrderOpportunities\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"leadTimeAnalysis\": {\n      \"type\": \"string\"\n    },\n    \"reasoning\": {\n      \"type\": \"string\"\n    }\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7a9b884c-f7cc-45e9-aa52-9854e7d70ad9",
      "name": "Procurement Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1008,
        416
      ],
      "parameters": {
        "text": "={{ $fromAI('validationData', 'Validation results with inventory and supply chain signals for procurement analysis', 'json') }}",
        "options": {
          "systemMessage": "You are a Procurement Alert Agent responsible for monitoring inventory levels and triggering procurement actions across multiple product lines.\n\nYour task is to:\n1. Analyze inventory signals to identify materials approaching reorder thresholds\n2. Generate procurement alerts with urgency levels based on stock depletion rates\n3. Recommend suppliers based on reliability, lead times, and cost\n4. Identify cost optimization opportunities (bulk orders, alternative suppliers, negotiation leverage)\n5. Analyze lead time risks and recommend proactive procurement strategies\n6. Consider product-specific procurement requirements (chemicals: regulatory compliance, electronics: component availability, etc.)\n7. Provide detailed reasoning for procurement recommendations\n\nReturn structured procurement alerts with supplier recommendations and cost optimization strategies."
        },
        "hasOutputParser": true,
        "toolDescription": "Monitors inventory levels, generates procurement alerts, and recommends supplier strategies for material replenishment"
      },
      "typeVersion": 3
    },
    {
      "id": "db51cdaa-24b1-412f-bc7b-fccd358725ec",
      "name": "OpenAI Model - Quality Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -672,
        624
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "4e88f4c9-de07-46a7-b1b1-bcb6702a6ab8",
      "name": "Quality Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -480,
        624
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"escalationId\": {\n      \"type\": \"string\"\n    },\n    \"productLine\": {\n      \"type\": \"string\"\n    },\n    \"qualityIssues\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"issueType\": {\n            \"type\": \"string\"\n          },\n          \"severity\": {\n            \"type\": \"string\"\n          },\n          \"affectedBatches\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            }\n          },\n          \"rootCause\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"escalationLevel\": {\n      \"type\": \"string\",\n      \"enum\": [\"team_lead\", \"quality_manager\", \"plant_director\", \"executive\"]\n    },\n    \"correctiveActions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"preventiveMeasures\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"complianceRisk\": {\n      \"type\": \"string\"\n    },\n    \"reasoning\": {\n      \"type\": \"string\"\n    }\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "8ba64c81-c560-4f35-97a9-0e6fa0464105",
      "name": "Quality Escalation Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -720,
        416
      ],
      "parameters": {
        "text": "={{ $fromAI('validationData', 'Validation results with quality signals, defect rates, and compliance issues', 'json') }}",
        "options": {
          "systemMessage": "You are a Quality Escalation Agent responsible for identifying quality issues and determining appropriate escalation levels across multiple product lines.\n\nYour task is to:\n1. Analyze quality signals including defect rates, safety flags, and compliance issues\n2. Identify quality issues requiring escalation based on severity and business impact\n3. Determine escalation level (team_lead, quality_manager, plant_director, executive) based on issue criticality\n4. Recommend corrective actions to address immediate quality problems\n5. Suggest preventive measures to avoid recurrence\n6. Assess compliance risk and regulatory implications\n7. Provide detailed reasoning for escalation decisions\n\nConsider product-specific quality standards:\n- Chemicals: Safety protocols, purity standards, hazardous material handling\n- Electronics: Component quality, testing requirements, reliability standards\n- Motor Vehicles: Safety certifications, recall risk, regulatory compliance\n- Furniture: Material quality, structural integrity, safety standards\n- Food Products: Food safety, contamination risk, expiry management\n\nReturn structured quality escalation with corrective actions and compliance risk assessment."
        },
        "hasOutputParser": true,
        "toolDescription": "Identifies quality issues, determines escalation levels, and recommends corrective and preventive actions"
      },
      "typeVersion": 3
    },
    {
      "id": "283f5925-0422-4b05-8e42-dcc42dd2d093",
      "name": "OpenAI Model - Coordination Agent",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1424,
        416
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b8e3c323-8ca2-43ab-a337-81965cd7b5b1",
      "name": "Coordination Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -432,
        416
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"coordinationId\": {\n      \"type\": \"string\"\n    },\n    \"priorityLevel\": {\n      \"type\": \"string\",\n      \"enum\": [\"LOW\", \"MEDIUM\", \"HIGH\", \"CRITICAL\"]\n    },\n    \"coordinatedActions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"actionType\": {\n            \"type\": \"string\"\n          },\n          \"productLine\": {\n            \"type\": \"string\"\n          },\n          \"factory\": {\n            \"type\": \"string\"\n          },\n          \"assignedTo\": {\n            \"type\": \"string\"\n          },\n          \"deadline\": {\n            \"type\": \"string\"\n          },\n          \"status\": {\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"crossFactoryReport\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"operationalSummary\": {\n          \"type\": \"string\"\n        },\n        \"affectedFactories\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          }\n        },\n        \"resourceAllocation\": {\n          \"type\": \"string\"\n        },\n        \"complianceStatus\": {\n          \"type\": \"string\"\n        },\n        \"safetyStatus\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"schedulingDecisions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"procurementDecisions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"qualityEscalations\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"traceabilityReport\": {\n      \"type\": \"string\"\n    },\n    \"reasoning\": {\n      \"type\": \"string\"\n    }\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "e65e37cc-1ae7-45be-ba51-227cf0ca87a0",
      "name": "Cross-Factory Coordination Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1000,
        192
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "You are a Cross-Factory Coordination Agent responsible for orchestrating operations across multiple product lines and manufacturing facilities.\n\nYour task is to:\n1. Receive validation results from the Operations Validation Agent\n2. Coordinate specialized agent tools to address identified issues:\n   - Call Scheduling Agent Tool for production schedule optimization and conflict resolution\n   - Call Procurement Agent Tool for inventory replenishment and supplier coordination\n   - Call Quality Escalation Agent Tool for quality issues requiring management attention\n3. Synthesize recommendations from all agent tools into coordinated action plans\n4. Generate cross-factory reports covering operational status, resource allocation, compliance, and safety\n5. Enforce safety protocols and compliance requirements across all product lines\n6. Maintain traceability of all decisions and actions for audit purposes\n7. Determine overall priority level (LOW, MEDIUM, HIGH, CRITICAL) for coordination response\n8. Provide comprehensive reasoning for coordination decisions\n\nConsider cross-factory dependencies, resource constraints, and regulatory requirements.\n\nReturn structured coordination output with actionable decisions and comprehensive reporting."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "6a2aa32a-dbba-4e2c-adc5-f1528987ffc9",
      "name": "Route by Priority",
      "type": "n8n-nodes-base.switch",
      "position": [
        -208,
        336
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Critical",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.priorityLevel }}",
                    "rightValue": "CRITICAL"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "High",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.priorityLevel }}",
                    "rightValue": "HIGH"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Routine"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4526d2e8-cfa2-4a0e-92df-6b2adc10c25d",
      "name": "Critical Alert - Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        16,
        544
      ],
      "parameters": {
        "text": "=\ud83d\udea8 **CRITICAL ALERT** \ud83d\udea8\n\n**Coordination ID:** {{ $json.coordinationId }}\n**Priority Level:** {{ $json.priorityLevel }}\n**Timestamp:** {{ $now.toISO() }}\n\n**Operational Summary:**\n{{ $json.crossFactoryReport.operationalSummary }}\n\n**Action Count:** {{ $json.coordinatedActions.length }}\n**Compliance Status:** {{ $json.crossFactoryReport.complianceStatus }}\n\n**Traceability Report:**\n{{ $json.traceabilityReport }}",
        "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": "13346565-45e5-4305-8932-aaea4e123b1e",
      "name": "High Priority Alert - Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        16,
        160
      ],
      "parameters": {
        "text": "=\u26a0\ufe0f **HIGH PRIORITY ALERT** \u26a0\ufe0f\n\n**Coordination ID:** {{ $json.coordinationId }}\n**Priority Level:** {{ $json.priorityLevel }}\n**Timestamp:** {{ $now.toISO() }}\n\n**Operational Summary:**\n{{ $json.crossFactoryReport.operationalSummary }}\n\n**Coordinated Actions:** {{ $json.coordinatedActions.length }}\n**Affected Factories:** {{ $json.crossFactoryReport.affectedFactories.join(\", \") }}\n**Compliance Status:** {{ $json.crossFactoryReport.complianceStatus }}\n**Safety Status:** {{ $json.crossFactoryReport.safetyStatus }}\n\n**Key Decisions:**\n- Scheduling: {{ $json.schedulingDecisions.join(\", \") }}\n- Procurement: {{ $json.procurementDecisions.join(\", \") }}\n- Quality: {{ $json.qualityEscalations.join(\", \") }}",
        "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": "1d2e58bc-075b-49f7-9174-c1517940b799",
      "name": "Log Routine Operations",
      "type": "n8n-nodes-base.set",
      "position": [
        16,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "logTimestamp",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            },
            {
              "id": "id-2",
              "name": "coordinationId",
              "type": "string",
              "value": "={{ $json.coordinationId }}"
            },
            {
              "id": "id-3",
              "name": "priorityLevel",
              "type": "string",
              "value": "={{ $json.priorityLevel }}"
            },
            {
              "id": "id-4",
              "name": "operationalSummary",
              "type": "string",
              "value": "={{ $json.crossFactoryReport.operationalSummary }}"
            },
            {
              "id": "id-5",
              "name": "actionCount",
              "type": "number",
              "value": "={{ $json.coordinatedActions.length }}"
            },
            {
              "id": "id-6",
              "name": "complianceStatus",
              "type": "string",
              "value": "={{ $json.crossFactoryReport.complianceStatus }}"
            },
            {
              "id": "id-7",
              "name": "safetyStatus",
              "type": "string",
              "value": "={{ $json.crossFactoryReport.safetyStatus }}"
            },
            {
              "id": "id-8",
              "name": "traceabilityReport",
              "type": "string",
              "value": "={{ $json.traceabilityReport }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c114e9bd-9c78-4395-9887-d31a47e39016",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -400
      ],
      "parameters": {
        "color": 6,
        "width": 432,
        "height": 384,
        "content": "## Prerequisites\n- Slack workspace with bot token\n- Production and supply chain data sources (API or database)\n## Use Cases\n- Automated cross-factory scheduling conflict detection and resolution\n## Customization\n- Add sub-agents for logistics, maintenance, or inventory optimisation\n## Benefits\n- Automates cross-factory coordination across scheduling, procurement, and quality"
      },
      "typeVersion": 1
    },
    {
      "id": "37a57ccc-600e-4428-8331-9f0a6876542c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        -304
      ],
      "parameters": {
        "width": 400,
        "height": 272,
        "content": "## Setup Steps\n1. Set schedule trigger interval to match operational review frequency.\n2. Add OpenAI API credentials to all OpenAI Model nodes.\n3. Connect production and supply chain data sources to fetch nodes.\n4. Configure Slack credentials for high-priority and critical alert channels.\n5. Define priority routing thresholds in the Route by Priority rules node."
      },
      "typeVersion": 1
    },
    {
      "id": "c764f047-364e-4fdc-9fb9-e3dde4c82096",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        -352
      ],
      "parameters": {
        "width": 528,
        "height": 320,
        "content": "## How It Works\nThis workflow automates cross-factory operations management by deploying a multi-agent AI system that validates production data, coordinates scheduling, procurement, and quality escalation, then routes outcomes by priority. Designed for manufacturing operations managers, supply chain coordinators, and factory floor teams, it eliminates manual coordination delays and ensures critical issues trigger immediate alerts. A schedule trigger fetches production and supply chain data in parallel, merges them, then passes to an Operations Validation Agent for data integrity checks. A Cross-Factory Coordination Agent orchestrates three sub-agents\u2014Scheduling, Procurement, and Quality Escalation\u2014producing consolidated coordination outputs. Results are routed by priority: high and critical cases trigger dedicated Slack alerts, while routine operations are logged for standard review."
      },
      "typeVersion": 1
    },
    {
      "id": "39bcc175-5823-4487-ba73-a8d20523f576",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 768,
        "content": "## Route by Priority & Alert\n**What** \u2013 Separates critical, high, and routine operational outcomes.\n**Why** \u2013 Ensures urgent issues reach the right team without delay."
      },
      "typeVersion": 1
    },
    {
      "id": "923898c2-130e-4c99-8af2-db55fa36b24b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 1136,
        "height": 784,
        "content": "## Cross-Factory Coordination Agent\n**What** \u2013 Orchestrates Scheduling, Procurement, and Quality Escalation sub-agents.\n**Why** \u2013 Centralises cross-factory logic for consistent, auditable operational decisions."
      },
      "typeVersion": 1
    },
    {
      "id": "fe1cc0a0-27f4-4e2e-b35f-f72463f21e1c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 624,
        "content": "## Operations Validation Agent\n**What** \u2013 Validates merged data integrity using OpenAI before coordination.\n**Why** \u2013 Prevents faulty data from propagating incorrect scheduling or procurement decisions.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "eb220500-958a-4e3c-902c-b6fa8716ad4f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2704,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 848,
        "height": 640,
        "content": "## Merge Operations Data\n**What** \u2013 Combines production and supply chain data into unified context.\n**Why** \u2013 Gives downstream agents complete visibility across factory operations."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "f5e8e259-a973-4f66-8d5e-30f92b5e9871",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Priority": {
      "main": [
        [
          {
            "node": "Critical Alert - Slack",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "High Priority Alert - Slack",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Routine Operations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Production Data": {
      "main": [
        [
          {
            "node": "Merge Operations Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Operations Data": {
      "main": [
        [
          {
            "node": "Operations Validation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Quality Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Quality Escalation Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Scheduling Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Cross-Factory Coordination Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Procurement Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Cross-Factory Coordination Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Production Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Supply Chain Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Supply Chain Data": {
      "main": [
        [
          {
            "node": "Merge Operations Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Scheduling Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Scheduling Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Validation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Operations Validation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Procurement Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Procurement Agent Tool",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Coordination Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Cross-Factory Coordination Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Operations Validation Agent": {
      "main": [
        [
          {
            "node": "Cross-Factory Coordination Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Quality Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Quality Escalation Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Quality Escalation Agent Tool": {
      "ai_tool": [
        [
          {
            "node": "Cross-Factory Coordination Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Scheduling Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Scheduling Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Validation Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Operations Validation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Cross-Factory Coordination Agent": {
      "main": [
        [
          {
            "node": "Route by Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Procurement Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Procurement Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Coordination Agent": {
      "ai_languageModel": [
        [
          {
            "node": "Cross-Factory Coordination 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 cross-factory operations management by deploying a multi-agent AI system that validates production data, coordinates scheduling, procurement, and quality escalation, then routes outcomes by priority. Designed for manufacturing operations managers, supply…

Source: https://n8n.io/workflows/13709/ — 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

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 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 comprehensive risk signal detection and regulatory compliance management across financial and claims data sources. Designed for risk management teams, compliance officers, and

HTTP Request, Agent, OpenAI Chat +5
AI & RAG

This workflow automates energy portfolio governance for energy managers, sustainability teams, and policy compliance officers. It eliminates the manual effort of aggregating multi-source energy data,

HTTP Request, Agent, OpenAI Chat +9
AI & RAG

This workflow automates insurance claims processing by deploying specialized AI agents to analyze actuarial data, draft claim memos, and perform risk assessments. Designed for insurance adjusters, und

HTTP Request, Agent, OpenAI Chat +5