{
  "name": "Curva ticket triage",
  "nodes": [
    {
      "parameters": {},
      "id": "a1f0c6de-0001-4c1e-9d11-000000000001",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 300]
    },
    {
      "parameters": {
        "jsCode": "return [\n  { json: { id: 101, subject: 'Charged twice', body: 'I was charged twice for order A-104, please refund one.' } },\n  { json: { id: 102, subject: 'Crash on login', body: 'The app crashes every time I press Sign in on Android.' } },\n  { json: { id: 103, subject: 'Enterprise plan', body: 'What does the enterprise plan cost for 200 seats?' } },\n  { json: { id: 104, subject: 'hmm', body: 'Is this the right place?' } }\n];"
      },
      "id": "a1f0c6de-0002-4c1e-9d11-000000000002",
      "name": "Sample tickets",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [220, 300]
    },
    {
      "parameters": {
        "operation": "route",
        "questionType": "choice",
        "questionKey": "department",
        "instructions": "Which team should handle this ticket?",
        "choices": {
          "values": [
            { "key": "billing", "description": "Payments, refunds, invoices" },
            { "key": "technical", "description": "Bugs, crashes, errors" },
            { "key": "sales", "description": "Pricing, plans, quotes" }
          ]
        },
        "escape": true,
        "minConfidence": 0.8,
        "stateSource": "fields",
        "stateFields": "subject, body",
        "project": "support"
      },
      "id": "a1f0c6de-0003-4c1e-9d11-000000000003",
      "name": "Route ticket",
      "type": "n8n-nodes-curva.curva",
      "typeVersion": 1,
      "position": [440, 300]
    },
    {
      "parameters": {},
      "id": "a1f0c6de-0004-4c1e-9d11-000000000004",
      "name": "Billing queue",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [720, 60]
    },
    {
      "parameters": {},
      "id": "a1f0c6de-0005-4c1e-9d11-000000000005",
      "name": "Technical queue",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [720, 200]
    },
    {
      "parameters": {},
      "id": "a1f0c6de-0006-4c1e-9d11-000000000006",
      "name": "Sales queue",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [720, 340]
    },
    {
      "parameters": {},
      "id": "a1f0c6de-0007-4c1e-9d11-000000000007",
      "name": "General inbox",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [720, 480]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "b1", "name": "label", "value": "billing", "type": "string" }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "id": "a1f0c6de-0008-4c1e-9d11-000000000008",
      "name": "Human review (replace with Slack / form)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [720, 620]
    },
    {
      "parameters": {
        "operation": "feedback",
        "decisionId": "={{ $json.curva.id }}",
        "feedbackQuestion": "={{ $json.curva.question }}",
        "label": "={{ $json.label }}"
      },
      "id": "a1f0c6de-0009-4c1e-9d11-000000000009",
      "name": "Teach Curva",
      "type": "n8n-nodes-curva.curva",
      "typeVersion": 1,
      "position": [960, 620]
    }
  ],
  "connections": {
    "Start": { "main": [[{ "node": "Sample tickets", "type": "main", "index": 0 }]] },
    "Sample tickets": { "main": [[{ "node": "Route ticket", "type": "main", "index": 0 }]] },
    "Route ticket": {
      "main": [
        [{ "node": "Billing queue", "type": "main", "index": 0 }],
        [{ "node": "Technical queue", "type": "main", "index": 0 }],
        [{ "node": "Sales queue", "type": "main", "index": 0 }],
        [{ "node": "General inbox", "type": "main", "index": 0 }],
        [{ "node": "Human review (replace with Slack / form)", "type": "main", "index": 0 }]
      ]
    },
    "Human review (replace with Slack / form)": { "main": [[{ "node": "Teach Curva", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {}
}
