8
n8n 中文网amn8n.com

📁🔁 Google Drive 复制文件夹结构 (n8n)

中级

这是一个IT Ops领域的自动化工作流,包含 12 个节点。主要使用 If, Set, Code, Merge, GoogleDrive 等节点。 在Google Drive中复制文件夹结构(不含文件)

前置要求
  • Google Drive API 凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VroevTqXeech3Gjo",
  "meta": {
    "instanceId": "2d4b97f52377b00080bd41b0ce66bd68553d32852974b6b1df9d5b8b439728d9",
    "templateCredsSetupCompleted": true
  },
  "name": "📁🔁 Google Drive 复制文件夹结构 (n8n)",
  "tags": [
    {
      "id": "GviYgVwcOV5jZvGf",
      "name": "tool agents",
      "createdAt": "2025-05-19T16:06:57.753Z",
      "updatedAt": "2025-05-19T16:06:57.753Z"
    }
  ],
  "nodes": [
    {
      "id": "0f7a36d4-baed-4001-b730-6444ec832e26",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "38847cef-8562-44a1-92df-7657988e5e64",
      "name": "获取源文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1060,
        0
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "483f4b3e-1259-4b12-9238-1ba07c29c085",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "07a21712-779e-477d-b7b9-35a861add96e",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        240
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "205429d5-ad05-494e-bea2-8303f7635d8c",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1280,
        0
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "c19cf4c1-e4b7-4f70-b5de-e7ec0d63863c",
      "name": "编辑此节点",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        0
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "10f6dc80-e038-42b4-92bb-9ea4b9e6c234",
      "name": "创建文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1880,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8d337637-e567-48b4-9741-1c872edcb77f",
      "name": "检查文件夹是否存在",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        20
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "68745849-733d-4af6-90b6-9bf075343509",
      "name": "如果存在",
      "type": "n8n-nodes-base.if",
      "position": [
        1700,
        20
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "34e50022-50ad-4ac3-aacb-9216fe5853a3",
      "name": "获取目标文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        420,
        0
      ],
      "parameters": {},
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "cea69a53-6a46-4b51-80c8-65e38df1ef95",
      "name": "设置目标名称",
      "type": "n8n-nodes-base.set",
      "position": [
        860,
        0
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "abb1ef22-91a3-426a-99ad-485a6f4412e6",
      "name": "合并文件夹上下文",
      "type": "n8n-nodes-base.merge",
      "position": [
        640,
        0
      ],
      "parameters": {},
      "typeVersion": 3.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "05291ec7-25fe-4381-9663-8ac48af0b5a4",
  "connections": {
    "If exists": {
      "main": [
        [],
        [
          {
            "node": "Create Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Folder": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EDIT_THIS_NODE": {
      "main": [
        [
          {
            "node": "Get_Folders_DESTINATION",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge_Folder_Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Check if folder exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get_Folders_SOURCE": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge_Folder_Context": {
      "main": [
        [
          {
            "node": "Set Destination Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Destination Names": {
      "main": [
        [
          {
            "node": "Get_Folders_SOURCE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if folder exists": {
      "main": [
        [
          {
            "node": "If exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get_Folders_DESTINATION": {
      "main": [
        [
          {
            "node": "Merge_Folder_Context",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "EDIT_THIS_NODE",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - IT 运维

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流