8
n8n 中文网amn8n.com

FTP 到 Google Drive

中级

这是一个File Management领域的自动化工作流,包含 9 个节点。主要使用 If, Ftp, GoogleDrive, ManualTrigger 等节点。 从 FTP 服务器传输文件到 Google Drive

前置要求
  • Google Drive API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "V5SaH2SZzVTyn829",
  "meta": {
    "instanceId": "d577bb7ef0d4aecc419892e166746cbc334912494e75dd71e05bcd85fd68e5bb",
    "templateCredsSetupCompleted": true
  },
  "name": "FTP 到 Google Drive",
  "tags": [],
  "nodes": [
    {
      "id": "3733da7c-f05d-4679-9f47-8e72295dcc77",
      "name": "手动触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1184,
        -192
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b7223fcd-e5f9-4be6-b645-409a91017373",
      "name": "工作流文档",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -512
      ],
      "parameters": {
        "width": 389,
        "height": 233,
        "content": "## FTP 到 Google Drive 传输工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "916ae8dc-799a-4c80-ab59-22f2c9d16044",
      "name": "列出 FTP 目录",
      "type": "n8n-nodes-base.ftp",
      "position": [
        -960,
        -192
      ],
      "parameters": {
        "path": "/",
        "operation": "list"
      },
      "credentials": {
        "ftp": {
          "id": "t4MWeiBq6luzXIGz",
          "name": "FTP account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d47ccf08-31bc-4d12-bac9-3fdb2be4a6e0",
      "name": "处理说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -496
      ],
      "parameters": {
        "width": 320,
        "content": "## 文件处理"
      },
      "typeVersion": 1
    },
    {
      "id": "09ce1608-37d2-40ee-a535-b2104d92747b",
      "name": "仅筛选文件",
      "type": "n8n-nodes-base.if",
      "position": [
        -736,
        -192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-1",
              "operator": {
                "type": "string",
                "operation": "equals",
                "rightType": "string"
              },
              "leftValue": "={{ $json.type }}",
              "rightValue": "-"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6c9a1d63-79bc-4ebd-899d-709accd50191",
      "name": "从 FTP 下载文件",
      "type": "n8n-nodes-base.ftp",
      "position": [
        -512,
        -288
      ],
      "parameters": {
        "path": "={{ $json.path }}",
        "binaryPropertyName": "={{ $json.name }}"
      },
      "credentials": {
        "ftp": {
          "id": "t4MWeiBq6luzXIGz",
          "name": "FTP account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3a715a9f-7b50-4cf3-9e6f-dfb70760f739",
      "name": "上传到 Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -288,
        -288
      ],
      "parameters": {
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": "1ABCdefGHIjklMNOpqrSTUvwxyz"
      },
      "typeVersion": 3
    },
    {
      "id": "032523ae-cdac-43ac-9a4c-8b4ac2277be5",
      "name": "无操作,不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -512,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "87566e32-5b20-4aeb-abe6-61cbf2c98c1d",
      "name": "无操作,不执行任何操作1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -64,
        -288
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "93f753aa-891f-4e66-a34e-e36e99405ce8",
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "List FTP Directory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Files Only": {
      "main": [
        [
          {
            "node": "Download File from FTP",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List FTP Directory": {
      "main": [
        [
          {
            "node": "Filter Files Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File from FTP": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 文件管理

需要付费吗?

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

工作流信息
难度等级
中级
节点数量9
分类1
节点类型6
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流