8
n8n 中文网amn8n.com

捆绑RAG上传

中级

这是一个AI, IT Ops领域的自动化工作流,包含 14 个节点。主要使用 GoogleDrive, SplitInBatches, GoogleDriveTrigger, EmbeddingsOpenAi, VectorStorePinecone 等节点,结合人工智能技术实现智能自动化。 使用OpenAI嵌入将Google Drive文档索引到Pinecone以进行RAG

前置要求
  • Google Drive API 凭证
  • OpenAI API Key
  • Pinecone API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "OceYxCmiuf5W2X4y",
  "meta": {
    "instanceId": "REDACTED_ID",
    "templateCredsSetupCompleted": true
  },
  "name": "捆绑 RAG 上传",
  "tags": [],
  "nodes": [
    {
      "id": "REDACTED_ID",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        180,
        0
      ],
      "parameters": {
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "REDACTED_ID",
            "cachedResultUrl": "REDACTED_URL",
            "cachedResultName": "Course Module Outline Folder for n8n"
          }
        },
        "options": {},
        "resource": "fileFolder",
        "returnAll": true
      },
      "typeVersion": 3
    },
    {
      "id": "REDACTED_ID",
      "name": "获取文档",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        440,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "REDACTED_ID",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        660,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "REDACTED_ID",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        900,
        20
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "Course Outlines"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "REDACTED_ID",
          "cachedResultName": "REDACTED_ID"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "OpenAI 嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        920,
        160
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "REDACTED_ID",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1060,
        240
      ],
      "parameters": {
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "Type",
                "value": "Course Module Names"
              }
            ]
          }
        },
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "递归字符文本分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1140,
        380
      ],
      "parameters": {
        "options": {},
        "chunkSize": 600,
        "chunkOverlap": 60
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "Google Drive 触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -60,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "REDACTED_ID",
          "cachedResultUrl": "REDACTED_URL",
          "cachedResultName": "Course Module Outline Folder for n8n"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "height": 400,
        "content": "Google 文件夹上传触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 400,
        "content": "从文件夹中搜索 Google 文件"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -120
      ],
      "parameters": {
        "color": 2,
        "width": 220,
        "height": 400,
        "content": "获取文件"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 500,
        "height": 680,
        "content": "上传到 Pinecone 向量存储"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 400,
        "content": "多文件循环"
      },
      "typeVersion": 1
    },
    {
      "id": "REDACTED_ID",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -120
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 1300,
        "content": "已编辑网址"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Default Data Loader": [
      {
        "json": {
          "isArtificialRecoveredEventItem": true
        }
      }
    ],
    "Recursive Character Text Splitter": [
      {
        "json": {
          "isArtificialRecoveredEventItem": true
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "REDACTED_ID",
  "connections": {
    "Get Docs": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Get Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Pinecone Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, IT 运维

需要付费吗?

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

工作流信息
难度等级
中级
节点数量14
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Automate With Marc

Automate With Marc

@marconi

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

外部链接
在 n8n.io 查看

分享此工作流