8
n8n 中文网amn8n.com

备份 N8N 工作流到 Github

高级

这是一个自动化工作流,包含 30 个节点。主要使用 If, N8n, Set, Code, Wait 等节点。 备份 N8N 工作流到 Github

前置要求
  • GitHub Personal Access Token
  • Discord Bot Token 或 Webhook

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "7a94cd64cdcb53cb721e010cea9e90907c1dc5fd6766b2d732b573c42bb273f8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "696255b0-7786-410c-927f-ffb4fa7784b9",
      "name": "点击\"执行\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        400,
        -400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5ffbd7ff-596c-4d69-a327-95ab9e31c144",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        140
      ],
      "parameters": {
        "color": 6,
        "width": 2111,
        "height": 752,
        "content": "## 子工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "d552bfbd-24cc-43ab-b008-ba837525e234",
      "name": "执行工作流触发器",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        180,
        540
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4cf656ea-b62c-4c9a-9a2c-f3cd4736af6f",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        800,
        -300
      ],
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "n99peePbw8bFtE9X",
          "name": "N8N Key (Github Backup)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bc776b1e-de7a-4c5c-ab3e-fc6ede7f6d93",
      "name": "返回",
      "type": "n8n-nodes-base.set",
      "position": [
        2140,
        340
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8d513345-6484-431f-afb7-7cf045c90f4f",
              "name": "Done",
              "type": "boolean",
              "value": true
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "cc1748c6-972e-4909-a0d9-2aada40e49b6",
      "name": "如果文件过大",
      "type": "n8n-nodes-base.if",
      "position": [
        820,
        260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "45ce825e-9fa6-430c-8931-9aaf22c42585",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.content }}",
              "rightValue": ""
            },
            {
              "id": "3ce332ca-3827-4c2d-becd-837da737d285",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "68c529b3-8530-42c9-8efa-7c35ea6c24f0",
      "name": "合并项目",
      "type": "n8n-nodes-base.merge",
      "position": [
        820,
        520
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "627cc21c-1f7f-4266-a558-357289bb2746",
      "name": "相同文件 - 不执行任何操作",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6e77f25e-b58c-4e23-a5c7-1951c36e59b6",
      "name": "文件不同",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        500
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "37d72317-7140-45eb-ac62-e88ec7b9fc97",
      "name": "文件是新的",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        700
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "770c9612-e6fb-4d6c-9a89-459e7d5acc31",
      "name": "创建新文件",
      "type": "n8n-nodes-base.github",
      "position": [
        1900,
        700
      ],
      "webhookId": "fc6b1cf0-6440-4fb0-94bf-fadabb6ea1fd",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').first().json.repo_owner }}"
        },
        "filePath": "={{ $('Create sub path').item.json.subPath }}/{{ $('Execute Workflow Trigger').first().json.id }}.json",
        "resource": "file",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').first().json.repo_name }}"
        },
        "fileContent": "={{ JSON.stringify($('Config').first().json.data) }}",
        "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{$json.githubStatus}})"
      },
      "credentials": {
        "githubApi": {
          "id": "nEsQmNXwV6LPvaNE",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "121272d6-0535-494e-b14a-3cc00f87cb8d",
      "name": "编辑现有文件",
      "type": "n8n-nodes-base.github",
      "position": [
        1900,
        500
      ],
      "webhookId": "81fc5f33-06e3-4368-ba2e-0ef46dd8b021",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').first().json.repo_owner }}"
        },
        "filePath": "={{ $('Create sub path').item.json.subPath }}/{{ $('Execute Workflow Trigger').first().json.id }}.json",
        "resource": "file",
        "operation": "edit",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').first().json.repo_name }}"
        },
        "fileContent": "={{ JSON.stringify($('Config').first().json.data) }}",
        "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{ $json.githubStatus }})"
      },
      "credentials": {
        "githubApi": {
          "id": "nEsQmNXwV6LPvaNE",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2847116a-c862-4803-8079-a40e4edd22f7",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1000,
        -300
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ec0c92a3-73fa-480b-bdd3-e51648e8b0a0",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        400,
        -200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                6
              ],
              "triggerAtHour": 1
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "289ec775-7191-4710-85e8-ae33542f9fbd",
      "name": "创建子路径",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "dae43d3b-56e5-4098-b602-862ebf5cd073",
              "name": "subPath",
              "type": "string",
              "value": "={{ $now.setZone('UTC').toFormat('yyyy') }}/{{ $now.setZone('UTC').toFormat('MM') }}/{{ $now.setZone('UTC').toFormat('dd') }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.3
    },
    {
      "id": "b9bf504a-3acf-4706-992d-a522e9693df8",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -500
      ],
      "parameters": {
        "color": 7,
        "width": 2113,
        "height": 616,
        "content": "## 主工作流循环"
      },
      "typeVersion": 1
    },
    {
      "id": "2470503e-cb6a-44a5-a4aa-b431874e2e09",
      "name": "配置",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        540
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8f6d1741-772f-462a-811f-4c334185e4f0",
              "name": "repo_owner",
              "type": "string",
              "value": "=datproto"
            },
            {
              "id": "8cac215c-4fd7-422f-9fd2-6b2d1e5e0383",
              "name": "repo_name",
              "type": "string",
              "value": "=datproto-backup-n8n"
            },
            {
              "id": "2b38f96a-a970-4d13-900e-f15e4cd65c51",
              "name": "data",
              "type": "object",
              "value": "={{\n  {\n    \"nodes\": $('Execute Workflow Trigger').item.json.nodes,\n    \"connections\": $('Execute Workflow Trigger').item.json.connections,\n    \"pinData\": $('Execute Workflow Trigger').item.json.pinData,\n    \"meta\": $('Execute Workflow Trigger').item.json.meta\n  }\n}}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "a7d835f2-de5e-4121-acad-9041c126401c",
      "name": "开始消息",
      "type": "n8n-nodes-base.discord",
      "position": [
        600,
        -300
      ],
      "webhookId": "53d9dd11-ca31-4eea-8dc8-bac95c8bcc04",
      "parameters": {
        "content": "=The Git backup here. Below is my latest activity:\n```\n👉 Starting Workflow Backup [{{ $execution.id }}]\n```",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944764851851344",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344",
          "cachedResultName": "Dat Proto's server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944973958873212",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344/1344944973958873212",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "i8z7R64uXW2cjYik",
          "name": "N8N Bot"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c71ddc51-cbf9-4437-b2b4-9d60f2e1a039",
      "name": "完成通知",
      "type": "n8n-nodes-base.discord",
      "position": [
        1640,
        -440
      ],
      "webhookId": "53d9dd11-ca31-4eea-8dc8-bac95c8bcc04",
      "parameters": {
        "content": "=The Git backup here. Below is my latest activity:\n```\n✅ Backup has completed - {{ $('n8n').all().length }} workflows have been processed.\n```",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944764851851344",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344",
          "cachedResultName": "Dat Proto's server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944973958873212",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344/1344944973958873212",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "i8z7R64uXW2cjYik",
          "name": "N8N Bot"
        }
      },
      "executeOnce": true,
      "typeVersion": 2
    },
    {
      "id": "110ba2cd-6a39-4663-81d5-6b2893d42e18",
      "name": "获取文件数据",
      "type": "n8n-nodes-base.github",
      "position": [
        620,
        260
      ],
      "webhookId": "883c4829-4a9d-4320-ab49-226a5bc15863",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $json.repo_owner }}"
        },
        "filePath": "={{ $now.setZone('UTC').toFormat('yyyy') }}/{{ $now.setZone('UTC').toFormat('MM') }}/{{ $now.setZone('UTC').toFormat('dd') }}/{{ $('Execute Workflow Trigger').item.json.id }}.json",
        "resource": "file",
        "operation": "get",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $json.repo_name }}"
        },
        "asBinaryProperty": false,
        "additionalParameters": {}
      },
      "credentials": {
        "githubApi": {
          "id": "nEsQmNXwV6LPvaNE",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1,
      "continueOnFail": true,
      "alwaysOutputData": true
    },
    {
      "id": "2bdbcb80-2c2b-4fb8-bddb-eb9e6c6db0e0",
      "name": "执行工作流",
      "type": "n8n-nodes-base.executeWorkflow",
      "onError": "continueErrorOutput",
      "position": [
        1420,
        -200
      ],
      "parameters": {
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        },
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2366b904-8f2f-42ce-aa2f-fc941cb73ad4",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        1640,
        -100
      ],
      "webhookId": "577d599b-e2eb-4e7c-92aa-b9ca787cc40a",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "e9ad632a-0506-4709-a485-67c45bf388f6",
      "name": "获取文件",
      "type": "n8n-nodes-base.github",
      "position": [
        1040,
        240
      ],
      "webhookId": "81fc5f33-06e3-4368-ba2e-0ef46dd8b021",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').item.json.repo_owner }}"
        },
        "filePath": "={{ $now.setZone('UTC').toFormat('yyyy') }}/{{ $now.setZone('UTC').toFormat('MM') }}/{{ $now.setZone('UTC').toFormat('dd') }}/{{ $('Execute Workflow Trigger').item.json.id }}.json",
        "resource": "file",
        "operation": "get",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Config').item.json.repo_name }}"
        },
        "additionalParameters": {}
      },
      "credentials": {
        "githubApi": {
          "id": "nEsQmNXwV6LPvaNE",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "656913c3-cb57-4129-ae12-42f70800a9ef",
      "name": "等待1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1420,
        -440
      ],
      "webhookId": "4a7448b4-930e-4110-b205-95c55cac5bba",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "09738ea8-1a61-4967-ac3d-2a9f64b39329",
      "name": "验证差异",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        520
      ],
      "parameters": {
        "jsCode": "const _ = require(\"underscore\")\n\nlet fileInput = null\n\nif (Object.keys($input.first().json).includes(\"content\")) {\n  fileInput = JSON.parse(Buffer.from($input.all()[0].json.content, 'base64').toString())\n}\n\nconst n8nInput = $input.last().json.data\n\nif (!fileInput) {\n  return {\n    \"githubStatus\": \"new\"\n  }\n}\n\nif (_.isMatch(fileInput, n8nInput)) {\n  return {\n    \"githubStatus\": \"same\"\n  }\n} else {\n  return {\n    \"githubStatus\": \"different\"\n  }\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "7cb7b34c-8742-44c3-9792-1084abf2783a",
      "name": "开关",
      "type": "n8n-nodes-base.switch",
      "position": [
        1460,
        520
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "same",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1e6de6b4-3074-41bc-8a9d-465c0eb9a773",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('verifyTheDifference').first().json.githubStatus }}",
                    "rightValue": "same"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "different",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cf6e130e-c85d-4a24-b11a-abfd0ecfcb19",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('verifyTheDifference').first().json.githubStatus }}",
                    "rightValue": "different"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "=new",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f2fc6dda-85f5-4b81-b016-3e033b1dbcab",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('verifyTheDifference').first().json.githubStatus }}",
                    "rightValue": "new"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "c6410f39-34d8-448f-9efd-d66da067637b",
      "name": "等待2",
      "type": "n8n-nodes-base.wait",
      "position": [
        1640,
        -280
      ],
      "webhookId": "4a7448b4-930e-4110-b205-95c55cac5bba",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "a3c4ff40-9887-4e38-985a-f32536d9306f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -500
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 1400,
        "content": "# 工作流备份到Github"
      },
      "typeVersion": 1
    },
    {
      "id": "d511ce8a-1617-4a2a-96d8-6e71ddc372b7",
      "name": "通知成功流程",
      "type": "n8n-nodes-base.discord",
      "onError": "continueRegularOutput",
      "position": [
        1840,
        -280
      ],
      "webhookId": "53d9dd11-ca31-4eea-8dc8-bac95c8bcc04",
      "parameters": {
        "content": "=The Git backup here. Below is my latest activity:\n```\n✅ Success to backup {{ $('Loop Over Items').item.json.id }}\n```",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944764851851344",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344",
          "cachedResultName": "Dat Proto's server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944973958873212",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344/1344944973958873212",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "i8z7R64uXW2cjYik",
          "name": "N8N Bot"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "21052f64-d4b6-4b67-8cb4-dd022a0dab71",
      "name": "通知失败流程",
      "type": "n8n-nodes-base.discord",
      "position": [
        1840,
        -100
      ],
      "webhookId": "53d9dd11-ca31-4eea-8dc8-bac95c8bcc04",
      "parameters": {
        "content": "=The Git backup here. Below is my latest activity:\n```\n👉 Failed to backup {{ $('Loop Over Items').item.json.id }}\n```",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944764851851344",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344",
          "cachedResultName": "Dat Proto's server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1344944973958873212",
          "cachedResultUrl": "https://discord.com/channels/1344944764851851344/1344944973958873212",
          "cachedResultName": "n8n"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "i8z7R64uXW2cjYik",
          "name": "N8N Bot"
        }
      },
      "typeVersion": 2
    }
  ],
  "pinData": {},
  "connections": {
    "n8n": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Inform Failed Flows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Completed Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Inform Success Flows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Merge Items",
            "type": "main",
            "index": 1
          },
          {
            "node": "Get file data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Same file - Do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "File is different",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "File is new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get file": {
      "main": [
        [
          {
            "node": "Merge Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File is new": {
      "main": [
        [
          {
            "node": "Create new file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Items": {
      "main": [
        [
          {
            "node": "verifyTheDifference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get file data": {
      "main": [
        [
          {
            "node": "If file too large",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create new file": {
      "main": [
        [
          {
            "node": "Return",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create sub path": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow": {
      "main": [
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Starting Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Starting Message": {
      "main": [
        [
          {
            "node": "n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "File is different": {
      "main": [
        [
          {
            "node": "Edit existing file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If file too large": {
      "main": [
        [
          {
            "node": "Get file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit existing file": {
      "main": [
        [
          {
            "node": "Return",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inform Failed Flows": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "verifyTheDifference": {
      "main": [
        [
          {
            "node": "Create sub path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inform Success Flows": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Starting Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Same file - Do nothing": {
      "main": [
        [
          {
            "node": "Return",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量30
分类-
节点类型16
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流