{
  "name": "Veo Suggest Flow",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "veo-suggest",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://host.docker.internal:8000/suggest",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "intent",
              "value": "={{$json.intent}}"
            },
            {
              "name": "k",
              "value": "8"
            },
            {
              "name": "n",
              "value": "6"
            }
          ]
        },
        "options": {}
      },
      "id": "http_request",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Extract the top result from the API response\nconst response = $input.first().json;\nconst topResult = response[0];\n\nreturn {\n  json: {\n    compiled: topResult.compiled,\n    score: topResult.score,\n    slots: topResult.json\n  }\n};"
      },
      "id": "set_top_result",
      "name": "Set Top Result",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{$json}}",
        "options": {}
      },
      "id": "respond",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Set Top Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Top Result": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1",
  "id": "1",
  "tags": []
}