8
n8n 中文网amn8n.com

将文件存储到Qdrant CLOUD Fairwork

高级

这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 35 个节点。主要使用 Code, Merge, FormTrigger, GoogleDrive, ManualTrigger 等节点。 使用OpenAI、Gemini和Qdrant处理文档并构建语义搜索

前置要求
  • Google Drive API 凭证
  • OpenAI API Key
  • Qdrant 服务器连接信息
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "7np7XO05qTRGi5Fr",
  "meta": {
    "instanceId": "3612a0c89f35a354ddd1216385240db51b4635fde7cae2a0d5004be915b832f3",
    "templateCredsSetupCompleted": true
  },
  "name": "将文件存储到 Qdrant CLOUD Fairwork",
  "tags": [],
  "nodes": [
    {
      "id": "2fca2a63-71ab-423d-a9d9-c94958891fc2",
      "name": "下载文件",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        -112,
        160
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "binaryPropertyName": "pdf-document",
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "application/pdf",
              "sheetsToFormat": "application/pdf",
              "slidesToFormat": "application/pdf",
              "drawingsToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "Wd6AIw29vj1j04ym",
          "name": "Google Drive team@jezweb.net"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a91f9540-cace-4603-b9bf-5d1756edd00d",
      "name": "插入到 Qdrant",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        352,
        272
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "fairwork"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "Y0928F9UfBPpK6NI",
          "name": "QdrantApi CLOUD team-jezweb-net fairwork"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2cb3650f-519a-4827-bc29-6317941f0b1e",
      "name": "OpenAI 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        208,
        544
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "31ZcSDx93u4ldljZ",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "23796c89-e29b-4788-97aa-4fcd296d1dee",
      "name": "删除文件",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        416,
        112
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Download File').item.json.id }}"
        },
        "options": {},
        "operation": "deleteFile"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "Wd6AIw29vj1j04ym",
          "name": "Google Drive team@jezweb.net"
        }
      },
      "executeOnce": true,
      "typeVersion": 3
    },
    {
      "id": "8ab7a876-456f-46e4-b91f-9c31511a499e",
      "name": "🔵 工作流概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 716,
        "height": 688,
        "content": "## 🔵 处理并删除 Google Drive 文件"
      },
      "typeVersion": 1
    },
    {
      "id": "9e6fd226-7d0a-4a9e-9fee-be8baabbe12f",
      "name": "🟡 触发器配置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -592
      ],
      "parameters": {
        "color": 4,
        "width": 708,
        "height": 284,
        "content": "## 🟡 设置任务"
      },
      "typeVersion": 1
    },
    {
      "id": "4c350c67-0bc2-4a5c-abe7-86d1d1d08069",
      "name": "🟢 批处理逻辑",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -240
      ],
      "parameters": {
        "color": 6,
        "width": 900,
        "height": 688,
        "content": "## 🟢 批处理流程"
      },
      "typeVersion": 1
    },
    {
      "id": "198c026a-7dbf-4a2d-9292-842d80839983",
      "name": "🔴 删除警告",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -240
      ],
      "parameters": {
        "color": 3,
        "width": 404,
        "height": 608,
        "content": "## 🔴 ⚠️ 严重警告 ⚠️"
      },
      "typeVersion": 1
    },
    {
      "id": "71d6f6d4-3544-4149-9d57-1ed471c4453d",
      "name": "🟢 文档处理流水线",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -240
      ],
      "parameters": {
        "color": 7,
        "width": 644,
        "height": 1028,
        "content": "## 🟢 文档处理"
      },
      "typeVersion": 1
    },
    {
      "id": "75015003-24ad-4b35-96c2-841658876f0d",
      "name": "🟡 设置要求",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -832
      ],
      "parameters": {
        "color": 4,
        "width": 436,
        "height": 520,
        "content": "## 🟡 设置要求"
      },
      "typeVersion": 1
    },
    {
      "id": "7423b1d9-ea96-4539-8bfa-07a9d0e59d95",
      "name": "🟣 性能提示",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -832
      ],
      "parameters": {
        "color": 4,
        "width": 484,
        "height": 516,
        "content": "## 🟣 性能与优化"
      },
      "typeVersion": 1
    },
    {
      "id": "dc184d65-48ab-42cf-95cd-c14397227aaa",
      "name": "🟠 故障排除",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -832
      ],
      "parameters": {
        "color": 4,
        "width": 484,
        "height": 520,
        "content": "## 🟠 故障排除指南"
      },
      "typeVersion": 1
    },
    {
      "id": "c6878ad3-4888-481d-9029-18a58417501a",
      "name": "🟣 替代方案",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        -240
      ],
      "parameters": {
        "width": 384,
        "height": 596,
        "content": "## 🟣 替代选项"
      },
      "typeVersion": 1
    },
    {
      "id": "0e420eac-4046-4eee-9646-687c64a3e1c1",
      "name": "🟡 设置要求1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -832
      ],
      "parameters": {
        "color": 4,
        "width": 708,
        "height": 216,
        "content": "## 🟡 为什么使用此工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "a3d0f647-0685-44b4-bf83-ba082560a926",
      "name": "插入到 Qdrant1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        -480,
        688
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "fairwork"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "Y0928F9UfBPpK6NI",
          "name": "QdrantApi CLOUD team-jezweb-net fairwork"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2d62982c-cd7c-40fa-bfd2-578fcaed7bba",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -624,
        960
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "31ZcSDx93u4ldljZ",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cd85b0ae-0fe1-4fdf-964b-3748640e14da",
      "name": "Google Drive 文件数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        464,
        448
      ],
      "parameters": {
        "options": {},
        "dataType": "binary",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f5d618c7-c4ee-4560-a16a-5309fbe361c5",
      "name": "表单文件数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -320,
        880
      ],
      "parameters": {
        "options": {},
        "dataType": "binary",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "a20b1220-7b95-4096-b1de-c7af0ee7835d",
      "name": "文件上传表单",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1472,
        672
      ],
      "webhookId": "cf14c028-7ee0-42d6-b1d2-2cce20b02967",
      "parameters": {
        "options": {
          "path": "32aaa027-a092-4e33-89b9-f03b83b0aea3",
          "ignoreBots": true,
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "formSubmittedText": "Files are being uploaded"
            }
          }
        },
        "formTitle": "Upload Files to Vector Database",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "Files",
              "requiredField": true,
              "acceptFileTypes": ".pdf,.docx,.doc,csv"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cc7f894c-f018-488b-bc8c-6a3d75910dde",
      "name": "🟢 批处理逻辑1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        528
      ],
      "parameters": {
        "color": 6,
        "width": 1684,
        "height": 672,
        "content": "## 🟢 手动表单处理流程"
      },
      "typeVersion": 1
    },
    {
      "id": "0389fee9-a06c-4ac5-9530-bffe9f6aa2ac",
      "name": "递归字符文本分割器 1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        576,
        624
      ],
      "parameters": {
        "options": {},
        "chunkSize": 1500,
        "chunkOverlap": 250
      },
      "typeVersion": 1
    },
    {
      "id": "e333e2f9-52c0-4778-a0fe-399a43bfafca",
      "name": "递归字符文本分割器 2",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -416,
        1040
      ],
      "parameters": {
        "options": {},
        "chunkSize": 1500,
        "chunkOverlap": 250
      },
      "typeVersion": 1
    },
    {
      "id": "8b4b799b-7762-4502-add7-675b53f69481",
      "name": "分割表单批次",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -928,
        672
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "39729576-9753-4aab-afd7-e6f7f6d1f97c",
      "name": "列出 Google Drive 文件夹中的文件",
      "type": "n8n-nodes-base.googleDrive",
      "onError": "continueRegularOutput",
      "position": [
        -592,
        160
      ],
      "parameters": {
        "limit": 1,
        "filter": {
          "driveId": {
            "mode": "list",
            "value": "My Drive"
          },
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "1RDHwOiI6DdnDxf2vQbVXS4yi_spMSZUk",
            "cachedResultUrl": "https://drive.google.com/drive/folders/1RDHwOiI6DdnDxf2vQbVXS4yi_spMSZUk",
            "cachedResultName": "fairwork"
          }
        },
        "options": {},
        "resource": "fileFolder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "Wd6AIw29vj1j04ym",
          "name": "Google Drive team@jezweb.net"
        }
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "1b331bfb-1be4-4dd1-aaec-31ad0bc5a4e2",
      "name": "Google Drive 文件夹中的新文件",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -1104,
        -64
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1RDHwOiI6DdnDxf2vQbVXS4yi_spMSZUk",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1RDHwOiI6DdnDxf2vQbVXS4yi_spMSZUk",
          "cachedResultName": "fairwork"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "Wd6AIw29vj1j04ym",
          "name": "Google Drive team@jezweb.net"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e4c6209-edf9-4660-a866-fd3355e56135",
      "name": "分割表单文件",
      "type": "n8n-nodes-base.code",
      "position": [
        -1216,
        672
      ],
      "parameters": {
        "jsCode": "// Get all items from the form upload\nconst items = $input.all();\nconst outputItems = [];\n\n// Process each item\nfor (const item of items) {\n  const binaryData = item.binary || {};\n  \n  // Extract all file properties (Files_0, Files_1, etc.)\n  const fileKeys = Object.keys(binaryData).filter(key => key.startsWith('Files_'));\n  \n  // Create separate items for each file\n  for (const fileKey of fileKeys) {\n    const file = binaryData[fileKey];\n    outputItems.push({\n      json: {\n        fileName: file.fileName,\n        mimeType: file.mimeType,\n        fileSize: file.fileSize,\n        fileExtension: file.fileExtension\n      },\n      binary: {\n        data: file\n      }\n    });\n  }\n}\n\nreturn outputItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "bc98d692-9bce-491e-9d25-5ec9c811028c",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        960,
        640
      ],
      "webhookId": "82bbd685-b7b5-4dbb-b7c8-4441c9755cca",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "39c5d3a1-55cb-4e93-8297-7251f3e05c11",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1168,
        640
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "561b3d53-549c-4167-a1f5-06ee9d302ffe",
      "name": "Qdrant 向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1344,
        896
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "toolDescription": "Retrieve information from the vector store to help answer the users questions.",
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "fairwork",
          "cachedResultName": "fairwork"
        }
      },
      "credentials": {
        "qdrantApi": {
          "id": "Y0928F9UfBPpK6NI",
          "name": "QdrantApi CLOUD team-jezweb-net fairwork"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "770b9276-97bb-49bd-970c-807eeebb659b",
      "name": "OpenAI 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1440,
        1104
      ],
      "parameters": {
        "model": "text-embedding-3-large",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "31ZcSDx93u4ldljZ",
          "name": "OpenAi account 2"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d4c712d3-43aa-46ad-9021-9349cec9c1d4",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1040,
        960
      ],
      "parameters": {
        "options": {
          "temperature": 0.4
        }
      },
      "credentials": {
        "googlePalmApi": {
          "id": "lBQrszvhtstelPlO",
          "name": "Google Gemini(PaLM) Api account 4"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5861e0f5-32d7-42f2-a121-a50653f48a53",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1184,
        848
      ],
      "parameters": {
        "contextWindowLength": 50
      },
      "typeVersion": 1.3
    },
    {
      "id": "4f0978fa-756c-4200-af79-a7b6ec310a6b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        464
      ],
      "parameters": {
        "color": 4,
        "width": 832,
        "height": 816,
        "content": "## 聊天机器人演示"
      },
      "typeVersion": 1
    },
    {
      "id": "9d7977b5-37f8-4442-b6c4-1e393b9dbf9e",
      "name": "手动触发工作流",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1104,
        256
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "79ab8384-c14e-469d-a9c8-2c672507df93",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1136,
        224
      ],
      "parameters": {
        "mode": "chooseBranch"
      },
      "typeVersion": 3.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true,
    "saveDataErrorExecution": "all",
    "saveDataSuccessExecution": "all"
  },
  "versionId": "c65f059d-85aa-4e40-9766-5f919ac52ec0",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "List Files in Google Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete File": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Delete File",
            "type": "main",
            "index": 0
          },
          {
            "node": "Insert to Qdrant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "File Upload Form": {
      "main": [
        [
          {
            "node": "Split Form Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert to Qdrant": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Form Files": {
      "main": [
        [
          {
            "node": "Split Form Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "main": [],
      "ai_embedding": [
        [
          {
            "node": "Insert to Qdrant",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Insert to Qdrant1": {
      "main": [
        [
          {
            "node": "Split Form Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Insert to Qdrant1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Split Form Batches": {
      "main": [
        [],
        [
          {
            "node": "Insert to Qdrant1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Manually Trigger Workflow": {
      "main": [
        [
          {
            "node": "List Files in Google Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Loader for Form Files": {
      "ai_document": [
        [
          {
            "node": "Insert to Qdrant1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New File In Google Drive Folder": {
      "main": [
        [
          {
            "node": "List Files in Google Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Files in Google Drive Folder": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Loader for Google Drive Files": {
      "main": [],
      "ai_document": [
        [
          {
            "node": "Insert to Qdrant",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter 1": {
      "ai_textSplitter": [
        [
          {
            "node": "Data Loader for Google Drive Files",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter 2": {
      "ai_textSplitter": [
        [
          {
            "node": "Data Loader for Form Files",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - AI RAG 检索增强, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量35
分类2
节点类型16
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jez

Jez

@jez

I'm passionate about combining traditional web development with AI and automation to create impactful online solutions. As Founder & CEO of Jezweb, an award-winning Newcastle, Australia agency, I lead a 30+ person team delivering high-quality web design, development, and hosting services to over 3000 clients.

外部链接
在 n8n.io 查看

分享此工作流