{
  "name": "Inbound message triage (Claude via port.staccc.app)",
  "nodes": [
    {
      "parameters": { "httpMethod": "POST", "path": "inbound-message", "responseMode": "lastNode", "options": {} },
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Inbound message (webhook)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 300],
      "webhookId": "inbound-message"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://port.staccc.app/api/triage",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ message: $json.body.message, channel: $json.body.channel || 'email' }) }}",
        "options": { "timeout": 60000, "retry": { "maxTries": 2 } }
      },
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "Triage with Claude",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [240, 300]
    },
    {
      "parameters": {
        "rules": {
          "values": [
            { "conditions": { "options": { "caseSensitive": true, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "leftValue": "={{ $json.result.needs_human }}", "rightValue": true, "operator": { "type": "boolean", "operation": "true", "singleValue": true } } ] }, "renameOutput": true, "outputKey": "Human review" },
            { "conditions": { "options": { "caseSensitive": true, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "leftValue": "={{ $json.result.route_to }}", "rightValue": "sales", "operator": { "type": "string", "operation": "equals" } } ] }, "renameOutput": true, "outputKey": "Sales" },
            { "conditions": { "options": { "caseSensitive": true, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "leftValue": "={{ $json.result.route_to }}", "rightValue": "ignore", "operator": { "type": "string", "operation": "equals" } } ] }, "renameOutput": true, "outputKey": "Ignore" }
          ]
        },
        "options": { "fallbackOutput": "extra", "renameFallbackOutput": "Support / other" }
      },
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "Route",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3,
      "position": [480, 300]
    },
    { "parameters": {}, "id": "a1b2c3d4-0004-4000-8000-000000000004", "name": "Notify manager (Slack/Telegram)", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [740, 100] },
    { "parameters": {}, "id": "a1b2c3d4-0005-4000-8000-000000000005", "name": "Create CRM lead", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [740, 240] },
    { "parameters": {}, "id": "a1b2c3d4-0006-4000-8000-000000000006", "name": "Drop spam", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [740, 380] },
    { "parameters": {}, "id": "a1b2c3d4-0007-4000-8000-000000000007", "name": "Open help-desk ticket + send reply", "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [740, 520] }
  ],
  "connections": {
    "Inbound message (webhook)": { "main": [[{ "node": "Triage with Claude", "type": "main", "index": 0 }]] },
    "Triage with Claude": { "main": [[{ "node": "Route", "type": "main", "index": 0 }]] },
    "Route": { "main": [
      [{ "node": "Notify manager (Slack/Telegram)", "type": "main", "index": 0 }],
      [{ "node": "Create CRM lead", "type": "main", "index": 0 }],
      [{ "node": "Drop spam", "type": "main", "index": 0 }],
      [{ "node": "Open help-desk ticket + send reply", "type": "main", "index": 0 }]
    ] }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {}
}
