{
  "name": "Triage and escalate tenant complaints from Gmail or forms to Slack with Claude AI",
  "nodes": [
    {
      "id": "c7c2c558-de10-4644-8bb2-89573e22c3f6",
      "name": "Normalise email inputs",
      "type": "n8n-nodes-base.set",
      "position": [
        1456,
        496
      ]
    },
    {
      "id": "52e4c530-55fe-4648-bf6f-c65f842d530b",
      "name": "Normalise form inputs",
      "type": "n8n-nodes-base.set",
      "position": [
        1456,
        688
      ]
    },
    {
      "id": "0b0fe996-34e3-4f79-80f1-532e516753c7",
      "name": "Merge inputs",
      "type": "n8n-nodes-base.merge",
      "position": [
        1680,
        592
      ]
    },
    {
      "id": "2c69b3f7-731e-4f9d-8a78-d6a9e149baf2",
      "name": "LLM extract & classify",
      "type": "@n8n/n8n-nodes-langchain.anthropic",
      "position": [
        1904,
        592
      ]
    },
    {
      "id": "3e84cdbc-5701-4ee9-a1b3-a20ac30501d1",
      "name": "Parse LLM output",
      "type": "n8n-nodes-base.code",
      "position": [
        2256,
        592
      ]
    },
    {
      "id": "fa06f5b6-22f3-41a3-8857-9b6fb97cd2b8",
      "name": "SLA breached?",
      "type": "n8n-nodes-base.if",
      "position": [
        1904,
        1136
      ]
    },
    {
      "id": "ac4ef243-53fc-4d24-9f71-c757de462ed2",
      "name": "Loop over tickets",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1680,
        1136
      ]
    },
    {
      "id": "25b76e0c-502f-4661-b0f0-ccab3fd8b840",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1232,
        1136
      ]
    },
    {
      "id": "501e8b4b-4240-48b7-8123-d6560f9443a2",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1232,
        688
      ]
    },
    {
      "id": "5ee20e19-0fe9-4fff-b794-4b99511f35ac",
      "name": "Search technician",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2480,
        592
      ]
    },
    {
      "id": "25e1c3bd-8608-44ec-9013-48354fd0728d",
      "name": "Create work order",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2704,
        592
      ]
    },
    {
      "id": "14b352b8-34ed-4487-9992-4d86fe29bd24",
      "name": "Send ACK email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2928,
        592
      ]
    },
    {
      "id": "3498e956-210a-481d-b248-88f91cff55f3",
      "name": "Update ACK status",
      "type": "n8n-nodes-base.airtable",
      "position": [
        3152,
        592
      ]
    },
    {
      "id": "5b5fe4e9-7df8-4f86-b3e7-13133e782ab7",
      "name": "Gmail trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        1232,
        496
      ]
    },
    {
      "id": "e56b4307-8dba-4ba2-86f1-697cecb9b95b",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        3376,
        592
      ]
    },
    {
      "id": "775997fe-0156-4fa0-9a92-4d0b9b3bb37b",
      "name": "Search records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1456,
        1136
      ]
    },
    {
      "id": "134fc5e1-a484-4e1e-99f0-920a451ed841",
      "name": "Escalate to FM Management",
      "type": "n8n-nodes-base.slack",
      "position": [
        2128,
        1136
      ]
    },
    {
      "id": "2952f473-8193-461b-9295-dd733465246b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        224
      ],
      "parameters": {
        "width": 576,
        "height": 1136,
        "content": "## FM Complaint Triage & SLA Escalation                                                                                                                                                                 "
      }
    },
    {
      "id": "92cd41f1-a1a5-42f2-bd50-9cceab22455f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        224
      ],
      "parameters": {
        "width": 672,
        "height": 672,
        "content": "**1. Complaint ingestion**\n\nAccepts complaints from two sources:\n- **Gmail Trigger** polls your shared FM inbox every minute for new INBOX messages\n- **Webhook** receives POST requests from a web form"
      }
    },
    {
      "id": "7072c2ea-62db-4c4b-9a03-a0d3e59f04f6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        224
      ],
      "parameters": {
        "width": 528,
        "height": 672,
        "content": "**2. AI triage (Claude Sonnet)**\n\nClaude classifies the complaint and returns structured JSON:\n- Fault category: ACMV | Plumbing | Electrical | Cleanliness | Access | Noise\n- Priority: P1 (2hr SLA) | "
      }
    },
    {
      "id": "29a0f377-d27b-4f68-bbeb-ed6216b219a1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2416,
        224
      ],
      "parameters": {
        "width": 416,
        "height": 672,
        "content": "**3. Technician assignment & work order**\n\nLooks up the on-call technician for the fault category from your Airtable Technician table, then creates a full work order in the Complaints table.\n\nThe Tech"
      }
    },
    {
      "id": "5e21da6b-77e3-41e9-938b-7fb2aeb4991f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        224
      ],
      "parameters": {
        "width": 720,
        "height": 672,
        "content": "**4. Tenant acknowledgement and dispatch**\n\nSends the AI-drafted acknowledgement email to the tenant with:\n- Ticket reference (FM-XXXXXX)\n- SLA commitment (e.g. \"within 4 hours — by 3:45 PM SGT\")\n\nAck"
      }
    },
    {
      "id": "24c5cbb6-03d2-4053-94c8-1f84aa27c3f4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        928
      ],
      "parameters": {
        "width": 1232,
        "height": 432,
        "content": "**5. Hourly SLA monitoring**\n\nRuns independently on a 1-hour schedule. Fetches all open tickets from Airtable, loops through each one, and checks whether the SLA Deadline has passed.\n\nAny breached tic"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Normalise form inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge inputs": {
      "main": [
        [
          {
            "node": "LLM extract & classify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail trigger": {
      "main": [
        [
          {
            "node": "Normalise email inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SLA breached?": {
      "main": [
        [
          {
            "node": "Escalate to FM Management",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records": {
      "main": [
        [
          {
            "node": "Loop over tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send ACK email": {
      "main": [
        [
          {
            "node": "Update ACK status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse LLM output": {
      "main": [
        [
          {
            "node": "Search technician",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create work order": {
      "main": [
        [
          {
            "node": "Send ACK email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over tickets": {
      "main": [
        [],
        [
          {
            "node": "SLA breached?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search technician": {
      "main": [
        [
          {
            "node": "Create work order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update ACK status": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalise form inputs": {
      "main": [
        [
          {
            "node": "Merge inputs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "LLM extract & classify": {
      "main": [
        [
          {
            "node": "Parse LLM output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalise email inputs": {
      "main": [
        [
          {
            "node": "Merge inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalate to FM Management": {
      "main": [
        [
          {
            "node": "Loop over tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}