AutomationFlowsAI & RAG › Route Erp Tasks Across Departments with Gpt-4, Slack, Gmail and Human Approval

Route Erp Tasks Across Departments with Gpt-4, Slack, Gmail and Human Approval

ByCheng Siong Chin @cschin on n8n.io

This workflow automates enterprise resource planning (ERP) operations across Engineering, Finance, HR, and Admin departments for operations managers, ERP administrators, and business process owners who need intelligent task routing with human oversight. It solves the problem of…

Webhook trigger★★★★★ complexityAI-powered52 nodesAgentGmailSlackData TableOpenAI ChatMemory Buffer WindowHTTP Request ToolTool Calculator
AI & RAG Trigger: Webhook Nodes: 52 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #15573 — we link there as the canonical source.

This workflow follows the Agent → Datatable 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": "2LfOynVhCfy1jukx",
  "name": "Multi-department ERP AI agent with human approval and daily reporting",
  "tags": [],
  "nodes": [
    {
      "id": "01bcce6a-77a2-4f44-b79b-f7ab0556c488",
      "name": "Webhook - External Systems",
      "type": "n8n-nodes-base.webhook",
      "position": [
        144,
        896
      ],
      "parameters": {
        "path": "engineering-automation",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "52b51ed5-57d0-4c26-a3f0-e23a60e9a0e1",
      "name": "Orchestrator Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        560,
        896
      ],
      "parameters": {
        "text": "={{ $json.body?.requestType ? \"Process this request: \" + JSON.stringify($json.body) : \"Analyze current operations and identify tasks requiring attention\" }}",
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are the Orchestrator Agent for an engineering company automation system. Your role is to:\n\n1. Analyze incoming requests (quotations, projects, procurement, HR, finance)\n2. Determine priority and urgency\n3. Route to appropriate department: engineering, admin, finance, or HR\n4. Use the ERP System API tool to query existing data\n5. Use the Project Database tool to store decisions\n6. Use the Cost Calculator tool for financial estimates\n7. Return structured output with: action, priority, assignedDepartment, estimatedCost, timeline, requiresApproval, nextSteps\n\nAlways ensure compliance, auditability, and flag items requiring human approval."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "032c6866-cdf2-435f-98b6-5874d303ff03",
      "name": "Route by Department",
      "type": "n8n-nodes-base.switch",
      "position": [
        1200,
        880
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Engineering",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.assignedDepartment }}",
                    "rightValue": "engineering"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Finance",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.assignedDepartment }}",
                    "rightValue": "finance"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "HR",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.assignedDepartment }}",
                    "rightValue": "hr"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Admin"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "55e1bff2-783c-43b5-a393-27659c12f1bb",
      "name": "Engineering Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        208
      ],
      "parameters": {
        "text": "={{ \"Engineering task: \" + JSON.stringify($json.output) }}",
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are the Engineering Agent. Handle:\n- Technical quotations and feasibility analysis\n- Project scheduling and resource allocation\n- CAD integration and engineering calculations\n- Quality control and compliance checks\n- Use ERP System API for project data\n- Use Cost Calculator for material estimates\n- Store results in Project Database\n\nReturn structured output with technical specifications, timeline, resources needed, and risk assessment."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "c8d6dc73-034b-4596-8cdf-2b3abff28775",
      "name": "Combine Agent Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        2480,
        512
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "8aba5a3e-0e75-40cb-a224-2ae8ec2e8e19",
      "name": "Finance Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        608
      ],
      "parameters": {
        "text": "={{ \"Finance task: \" + JSON.stringify($json.output) }}",
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are the Finance Agent. Handle:\n- Invoice processing and payment tracking\n- Budget analysis and cost optimization\n- Payroll calculations and expense management\n- Financial KPI reporting and forecasting\n- Use ERP System API for financial data\n- Use Cost Calculator for budget analysis\n- Store transactions in Project Database\n\nReturn structured output with cost breakdown, payment terms, budget impact, and approval requirements."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "777e12a1-91da-409a-b3ae-16506ed17508",
      "name": "HR Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        1008
      ],
      "parameters": {
        "text": "={{ \"HR task: \" + JSON.stringify($json.output) }}",
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are the HR Agent. Handle:\n- Recruitment and candidate screening\n- Leave management and attendance tracking\n- Compliance monitoring and policy enforcement\n- Employee onboarding and training coordination\n- Use ERP System API for employee data\n- Store HR records in Project Database\n\nReturn structured output with personnel requirements, compliance status, and action items."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "489ce111-8f95-4296-b8e6-6897feaa4f80",
      "name": "Admin Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1600,
        1424
      ],
      "parameters": {
        "text": "={{ \"Admin task: \" + JSON.stringify($json.output) }}",
        "options": {
          "maxIterations": 15,
          "systemMessage": "You are the Admin Agent. Handle:\n- Customer communication and CRM updates\n- Document management and filing\n- Procurement tracking and vendor coordination\n- General administrative tasks\n- Use ERP System API for customer data\n- Store records in Project Database\n\nReturn structured output with communication plan, document status, and follow-up actions."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "665b8bab-ab3b-4a61-8e5d-d9e3feb61c96",
      "name": "Requires Human Approval?",
      "type": "n8n-nodes-base.if",
      "position": [
        2704,
        512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.output?.requiresApproval }}",
              "rightValue": true
            },
            {
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.output?.totalCost }}",
              "rightValue": 10000
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "1f9a11f4-4e88-4f96-aeea-c2da209d7602",
      "name": "Send Approval Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2928,
        416
      ],
      "parameters": {
        "sendTo": "<__PLACEHOLDER_VALUE__manager@company.com__>",
        "message": "={{ \"<h2>Approval Request</h2><p><strong>Action:</strong> \" + $json.output.action + \"</p><p><strong>Department:</strong> \" + $json.output.assignedDepartment + \"</p><p><strong>Estimated Cost:</strong> $\" + $json.output.estimatedCost + \"</p><p><strong>Timeline:</strong> \" + $json.output.timeline + \"</p><p><strong>Next Steps:</strong> \" + $json.output.nextSteps.join(\", \") + \"</p>\" }}",
        "options": {},
        "subject": "={{ \"Approval Required: \" + $json.output.action }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a7bbd5da-0d5d-46a1-a8e1-73b2e59c6dc6",
      "name": "Notify Team on Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2928,
        608
      ],
      "parameters": {
        "text": "={{ \"Task completed: \" + $json.output.action }}",
        "select": "channel",
        "blocksUi": "={{ [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"*Task Completed*\\n*Action:* \" + $json.output.action + \"\\n*Department:* \" + $json.output.assignedDepartment + \"\\n*Status:* \" + ($json.output.requiresApproval ? \"Pending Approval\" : \"Auto-Approved\")}}] }}",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "messageType": "block",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "8471bb14-178b-439f-bd8c-911e45573461",
      "name": "Schedule - Daily Operations",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2368,
        1056
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "f7300e52-b5f7-48fb-9eee-2f16f7a825b3",
      "name": "Fetch Pending Tasks",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2592,
        1056
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "status",
              "keyValue": "pending"
            }
          ]
        },
        "orderBy": true,
        "operation": "get",
        "returnAll": true,
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "orderByColumn": "priority"
      },
      "typeVersion": 1.1
    },
    {
      "id": "b2ebc0fe-df2f-43d3-b9db-71f0ebaa359b",
      "name": "Aggregate Tasks",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2816,
        1056
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "tasks"
      },
      "typeVersion": 1
    },
    {
      "id": "9ac8b5fc-2c9d-4d3c-bfe9-911d5f8b23d8",
      "name": "Generate Daily Report",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3152,
        1056
      ],
      "parameters": {
        "text": "={{ \"Generate a daily operations report for these pending tasks: \" + JSON.stringify($json.tasks) }}",
        "options": {
          "maxIterations": 10,
          "systemMessage": "You are the Reporting Agent. Generate comprehensive daily reports including:\n- Summary of pending tasks by department\n- Priority items requiring immediate attention\n- Resource utilization and bottlenecks\n- KPI metrics and trends\n- Recommendations for optimization\n\nReturn structured output with executive summary, department breakdowns, and action items."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "6c7210c9-d585-4082-b975-cbee5b12f16b",
      "name": "Email Daily Report",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3632,
        1056
      ],
      "parameters": {
        "sendTo": "<__PLACEHOLDER_VALUE__executives@company.com__>",
        "message": "={{ \"<h1>Daily Operations Report</h1><h2>Executive Summary</h2><p>\" + $json.output.executiveSummary + \"</p><h2>Department Breakdown</h2><p>\" + JSON.stringify($json.output.departmentBreakdown) + \"</p><h2>Critical Items</h2><ul><li>\" + $json.output.criticalItems.join(\"</li><li>\") + \"</li></ul><h2>Recommendations</h2><ul><li>\" + $json.output.recommendations.join(\"</li><li>\") + \"</li></ul>\" }}",
        "options": {},
        "subject": "={{ \"Daily Operations Report - \" + $now.toFormat(\"MMMM d, yyyy\") }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bacd9c09-d23e-4591-ba05-032eaa6f76a3",
      "name": "Orchestrator Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        304,
        1120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b0c23022-24c8-4a57-875c-83dfd79185ef",
      "name": "Orchestrator Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        480,
        1120
      ],
      "parameters": {
        "sessionKey": "orchestrator_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "460775b1-3dc5-493e-b695-233027fddcca",
      "name": "Orchestrator ERP Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        624,
        1120
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your ERP API endpoint (e.g., https://erp.company.com/api/v1)__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"action\": \"query\", \"module\": $json.module, \"data\": $json.data } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "d1ba9573-f599-44c6-90bd-d4c1ed1ae065",
      "name": "Orchestrator Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        816,
        1120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "38296a14-69fe-4ba7-b49e-45330067d007",
      "name": "Orchestrator Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        976,
        1136
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b49299f5-fcdc-4b65-970b-a0bfd6d1b8a9",
      "name": "Engineering Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1152,
        432
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "81e14fa3-3302-4e88-a491-e95164090bb6",
      "name": "Engineering Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1328,
        432
      ],
      "parameters": {
        "sessionKey": "engineering_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "15d3485a-6102-451e-87d7-e3601b355206",
      "name": "Engineering ERP Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1552,
        432
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your ERP API endpoint (e.g., https://erp.company.com/api/v1)__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"action\": \"query\", \"module\": $json.module, \"data\": $json.data } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "48fac52d-7305-4989-a277-395db5cca5ee",
      "name": "Engineering Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1728,
        432
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "86a54a02-bcb7-4aaa-8045-550794ccbe92",
      "name": "Engineering Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1920,
        432
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7344765e-2dd4-4415-8777-618dcc3ea4fe",
      "name": "Finance Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1408,
        832
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0a404d2e-2797-4fff-990c-b35fc6a2077a",
      "name": "Finance Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1584,
        832
      ],
      "parameters": {
        "sessionKey": "finance_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "4e1a8e48-6ba6-4ccc-8121-a3db2c2a21a0",
      "name": "Finance ERP Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1744,
        832
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your ERP API endpoint (e.g., https://erp.company.com/api/v1)__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"action\": \"query\", \"module\": $json.module, \"data\": $json.data } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "97717332-36fb-49f7-84ec-4fef333dd5b7",
      "name": "Finance Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1920,
        832
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "17da55a8-39c8-43b6-adee-e07bc46b793a",
      "name": "Finance Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2112,
        832
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "09693a64-255b-45c0-a460-f6bda5b27687",
      "name": "HR Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1472,
        1232
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "ffa05cd5-bb89-45a4-ba4b-d476cf8993b7",
      "name": "HR Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1600,
        1232
      ],
      "parameters": {
        "sessionKey": "hr_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "3edcb376-8ee9-4c0f-aeae-f9ad25b4d08d",
      "name": "HR ERP Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1760,
        1232
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your ERP API endpoint (e.g., https://erp.company.com/api/v1)__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"action\": \"query\", \"module\": $json.module, \"data\": $json.data } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "7bd4f18d-fc26-4611-bce9-d2361b75911c",
      "name": "HR Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1936,
        1248
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "ccbf140e-f87f-450d-bc40-a9e7d9fde2c1",
      "name": "Admin Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1392,
        1648
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "8e589d50-baab-40b3-8ab9-977851105929",
      "name": "Admin Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1584,
        1648
      ],
      "parameters": {
        "sessionKey": "admin_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "aad0fa21-d9cd-436a-b638-15a9843a8b60",
      "name": "Admin ERP Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1744,
        1648
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Your ERP API endpoint (e.g., https://erp.company.com/api/v1)__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"action\": \"query\", \"module\": $json.module, \"data\": $json.data } }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.4
    },
    {
      "id": "8d5e7647-7d4b-4281-a074-b0f211a27815",
      "name": "Admin Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1936,
        1632
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "ac625ab0-7a94-47f3-81a9-7d73e7684fec",
      "name": "Reporting Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2928,
        1280
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "0744b041-65a4-4ba2-b346-0733b208635d",
      "name": "Reporting Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        3104,
        1280
      ],
      "parameters": {
        "sessionKey": "reporting_session",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "388ff091-9626-4d25-b184-86bb178b9dd2",
      "name": "Reporting Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        3296,
        1280
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7f52db53-ec36-4c35-9af9-65b490df4800",
      "name": "Reporting Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3504,
        1280
      ],
      "parameters": {
        "jsonSchemaExample": "{\"action\":\"quotation\",\"priority\":\"high\",\"assignedDepartment\":\"engineering\",\"estimatedCost\":50000,\"timeline\":\"4 weeks\",\"requiresApproval\":true,\"nextSteps\":[\"technical_review\",\"cost_analysis\",\"client_approval\"]}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b846eb40-6a41-4f68-b0bd-9499499ab4a7",
      "name": "Store Task Result",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3152,
        512
      ],
      "parameters": {
        "columns": "{{ { \"action\": $(\"Combine Agent Results\").item.json.output.action, \"department\": $(\"Combine Agent Results\").item.json.output.assignedDepartment, \"status\": $(\"Combine Agent Results\").item.json.output.requiresApproval ? \"pending_approval\" : \"completed\", \"cost\": $(\"Combine Agent Results\").item.json.output.estimatedCost, \"timeline\": $(\"Combine Agent Results\").item.json.output.timeline, \"timestamp\": $now.toISO() } }}",
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ed3a207e-057c-4165-b70d-7fd454741f14",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -208
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 80,
        "content": "# NO MORE HUMAN WORKERS!"
      },
      "typeVersion": 1
    },
    {
      "id": "fecf3a1e-9341-4069-ac95-607581eb8953",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -352
      ],
      "parameters": {
        "width": 560,
        "height": 336,
        "content": "## How It Works\nThis workflow automates enterprise resource planning (ERP) operations across Engineering, Finance, HR, and Admin departments for operations managers, ERP administrators, and business process owners who need intelligent task routing with human oversight. It solves the problem of siloed departmental workflows by centralising all inbound requests through a single Orchestrator Agent that routes tasks to the correct specialist AI agent. Each department agent, namely: Engineering, Finance, HR, and Admin operates with its own LLM model, memory, ERP tool, calculator, and output parser. The Orchestrator routes by department, agents process and return results, which are then combined and evaluated for human approval. Tasks requiring sign-off trigger an approval email; others post directly to Slack. A separate scheduled pipeline runs daily, fetching pending tasks, aggregating them, generating a Daily Report via a Reporting Agent, and emailing it via Gmail."
      },
      "typeVersion": 1
    },
    {
      "id": "36233c74-cdf6-44d9-a417-d505adb07167",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1808,
        -352
      ],
      "parameters": {
        "width": 544,
        "height": 304,
        "content": "## Setup Steps\n1. Add OpenAI credentials to all agent model nodes (Orchestrator, Engineering, Finance, HR).\n2. Configure ERP tool credentials for each department's ERP node.\n3. Set Slack credentials and target channel in the Notify Team on Slack node.\n4. Add Gmail credentials to Send Approval Email and Email Daily Report nodes.\n5. Connect memory backends (e.g., Redis or n8n memory) to all agent memory nodes.\n6. Set the Schedule trigger interval for daily operations (e.g., 08:00 daily).\n7. Configure the webhook URL for Webhook \u2013 External Systems trigger.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b2dc084c-0e8d-4c4f-a1b4-5591404bc08f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        -368
      ],
      "parameters": {
        "color": 3,
        "width": 688,
        "height": 560,
        "content": "## Prerequisites\n- OpenAI API key (GPT-4 or GPT-4o)\n- ERP system with API access (per department)\n- Slack workspace with bot token\n- Gmail account with OAuth2 credentials\n- Memory backend (Redis or n8n built-in)\n## Use Cases\n- Automated engineering change request routing and approval\n- Finance budget approval with human sign-off gate\n- HR onboarding task orchestration across systems\n- Daily ERP operations summary for management review\n## Customization\n- Add more department agents (e.g., Legal, Procurement) by extending the router\n- Replace Gmail with Outlook or SendGrid for email delivery\n- Swap Slack for Teams or Discord notifications\n- Adjust approval conditions to match your governance thresholds\n## Benefits\n- Single orchestrator eliminates cross-department routing delays\n- Human approval gate ensures compliance for sensitive ERP actions\n- Daily automated reporting reduces manual ops overhead\n- Modular agent design allows per-department tool customisation"
      },
      "typeVersion": 1
    },
    {
      "id": "f615e4fe-7245-4b4c-9f58-7a5dab6c231f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 1072,
        "height": 1824,
        "content": "## Department Agent Processing\n**What** \u2014 Engineering, Finance, HR, and Admin agents each apply domain-specific tools, ERP access, memory, and parsers.\n**Why** \u2014 Specialised agents yield higher accuracy than a single general-purpose model."
      },
      "typeVersion": 1
    },
    {
      "id": "26d877e1-3c69-48f1-a305-7f1cbdeecb81",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2320,
        256
      ],
      "parameters": {
        "color": 7,
        "width": 1088,
        "height": 608,
        "content": "## Combine & Human Approval Gate\n**What** \u2014 Outputs are combined; a condition node checks if human approval is required before routing to email or Slack.\n**Why** \u2014 Maintains compliance and oversight for high-stakes ERP actions."
      },
      "typeVersion": 1
    },
    {
      "id": "4ee71e13-f041-44e1-b84c-075572ee9927",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        736
      ],
      "parameters": {
        "color": 7,
        "width": 1040,
        "height": 592,
        "content": "## Ingest & Orchestrate\n**What** \u2014 Webhook receives requests from external systems; Orchestrator Agent with memory routes by department.\n**Why** \u2014 Single entry point eliminates manual triage across departments."
      },
      "typeVersion": 1
    },
    {
      "id": "b434bc60-c350-4bce-9985-f63661438088",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2304,
        912
      ],
      "parameters": {
        "color": 7,
        "width": 1536,
        "height": 544,
        "content": "## Daily Scheduled Reporting\n**What** \u2014 Scheduler fetches pending tasks, aggregates them, and passes to a Reporting Agent that emails a daily summary via Gmail.\n**Why** \u2014 Keeps stakeholders informed without manual report compilation."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "2dc12275-709d-4b58-91d5-10c8625d1f47",
  "connections": {
    "HR Model": {
      "ai_languageModel": [
        [
          {
            "node": "HR Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HR Memory": {
      "ai_memory": [
        [
          {
            "node": "HR Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "HR Parser": {
      "ai_outputParser": [
        [
          {
            "node": "HR Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Admin Model": {
      "ai_languageModel": [
        [
          {
            "node": "Admin Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HR ERP Tool": {
      "ai_tool": [
        [
          {
            "node": "HR Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Admin Memory": {
      "ai_memory": [
        [
          {
            "node": "Admin Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Admin Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Admin Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Finance Agent": {
      "main": [
        [
          {
            "node": "Combine Agent Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Finance Model": {
      "ai_languageModel": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Admin ERP Tool": {
      "ai_tool": [
        [
          {
            "node": "Admin Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Finance Memory": {
      "ai_memory": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Finance Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Tasks": {
      "main": [
        [
          {
            "node": "Generate Daily Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reporting Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Daily Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Finance ERP Tool": {
      "ai_tool": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Reporting Memory": {
      "ai_memory": [
        [
          {
            "node": "Generate Daily Report",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Reporting Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Daily Report",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Engineering Agent": {
      "main": [
        [
          {
            "node": "Combine Agent Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Engineering Model": {
      "ai_languageModel": [
        [
          {
            "node": "Engineering Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Engineering Memory": {
      "ai_memory": [
        [
          {
            "node": "Engineering Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Engineering Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Engineering Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Finance Calculator": {
      "ai_tool": [
        [
          {
            "node": "Finance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Agent": {
      "main": [
        [
          {
            "node": "Route by Department",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Model": {
      "ai_languageModel": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Pending Tasks": {
      "main": [
        [
          {
            "node": "Aggregate Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Memory": {
      "ai_memory": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Route by Department": {
      "main": [
        [
          {
            "node": "Engineering Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Finance Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HR Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Admin Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Approval Email": {
      "main": [
        [
          {
            "node": "Store Task Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Engineering ERP Tool": {
      "ai_tool": [
        [
          {
            "node": "Engineering Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Notify Team on Slack": {
      "main": [
        [
          {
            "node": "Store Task Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reporting Calculator": {
      "ai_tool": [
        [
          {
            "node": "Generate Daily Report",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Combine Agent Results": {
      "main": [
        [
          {
            "node": "Requires Human Approval?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Daily Report": {
      "main": [
        [
          {
            "node": "Email Daily Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator ERP Tool": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Engineering Calculator": {
      "ai_tool": [
        [
          {
            "node": "Engineering Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator Calculator": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Requires Human Approval?": {
      "main": [
        [
          {
            "node": "Send Approval Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Team on Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - External Systems": {
      "main": [
        [
          {
            "node": "Orchestrator Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule - Daily Operations": {
      "main": [
        [
          {
            "node": "Fetch Pending Tasks",
            "type": "main",
            "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 enterprise resource planning (ERP) operations across Engineering, Finance, HR, and Admin departments for operations managers, ERP administrators, and business process owners who need intelligent task routing with human oversight. It solves the problem of…

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

Enhance your support, onboarding, and internal knowledge workflows with an intelligent RAG-powered chatbot that responds using live data stored in Google Sheets. 🤖📚 Built for teams that rely on struct

Chat Trigger, Output Parser Structured, Memory Buffer Window +6
AI & RAG

This workflow automates enterprise compliance governance using a multi-agent AI architecture. It targets compliance officers, legal teams, and risk managers who need continuous, jurisdiction-aware mon

Agent, OpenAI Chat, Memory Buffer Window +8
AI & RAG

This workflow automates credit operations onboarding by running KYC verification, credit bureau checks, identity validation, and sanctions screening through a single AI-powered agent. Built for credit

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

This workflow automates credit operations onboarding by running KYC verification, credit bureau checks, identity validation, and sanctions screening through a single AI-powered agent. Built for credit

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

This workflow automates end-to-end legal contract review and compliance governance for legal teams, contract managers, and risk officers. It solves the problem of manually reviewing uploaded contracts

Agent, OpenAI Chat, Memory Buffer Window +5