{
 "id": "supportticketrou",
 "name": "AutomateRecipes \u2013 support-ticket-routing",
 "nodes": [
  {
   "parameters": {},
   "name": "Manual Trigger",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "id": "a904d05e-5600-4743-bf3b-25629773580b"
  },
  {
   "parameters": {
    "jsCode": "return [{json:{subject:'Refund please',from:'x@t.test'}},{json:{subject:'Where is my shipping?',from:'y@t.test'}},{json:{subject:'Hello',from:'z@t.test'}}];"
   },
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "name": "S1",
   "position": [
    220,
    0
   ],
   "id": "db5dabf8-d0a5-4148-9237-b2af4dca099b"
  },
  {
   "parameters": {
    "jsCode": "const route=s=>/refund/i.test(s)?'@finance':/ship/i.test(s)?'@warehouse':'@support';return $input.all().map(i=>({json:{service:'slack/chat.postMessage',payload:{channel:route(i.json.subject),text:'New email: '+i.json.subject}}}));"
   },
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "name": "S2",
   "position": [
    440,
    0
   ],
   "id": "6ef1cf63-cdc9-4028-b86e-edc23cf8e40c"
  },
  {
   "parameters": {
    "method": "POST",
    "url": "=http://127.0.0.1:9000/{{ $json.service }}",
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "={{ JSON.stringify($json.payload) }}",
    "options": {}
   },
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "name": "S3 POST mock (send)",
   "position": [
    660,
    0
   ],
   "id": "9ceef207-8b0e-4e5c-ac7f-40cd774d6a4c"
  }
 ],
 "connections": {
  "Manual Trigger": {
   "main": [
    [
     {
      "node": "S1",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "S1": {
   "main": [
    [
     {
      "node": "S2",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "S2": {
   "main": [
    [
     {
      "node": "S3 POST mock (send)",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {},
 "active": false,
 "pinData": {},
 "meta": {
  "note": "Tested on n8n 1.70.3 with local mocks for: Gmail trigger, Slack DMs. Replace 'POST mock'/'GET mock' HTTP nodes with the real app nodes + credentials before production."
 }
}