8
n8n 中文网amn8n.com

使用自动文件分块将大文件上传到 Kommo/AmoCRM

高级

这是一个Engineering, IT Ops领域的自动化工作流,包含 36 个节点。主要使用 If, Set, Code, Limit, Merge 等节点。 使用自动文件分块将大文件上传到 Kommo/AmoCRM

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "17f738ee24605f0c427d79d36620a2177b9dffa96b085bf0d20a0125bb5d66b4"
  },
  "nodes": [
    {
      "id": "43fda176-35ab-4842-b021-63b5fc999f7d",
      "name": "加载文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2020,
        -60
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "1915137e-ed22-4dd5-af54-74c5d058aef6",
      "name": "获取URL",
      "type": "n8n-nodes-base.set",
      "position": [
        1800,
        -140
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "edc42dd3-05d5-4653-88e9-a1032df9534a",
      "name": "输入",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -620,
        -140
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "a00890dd-b483-4da1-b59f-b6b1a44a153f",
      "name": "获取文件大小(字节)",
      "type": "n8n-nodes-base.code",
      "position": [
        40,
        -240
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "28cf34b1-4299-4780-a246-bd87248c179f",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        480,
        -240
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "353ed775-3d33-4697-b878-c79459ab294c",
      "name": "创建会话",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        260,
        -165
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "80155ba5-fa43-40a1-978f-ffbd5363233e",
      "name": "是否大于最大值",
      "type": "n8n-nodes-base.if",
      "position": [
        700,
        -240
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "6c082793-fef0-4550-9861-ccc53da25430",
      "name": "无可用磁盘空间",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        920,
        -340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "88e11659-116a-4c23-81ba-df6ffb72f9a9",
      "name": "将文件分割为块",
      "type": "n8n-nodes-base.code",
      "position": [
        1160,
        -140
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "c08702e7-33a3-4862-9ad6-896317336bec",
      "name": "结果",
      "type": "n8n-nodes-base.limit",
      "position": [
        1800,
        -340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0f4d3d65-0f5a-4e7b-844e-96b6ce50a85d",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        10,
        -305
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "79dc21b4-69e3-42ca-9f32-925c9e988f0b",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        -400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7bb245c7-064a-4eca-99ca-c87462a5a982",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e173916a-c942-4b23-81f6-5eeb771c83b4",
      "name": "遍历文件块",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1580,
        -140
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "f503d0cd-fd06-4c40-a102-9a1085ac16de",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -180,
        -240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "258f39d5-95b4-4d6c-91bd-ae2ccd403536",
      "name": "是否有文件",
      "type": "n8n-nodes-base.if",
      "position": [
        -400,
        -140
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "59360cb2-1bbf-4f39-8194-836066d0db4b",
      "name": "无文件错误",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        -180,
        -40
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d4d772a6-219b-4b41-9770-9e126e0ea84f",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0f1fd0b1-70f4-43c4-97ed-7712784fce3d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2040,
        80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5d2a3b8f-1f96-4778-b7c8-b7ee6ee7df10",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -1260
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "33a9d955-e861-443b-b2a9-d31b16661f75",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -680
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cc1a58a0-72f5-4b9a-93a6-8e8dc55303fc",
      "name": "开始测试",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -600,
        -600
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "3826ba93-22e9-4187-99fa-f8f5cae6f512",
      "name": "将文件转换为base64字符串",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -160,
        -600
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e84839b2-e0e4-44be-b4ed-de84d3f68ff1",
      "name": "获取文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -380,
        -600
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "c7af8f73-76ee-4730-a0b8-543f7df377a7",
      "name": "上传文件",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        60,
        -600
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "63bc70c6-4eea-415a-ae38-7a8a00833781",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -960
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d5dc456d-7784-4442-bfe9-4aaaceadb511",
      "name": "获取驱动器URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -580,
        -880
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "ebdb0738-0786-40a0-aa4b-a72c6bbe305b",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -700
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3dd1c62b-8500-45f6-adb4-1d995559bf84",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -700
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d57f38f5-a773-41fd-9552-aeaa275b4938",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -860
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "74e1abe6-e842-4038-9766-610a73be461b",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        -880
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8cd57757-47c2-403c-acea-b29240fc5447",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -1360
      ],
      "parameters": {
        "content": "便签13"
      },
      "typeVersion": 1
    },
    {
      "id": "e759d546-ac1f-412d-b7cf-bb421f048ac8",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -1260
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e48cda1e-c737-4f70-b733-bd09d9aee13e",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -1120
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "43523e3f-534e-4827-89a2-f412c1a1ca24",
      "name": "将部分转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1360,
        -140
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "181c8a75-721e-486e-83b2-259fde1aba1a",
      "name": "便签15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -300
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "isGraterThenMax",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "input": {
      "main": [
        [
          {
            "node": "hasFile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getUrl": {
      "main": [
        [
          {
            "node": "loadFile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "hasFile": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No file Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get file": {
      "main": [
        [
          {
            "node": "Convert file to base64 string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "loadFile": {
      "main": [
        [
          {
            "node": "Loop Over File Chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start testing": {
      "main": [
        [
          {
            "node": "Get file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "createSession": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "getFileSizeInBytes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "isGraterThenMax": {
      "main": [
        [
          {
            "node": "No free disk space",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "SplitFileToChunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitFileToChunks": {
      "main": [
        [
          {
            "node": "Convert parts to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getFileSizeInBytes": {
      "main": [
        [
          {
            "node": "createSession",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert parts to File": {
      "main": [
        [
          {
            "node": "Loop Over File Chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over File Chunks": {
      "main": [
        [
          {
            "node": "result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "getUrl",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert file to base64 string": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 工程, IT 运维

需要付费吗?

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

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

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

作者
yatolstoy

yatolstoy

@yatolstoy

Backend typescript developer. I specialize in integrations of amoCRM, Common, Telegram, AI

外部链接
在 n8n.io 查看

分享此工作流