{
  "name": "AI Support Ticket Classifier with ChatGPT",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.intercomTrigger",
      "typeVersion": 1,
      "position": [100, 300],
      "id": "intercom-trigger-node",
      "name": "New Ticket Trigger"
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "prompt": "Classify urgency, category, and draft a response for: {{ $json.body }}"
      },
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [300, 300],
      "id": "openai-classifier-node",
      "name": "Classify & Draft via AI"
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.urgency }}",
              "value2": "high"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [500, 300],
      "id": "urgency-router-node",
      "name": "Check Urgency"
    },
    {
      "parameters": {
        "channel": "dev-alerts",
        "text": "HIGH URGENCY TICKET: {{ $json.subject }}"
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [700, 200],
      "id": "slack-alert-node",
      "name": "Slack Warning for Outages"
    },
    {
      "parameters": {
        "ticketId": "={{ $json.ticketId }}",
        "note": "={{ $json.draftResponse }}",
        "tags": ["AI-Qualified", "={{ $json.category }}"]
      },
      "type": "n8n-nodes-base.intercom",
      "typeVersion": 1,
      "position": [700, 400],
      "id": "intercom-note-node",
      "name": "Save Draft in Intercom"
    }
  ],
  "connections": {
    "New Ticket Trigger": {
      "main": [
        [
          {
            "node": "Classify & Draft via AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify & Draft via AI": {
      "main": [
        [
          {
            "node": "Check Urgency",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Urgency": {
      "main": [
        [
          {
            "node": "Slack Warning for Outages",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Save Draft in Intercom",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
