{
  "name": "My workflow 22",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "upload-kb",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        0,
        -48
      ],
      "id": "1824ed93-a304-4923-9786-410d9db6e808",
      "name": "Webhook1"
    },
    {
      "parameters": {
        "operation": "pdf",
        "binaryPropertyName": "file",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1.1,
      "position": [
        176,
        -48
      ],
      "id": "ea56ec0d-a772-45c1-9c71-ecc372efb59f",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "kb_base",
          "mode": "list",
          "cachedResultName": "kb_base"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.3,
      "position": [
        592,
        -48
      ],
      "id": "392c737a-f07e-48b3-a98c-7ca8c7e42411",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1.1,
      "position": [
        816,
        176
      ],
      "id": "51fb0393-93d1-44c7-aeb3-1ca8b2315a38",
      "name": "Default Data Loader"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "typeVersion": 1,
      "position": [
        448,
        176
      ],
      "id": "3bb23b9b-4332-416f-8ae2-f7aa42357bb5",
      "name": "Embeddings Google Gemini",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { status: \"success\", message: \"Knowledge base updated\" } }}",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.5,
      "position": [
        944,
        -48
      ],
      "id": "ad6e1a5a-e9b4-44ae-b56f-b2437954d016",
      "name": "Respond to Webhook1"
    },
    {
      "parameters": {
        "jsCode": "const input = $json.documents || $json.text || $json.data || \"\";\n\nlet text = \"\";\n\nif (Array.isArray(input)) {\n  text = input\n    .filter(x => typeof x === \"string\")\n    .join(\"\\n\\n\");\n} else {\n  text = String(input);\n}\n\nreturn [\n  {\n    json: {\n      text,\n      source: \"uploaded_pdf\"\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        384,
        -48
      ],
      "id": "4a45584d-f745-4bfc-9f45-18c0eb88be2d",
      "name": "Code in JavaScript2"
    }
  ],
  "connections": {
    "Webhook1": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Code in JavaScript2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript2": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "4ed1d6b2-106c-4662-a9b2-855a272b9007",
  "nodeGroups": [],
  "id": "7a0OOae9k4vY5P64",
  "tags": []
}