8
n8n 中文网amn8n.com

备份 n8n 工作流到 Google Drive

中级

这是一个Other领域的自动化工作流,包含 6 个节点。主要使用 N8n, Set, Code, GoogleDrive, ScheduleTrigger 等节点。 备份 n8n 工作流到 Google Drive

前置要求
  • Google Drive API 凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移

无法加载工作流预览

导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "name": "点击“执行”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        320,
        170
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        960,
        320
      ],
      "parameters": {
        "mode": "mergeByIndex"
      },
      "typeVersion": 1
    },
    {
      "name": "移动二进制数据",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        1260,
        320
      ],
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "useRawData": false
        }
      },
      "typeVersion": 1
    },
    {
      "name": "映射",
      "type": "n8n-nodes-base.function",
      "position": [
        710,
        320
      ],
      "parameters": {
        "functionCode": "return items[0].json.data.map(item => {\n  return {json: item}\n});"
      },
      "typeVersion": 1
    },
    {
      "name": "获取工作流",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. ",
      "position": [
        830,
        460
      ],
      "parameters": {
        "url": "=http://localhost:5678/rest/workflows/{{$node[\"Map\"].data[\"id\"]}}",
        "options": {},
        "authentication": "basicAuth"
      },
      "credentials": {
        "httpBasicAuth": "n8n Creds"
      },
      "notesInFlow": false,
      "typeVersion": 1
    },
    {
      "name": "获取工作流列表",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Don't forget to add your credentials for your n8n instance in this Node. Use Basic Auth for this. ",
      "position": [
        520,
        320
      ],
      "parameters": {
        "url": "http://localhost:5678/rest/workflows",
        "options": {},
        "authentication": "basicAuth"
      },
      "credentials": {
        "httpBasicAuth": "n8n Creds"
      },
      "typeVersion": 1
    },
    {
      "name": "函数项",
      "type": "n8n-nodes-base.functionItem",
      "position": [
        1110,
        320
      ],
      "parameters": {
        "functionCode": "item = item.data;\nreturn item;"
      },
      "typeVersion": 1
    },
    {
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1450,
        320
      ],
      "parameters": {
        "name": "={{$node[\"Merge\"].data[\"name\"]}}.json",
        "parents": [
          "Delete this text and put id for folder you want to upload into in this field. The folder ID can be found by opening the folder in your browser and copying the portion after https://drive.google.com/drive/u/0/folders/"
        ],
        "binaryData": true,
        "resolveData": true
      },
      "credentials": {
        "googleApi": "test"
      },
      "typeVersion": 1
    },
    {
      "name": "每天凌晨 2:30 运行",
      "type": "n8n-nodes-base.cron",
      "position": [
        330,
        320
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 2,
              "minute": 30
            }
          ]
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Map": {
      "main": [
        [
          {
            "node": "Get Workflow",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "FunctionItem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Workflow List": {
      "main": [
        [
          {
            "node": "Map",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Daily at 2:30am": {
      "main": [
        [
          {
            "node": "Get Workflow List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Get Workflow List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 其他

需要付费吗?

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

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

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

作者
phil

phil

@phil

Accélérateur de Chiffre d'Affaires : Automatisez votre entreprise pour la rendre plus visible sur Google, pour trouver de nouveaux Clients, pour gagner du temps

外部链接
在 n8n.io 查看

分享此工作流