8
n8n 中文网amn8n.com

AIAutomationPro 每小时备份到 Google Drive v1

高级

这是一个DevOps, IT Ops领域的自动化工作流,包含 19 个节点。主要使用 N8n, Set, Wait, DateTime, GoogleDrive 等节点。 定时 n8n 工作流备份到 Google Drive,带自动清理

前置要求
  • Google Drive API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "uTDqvTnmDaTgRRu8",
  "meta": {
    "instanceId": "b3df22d2875c82e3ba1883c50049ed9cee0bcabf99d2b486961d2245a09e3964",
    "templateId": "2469",
    "templateCredsSetupCompleted": true
  },
  "name": "AIAutomationPro 每小时备份到 Google Drive v1",
  "tags": [
    {
      "id": "MqQ2zS7ixA8b0cmJ",
      "name": "Tool",
      "createdAt": "2024-11-15T19:27:51.756Z",
      "updatedAt": "2024-12-30T09:58:18.482Z"
    },
    {
      "id": "RHp83eTHbIpxlDCF",
      "name": "Template",
      "createdAt": "2025-01-03T16:24:28.562Z",
      "updatedAt": "2025-01-03T16:24:28.562Z"
    },
    {
      "id": "3rkMsCyNbu0QrC94",
      "name": "Backup",
      "createdAt": "2025-04-17T05:01:34.098Z",
      "updatedAt": "2025-04-17T05:01:34.098Z"
    }
  ],
  "nodes": [
    {
      "id": "a2dd2041-2bea-4659-aab6-0b0dd0640f55",
      "name": "日期时间",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        1400,
        2200
      ],
      "parameters": {
        "options": {},
        "outputFieldName": "now"
      },
      "typeVersion": 2
    },
    {
      "id": "54e48154-26bd-49c0-a0b6-5c67ce3eab54",
      "name": "日期时间格式",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        1620,
        2200
      ],
      "parameters": {
        "date": "={{ $('Date Time').first().json.now }}",
        "format": "yyyy-MM-dd",
        "options": {},
        "operation": "formatDate"
      },
      "typeVersion": 2
    },
    {
      "id": "5d3bad24-ef42-42f7-8a41-ca8fbad75b61",
      "name": "日期时间小时",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        1840,
        2200
      ],
      "parameters": {
        "date": "={{ $('Date Time').first().json.now }}",
        "part": "hour",
        "options": {},
        "operation": "extractDate",
        "outputFieldName": "hour"
      },
      "typeVersion": 2
    },
    {
      "id": "a8e058b1-f438-470c-8a84-49cd168c8307",
      "name": "Google Drive 每小时备份文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2060,
        2200
      ],
      "parameters": {
        "name": "=n8n_backup_{{ $('Date & Time Format').first().json.formattedDate }}_{{ $('Date & Time Hour').first().json.hour }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "0AKPPy6FuV32kUk9PVA",
          "cachedResultUrl": "https://drive.google.com/drive/folders/0AKPPy6FuV32kUk9PVA",
          "cachedResultName": "AI Automation Pro"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1bfYhgr3GiwFxvfPQiPB_I814Lsuv9tM3",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1bfYhgr3GiwFxvfPQiPB_I814Lsuv9tM3",
          "cachedResultName": "Template - N8n Backup"
        },
        "resource": "folder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "q8OibtSjVurZl2tb",
          "name": "AI Auto Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "521f49b0-d349-4781-9a7e-3b0b33f77a5c",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        2120
      ],
      "parameters": {
        "color": 2,
        "width": 2103,
        "height": 296,
        "content": "## 每小时创建 N8N 备份工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "69baef8f-9074-4858-8d5e-751c7d980f34",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1940,
        2540
      ],
      "parameters": {
        "color": 2,
        "width": 1003,
        "height": 296,
        "content": "## 删除过去 X 天的 N8N 备份工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "665cc313-a152-4eea-98bc-a11cec81e97d",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        2280,
        2200
      ],
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "S63rln42rAvGFfBB",
          "name": "n8n account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bb33fd37-6077-429e-b88d-44dce50df544",
      "name": "移动二进制数据",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        2500,
        2200
      ],
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "={{ $json.name }}",
          "useRawData": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4926fe6f-ed1e-466c-b83c-fdea9a7ff08c",
      "name": "分批处理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2720,
        2200
      ],
      "parameters": {
        "options": {
          "reset": false
        },
        "batchSize": 1
      },
      "typeVersion": 2
    },
    {
      "id": "a511a9e2-6892-42c1-975e-50d30e11d37c",
      "name": "Google Drive 上传工作流",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2940,
        2180
      ],
      "parameters": {
        "name": "={{ $('Split In Batches').item.binary.data.fileName }}.json\n\n",
        "options": {},
        "parents": [
          "={{ $('Google Drive Backup Folder Every Hour').first().json.id }}"
        ],
        "binaryData": true,
        "authentication": "oAuth2"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "q8OibtSjVurZl2tb",
          "name": "AI Auto Google Drive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "22a954ab-0b20-48a2-8bc6-fb5c7aa6c11a",
      "name": "日期时间格式 2",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        2280,
        2640
      ],
      "parameters": {
        "date": "={{ $('Date & Time Subtract Coverage Period').first().json.newDate }}",
        "format": "yyyy-MM-dd",
        "options": {},
        "operation": "formatDate"
      },
      "typeVersion": 2
    },
    {
      "id": "3ae1beba-024f-4b57-b298-9b5c2347cb3d",
      "name": "Google Drive 搜索",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2500,
        2640
      ],
      "parameters": {
        "limit": 1,
        "filter": {},
        "options": {},
        "resource": "fileFolder",
        "queryString": "=n8n_backup_{{ $('Date & Time Format 2').first().json.formattedDate }}_{{ $('Date & Time Hour').first().json.hour }}"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "q8OibtSjVurZl2tb",
          "name": "AI Auto Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "79591e71-6ee8-4a04-b798-318befcc37c3",
      "name": "Google Drive 删除",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2720,
        2640
      ],
      "parameters": {
        "options": {},
        "resource": "folder",
        "operation": "deleteFolder",
        "folderNoRootId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Google Drive Search').first().json.id }}"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "q8OibtSjVurZl2tb",
          "name": "AI Auto Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d01f220a-df90-4de9-b4a0-b588cc787e62",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        3160,
        2180
      ],
      "webhookId": "bb6e6e2b-d95b-4a46-8992-601833c02b9a",
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "7cc95066-a8a4-4cfe-9271-38b7da181eb6",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        2120
      ],
      "parameters": {
        "color": 2,
        "width": 303,
        "height": 296,
        "content": "## 备份覆盖周期"
      },
      "typeVersion": 1
    },
    {
      "id": "f420f5e8-36e0-4db2-a033-2fab8361338f",
      "name": "设置",
      "type": "n8n-nodes-base.set",
      "position": [
        940,
        2200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "84e8bbad-e48d-4a58-af4f-ca08938acc26",
              "name": "Coverage Period",
              "type": "number",
              "value": 7
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "34a3af65-82ca-4c6d-a373-54ddea04229f",
      "name": "日期时间减去覆盖周期",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        2060,
        2640
      ],
      "parameters": {
        "options": {},
        "duration": "={{ $('Settings').first().json['Coverage Period'] }}",
        "magnitude": "={{ $('Date Time').first().json.now }}",
        "operation": "subtractFromDate"
      },
      "typeVersion": 2
    },
    {
      "id": "34b988b7-0dcd-49cd-840c-13830a055e2d",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        620,
        2200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "8286b8b8-5c27-4722-9626-b388cc9ccc0a",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        2080
      ],
      "parameters": {
        "width": 720,
        "height": 2220,
        "content": "## 每小时 n8n 工作流备份到 Google Drive"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "errorWorkflow": "KhpM42Ckgy6qgzCz",
    "executionOrder": "v0"
  },
  "versionId": "5dc4b523-d904-4977-b901-fa786fc024f6",
  "connections": {
    "n8n": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Date Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date Time": {
      "main": [
        [
          {
            "node": "Date & Time Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time Hour": {
      "main": [
        [
          {
            "node": "Google Drive Backup Folder Every Hour",
            "type": "main",
            "index": 0
          },
          {
            "node": "Date & Time Subtract Coverage Period",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Google Drive Upload Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time Format": {
      "main": [
        [
          {
            "node": "Date & Time Hour",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Search": {
      "main": [
        [
          {
            "node": "Google Drive Delete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time Format 2": {
      "main": [
        [
          {
            "node": "Google Drive Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Upload Workflows": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time Subtract Coverage Period": {
      "main": [
        [
          {
            "node": "Date & Time Format 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Backup Folder Every Hour": {
      "main": [
        [
          {
            "node": "n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 开发运维, IT 运维

需要付费吗?

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

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

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

作者
Daniel Ng

Daniel Ng

@danielng

A Growth Hacker, Digital Marketer & AI Automation Builder with 10+ years of experience in Digital Marketing & Workflow Automation. Based in Helsinki, Finland. For questions about my templates and customization, contact me at: daniel@aiautomationpro.org

外部链接
在 n8n.io 查看

分享此工作流