{
  "name": "Triage tickets by ranking next actions with VectorPrime via webhook",
  "nodes": [
    {
      "id": "d6a74e08-2432-47ee-895b-76c58b4e81a1",
      "name": "Normalize + Build Options",
      "type": "n8n-nodes-base.code",
      "position": [
        -1232,
        -144
      ]
    },
    {
      "id": "8d43eb7e-c6d7-4baf-bf48-b910dee72293",
      "name": "VectorPrime Rank (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -848,
        -144
      ]
    },
    {
      "id": "a4689d97-8bca-49dd-bc9d-d018bf168c26",
      "name": "Parse VP Result",
      "type": "n8n-nodes-base.code",
      "position": [
        -656,
        -144
      ]
    },
    {
      "id": "c068883f-9050-40e8-88d3-283d157e08cb",
      "name": "VP OK?",
      "type": "n8n-nodes-base.if",
      "position": [
        -480,
        -144
      ]
    },
    {
      "id": "f50f17cf-8cd3-41cd-a245-84c972c929ab",
      "name": "Respond Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        880,
        48
      ]
    },
    {
      "id": "3e8b5857-ea14-4e28-a851-c9ff351fe241",
      "name": "Create Audit Log",
      "type": "n8n-nodes-base.code",
      "position": [
        416,
        -160
      ]
    },
    {
      "id": "3bccd42c-62d2-428e-af4a-65aa87dca227",
      "name": "Respond Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        880,
        -160
      ]
    },
    {
      "id": "bb7022e2-ab9b-4e03-a832-3d2297256888",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1440,
        -144
      ]
    },
    {
      "id": "026a302f-f0ee-48b6-a4c8-d2f81d8761d1",
      "name": "Slack Alert Payload",
      "type": "n8n-nodes-base.set",
      "position": [
        -208,
        -160
      ]
    },
    {
      "id": "21e3b2e7-c1e7-418b-afc0-2bf3ddc2989b",
      "name": "Backlog Record",
      "type": "n8n-nodes-base.set",
      "position": [
        32,
        -160
      ]
    },
    {
      "id": "5e230414-cca8-431f-90a5-f8239c086095",
      "name": "Email Draft",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        -160
      ]
    },
    {
      "id": "8e499f17-70e9-467c-8ae5-133e66ae5410",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -1088
      ],
      "parameters": {
        "width": 1456,
        "height": 480,
        "content": "## What this template does\nThis workflow helps you triage incoming tickets/incidents by returning a prioritized list of “next actions”. It receives a JSON payload via a webhook, validates it, calls an"
      }
    },
    {
      "id": "eca935c6-c75f-4b02-9bee-fb560e32fcdf",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        640,
        -160
      ]
    },
    {
      "id": "a74f9d02-bcb3-4604-851c-4062026be6c4",
      "name": "Normalize OK?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1056,
        -144
      ]
    },
    {
      "id": "e3462824-2f8f-4f21-b071-6228a55926a2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        -432
      ],
      "parameters": {
        "width": 150,
        "height": 256,
        "content": "## Input (Webhook)\nReceives POST JSON with:\n- decision_id (string)\n- prompt (string)\n- options (array, 2+ items)"
      }
    },
    {
      "id": "cb1b7d64-3bc4-49ad-a7ed-2e08154cda1d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -384
      ],
      "parameters": {
        "width": 278,
        "height": 208,
        "content": "## Normalize\nValidates input and builds `vp_payload`.\nReturns error JSON if options are missing/invalid."
      }
    },
    {
      "id": "630ed7bf-51e2-43c8-bc7c-ceccfc4a4249",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -384
      ],
      "parameters": {
        "width": 150,
        "height": 224,
        "content": "## Rank (HTTP)\nCalls the ranking endpoint using your Header Auth credential.\nBody must be JSON so options stay an array."
      }
    },
    {
      "id": "4c4a3d9e-2de8-4440-ae61-b40b735d68a6",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -672,
        -400
      ],
      "parameters": {
        "width": 294,
        "height": 224,
        "content": "## Validate + Route\nParses response and routes:\n- ok=true → success path\n- ok=false → error response"
      }
    },
    {
      "id": "a9877458-9efa-4551-ad85-16337dcc1fb6",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -400
      ],
      "parameters": {
        "width": 1200,
        "height": 416,
        "content": "## Output + Audit\nBuilds optional payload drafts, writes audit log, and responds with JSON."
      }
    },
    {
      "id": "cb23a11e-d142-4cd3-9170-24210664d0dc",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -576
      ],
      "parameters": {
        "width": 150,
        "height": 192,
        "content": "⚠️ Warning\nDo not send options via “Fields below”.\nSend the body as JSON so options remain an array (prevents 422 errors)."
      }
    }
  ],
  "connections": {
    "VP OK?": {
      "main": [
        [
          {
            "node": "Slack Alert Payload",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Normalize + Build Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Respond Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Draft": {
      "main": [
        [
          {
            "node": "Create Audit Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize OK?": {
      "main": [
        [
          {
            "node": "VectorPrime Rank (HTTP)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backlog Record": {
      "main": [
        [
          {
            "node": "Email Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse VP Result": {
      "main": [
        [
          {
            "node": "VP OK?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Audit Log": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Alert Payload": {
      "main": [
        [
          {
            "node": "Backlog Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "VectorPrime Rank (HTTP)": {
      "main": [
        [
          {
            "node": "Parse VP Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize + Build Options": {
      "main": [
        [
          {
            "node": "Normalize OK?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}