{
  "name": "Semantic Search API Workflow",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "semantic-search",
        "responseMode": "onReceivedCall",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://backend:8000/webhook/semantic-search",
        "method": "POST",
        "bodyParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{$json.query}}"
            },
            {
              "name": "user_id",
              "value": "={{$json.user_id}}"
            },
            {
              "name": "top_k",
              "value": "={{$json.top_k || 5}}"
            }
          ]
        },
        "options": {
          "timeout": 60000
        }
      },
      "id": "http-search",
      "name": "Search Vector DB",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "operation": "respondWith",
        "responseBody": "={{$json.data}}",
        "respondWith": "json",
        "options": {}
      },
      "id": "respond-node",
      "name": "Respond with Results",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Search Vector DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Vector DB": {
      "main": [
        [
          {
            "node": "Respond with Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "id": "semantic-search-api-workflow"
}