{
  "name": "Backup n8n workflows to Github",
  "nodes": [
    {
      "id": "696255b0-7786-410c-927f-ffb4fa7784b9",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        400,
        -400
      ]
    },
    {
      "id": "5ffbd7ff-596c-4d69-a327-95ab9e31c144",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        140
      ],
      "parameters": {
        "width": 2111,
        "height": 752,
        "content": "## Subworkflow"
      }
    },
    {
      "id": "d552bfbd-24cc-43ab-b008-ba837525e234",
      "name": "Execute Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        180,
        540
      ]
    },
    {
      "id": "4cf656ea-b62c-4c9a-9a2c-f3cd4736af6f",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        800,
        -300
      ]
    },
    {
      "id": "bc776b1e-de7a-4c5c-ab3e-fc6ede7f6d93",
      "name": "Return",
      "type": "n8n-nodes-base.set",
      "position": [
        2140,
        340
      ]
    },
    {
      "id": "cc1748c6-972e-4909-a0d9-2aada40e49b6",
      "name": "If file too large",
      "type": "n8n-nodes-base.if",
      "position": [
        820,
        260
      ]
    },
    {
      "id": "68c529b3-8530-42c9-8efa-7c35ea6c24f0",
      "name": "Merge Items",
      "type": "n8n-nodes-base.merge",
      "position": [
        820,
        520
      ]
    },
    {
      "id": "627cc21c-1f7f-4266-a558-357289bb2746",
      "name": "Same file - Do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        340
      ]
    },
    {
      "id": "6e77f25e-b58c-4e23-a5c7-1951c36e59b6",
      "name": "File is different",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        500
      ]
    },
    {
      "id": "37d72317-7140-45eb-ac62-e88ec7b9fc97",
      "name": "File is new",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1680,
        700
      ]
    },
    {
      "id": "770c9612-e6fb-4d6c-9a89-459e7d5acc31",
      "name": "Create new file",
      "type": "n8n-nodes-base.github",
      "position": [
        1900,
        700
      ]
    },
    {
      "id": "121272d6-0535-494e-b14a-3cc00f87cb8d",
      "name": "Edit existing file",
      "type": "n8n-nodes-base.github",
      "position": [
        1900,
        500
      ]
    },
    {
      "id": "2847116a-c862-4803-8079-a40e4edd22f7",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1000,
        -300
      ]
    },
    {
      "id": "ec0c92a3-73fa-480b-bdd3-e51648e8b0a0",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        400,
        -200
      ]
    },
    {
      "id": "289ec775-7191-4710-85e8-ae33542f9fbd",
      "name": "Create sub path",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        520
      ]
    },
    {
      "id": "b9bf504a-3acf-4706-992d-a522e9693df8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -500
      ],
      "parameters": {
        "width": 2113,
        "height": 616,
        "content": "## Main workflow loop"
      }
    },
    {
      "id": "2470503e-cb6a-44a5-a4aa-b431874e2e09",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        540
      ]
    },
    {
      "id": "a7d835f2-de5e-4121-acad-9041c126401c",
      "name": "Starting Message",
      "type": "n8n-nodes-base.discord",
      "position": [
        600,
        -300
      ]
    },
    {
      "id": "c71ddc51-cbf9-4437-b2b4-9d60f2e1a039",
      "name": "Completed Notification",
      "type": "n8n-nodes-base.discord",
      "position": [
        1640,
        -440
      ]
    },
    {
      "id": "110ba2cd-6a39-4663-81d5-6b2893d42e18",
      "name": "Get file data",
      "type": "n8n-nodes-base.github",
      "position": [
        620,
        260
      ]
    },
    {
      "id": "2bdbcb80-2c2b-4fb8-bddb-eb9e6c6db0e0",
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1420,
        -200
      ]
    },
    {
      "id": "2366b904-8f2f-42ce-aa2f-fc941cb73ad4",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1640,
        -100
      ]
    },
    {
      "id": "e9ad632a-0506-4709-a485-67c45bf388f6",
      "name": "Get file",
      "type": "n8n-nodes-base.github",
      "position": [
        1040,
        240
      ]
    },
    {
      "id": "656913c3-cb57-4129-ae12-42f70800a9ef",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1420,
        -440
      ]
    },
    {
      "id": "09738ea8-1a61-4967-ac3d-2a9f64b39329",
      "name": "verifyTheDifference",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        520
      ]
    },
    {
      "id": "7cb7b34c-8742-44c3-9792-1084abf2783a",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1460,
        520
      ]
    },
    {
      "id": "c6410f39-34d8-448f-9efd-d66da067637b",
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "position": [
        1640,
        -280
      ]
    },
    {
      "id": "a3c4ff40-9887-4e38-985a-f32536d9306f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -500
      ],
      "parameters": {
        "width": 680,
        "height": 1400,
        "content": "# Workflows backup to Github\n======================================================================\n\n## Introduction\nThis workflow will backup all of your existed workflows to a single Github reposito"
      }
    },
    {
      "id": "d511ce8a-1617-4a2a-96d8-6e71ddc372b7",
      "name": "Inform Success Flows",
      "type": "n8n-nodes-base.discord",
      "position": [
        1840,
        -280
      ]
    },
    {
      "id": "21052f64-d4b6-4b67-8cb4-dd022a0dab71",
      "name": "Inform Failed Flows",
      "type": "n8n-nodes-base.discord",
      "position": [
        1840,
        -100
      ]
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}