Skip to content

Automated daily workflow backup to GitHub

Netxsites

Maintaining up-to-date backups of workflows, scripts, and automation processes is essential for data security, version control, and business continuity.
With automated daily backups to GitHub, you can ensure that all your workflows are securely stored, versioned, and recoverable — without manual intervention.


✨ What This System Does

  • Automatically backs up workflow files, scripts, and configuration data every day
  • Pushes updates to a designated GitHub repository
  • Keeps version history for tracking changes
  • Maintains an organized folder structure for easy retrieval
  • Sends notifications for backup success or failure
  • Supports incremental backups to prevent duplication

🧩 Tools & Integrations

  • GitHub → Central repository for versioned backups
  • Automation Platforms → n8n, Make.com, Zapier, or cron jobs
  • Workflow Tools → Scripts, task automation tools, or server-side processes
  • Notification Tools → Email, Slack, Microsoft Teams
  • Optional AI Assistance → Check for missing files or inconsistencies before backup

⚙️ How It Works

1️⃣ Define Backup Scope

  • Identify which workflows, scripts, or configuration files need daily backup
  • Include folders, project directories, or automation pipelines

2️⃣ Schedule Automated Backup

  • Use cron jobs or automation platforms to trigger backups daily at a set time
  • Ensure backups occur consistently without manual action

3️⃣ Commit & Push to GitHub

  • Automatically commit any updated files to the repository
  • Push commits to the main or designated branch
  • Optional: Add date-stamped tags for easy version tracking

Example Workflow:

  • Workflow changes detected → Commit updates → Push to GitHub → Notify team via Slack

4️⃣ Logging & Notifications

  • Maintain a log of backups with timestamps and file counts
  • Receive real-time alerts for success, failure, or errors
  • Integrate with dashboards to visualize backup history

📦 Optional Enhancements

  • Multi-environment backups → Development, staging, and production
  • Encrypted backups → Secure sensitive workflow data
  • Automated rollback → Restore previous workflow version if needed
  • Backup validation → Verify file integrity and completeness
  • Dashboard integration → Monitor backup status in real time

🎯 Benefits

  • Protects workflows and scripts from data loss
  • Reduces manual backup effort and errors
  • Maintains version control and historical tracking
  • Supports team collaboration with a centralized repository
  • Ensures consistent and reliable backups daily
  • Scales efficiently for multiple workflows and teams

There’s nothing you
can’t automate with n8n

Our customer’s words, not ours.
Skeptical? Try it out, and see for yourself.

Use template

{ "nodes": [ { "id": "2aafc10f-0bb7-419f-a6b3-fa90f5f68653", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 100, -20 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.2 }, { "id": "da87b4f8-4507-456b-bfc3-3ae7d9400449", "name": "Retrieve workflows", "type": "n8n-nodes-base.n8n", "position": [ 580, -20 ], "parameters": { "filters": {}, "requestOptions": {} }, "typeVersion": 1 }, { "id": "6cd7d968-6fa0-4ab0-ac58-ceb15c8b7b4a", "name": "Aggregate", "type": "n8n-nodes-base.aggregate", "position": [ 420, -20 ], "parameters": { "options": {}, "fieldsToAggregate": { "fieldToAggregate": [ { "fieldToAggregate": "name" } ] } }, "typeVersion": 1 }, { "id": "854f6e82-babb-474e-a138-2a6c398fd60e", "name": "List files from repo", "type": "n8n-nodes-base.github", "position": [ 260, -20 ], "webhookId": "354d699e-44b0-4444-9d31-af7fd4ff5561", "parameters": { "owner": { "__rl": true, "mode": "name", "value": "" }, "filePath": "=", "resource": "file", "operation": "list", "repository": { "__rl": true, "mode": "list", "value": "" }, "authentication": "oAuth2" }, "typeVersion": 1, "alwaysOutputData": true }, { "id": "8abba016-1f34-420a-b10b-3c8e44297725", "name": "Update file", "type": "n8n-nodes-base.github", "position": [ 1380, -100 ], "webhookId": "27218087-8df7-474d-a39f-70cfa9c34ec8", "parameters": { "owner": { "__rl": true, "mode": "name", "value": "" }, "filePath": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json", "resource": "file", "operation": "edit", "repository": { "__rl": true, "mode": "list", "value": "" }, "fileContent": "={{ $('To base64').item.json.data }}", "commitMessage": "=backup-{{ $('Commit date & file name').item.json.commitDate }}", "authentication": "oAuth2" }, "typeVersion": 1 }, { "id": "d55efcc7-5873-4c9a-b374-b7b31814905b", "name": "Upload file", "type": "n8n-nodes-base.github", "position": [ 1380, 60 ], "webhookId": "ce4b561b-acb9-4cd8-b76f-4928dada9674", "parameters": { "owner": { "__rl": true, "mode": "name", "value": "" }, "filePath": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json", "resource": "file", "repository": { "__rl": true, "mode": "list", "value": "" }, "fileContent": "={{ $('To base64').item.json.data }}", "commitMessage": "=backup-{{ $node['Commit date & file name'].json.commitDate }}", "authentication": "oAuth2" }, "typeVersion": 1 }, { "id": "09909c9f-8a68-4670-8396-65fae9be51ff", "name": "Check if file exists", "type": "n8n-nodes-base.if", "position": [ 1220, -20 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $('Aggregate').item.json.name }}", "value2": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json", "operation": "contains" } ] } }, "typeVersion": 1 }, { "id": "43990124-eac4-4c57-9da3-39053d9e5850", "name": "Json file", "type": "n8n-nodes-base.convertToFile", "position": [ 740, -20 ], "parameters": { "mode": "each", "options": { "format": true }, "operation": "toJson" }, "typeVersion": 1.1 }, { "id": "956de457-4d05-4ea8-be7b-390861a739d4", "name": "To base64", "type": "n8n-nodes-base.extractFromFile", "position": [ 900, -20 ], "parameters": { "options": {}, "operation": "binaryToPropery" }, "typeVersion": 1 }, { "id": "fc258985-2621-42a3-9bc6-01048a92b702", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 240, -160 ], "parameters": { "color": 5, "width": 300, "height": 380, "content": "### Retrieve previous file names from Github" }, "typeVersion": 1 }, { "id": "1bfedd8f-1921-4f33-aa45-7ab612f26059", "name": "Commit date & file name", "type": "n8n-nodes-base.set", "position": [ 1060, -20 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "fe4a36ef-9f04-40e3-99bd-cc517a49b440", "name": "commitDate", "type": "string", "value": "={{ $now.format('dd-MM-yyyy/H:mm') }}" }, { "id": "b0fe1bcc-e79c-4a6b-b8b4-44222c8bf4e8", "name": "fileName", "type": "string", "value": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json" } ] } }, "typeVersion": 3.4 }, { "id": "2f36af66-12ca-451a-a1ca-c5a71b94b644", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 560, -160 ], "parameters": { "color": 3, "width": 460, "height": 380, "content": "### Retrieve and process workflows from n8n" }, "typeVersion": 1 }, { "id": "dc914f31-e6b5-43b0-8a4e-f9f46118fa30", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1040, -160 ], "parameters": { "color": 4, "width": 460, "height": 380, "content": "### Commit + edit/create files if needed" }, "typeVersion": 1 } ], "connections": { "Aggregate": { "main": [ [ { "node": "Retrieve workflows", "type": "main", "index": 0 } ] ] }, "Json file": { "main": [ [ { "node": "To base64", "type": "main", "index": 0 } ] ] }, "To base64": { "main": [ [ { "node": "Commit date & file name", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "List files from repo", "type": "main", "index": 0 } ] ] }, "Retrieve workflows": { "main": [ [ { "node": "Json file", "type": "main", "index": 0 } ] ] }, "Check if file exists": { "main": [ [ { "node": "Update file", "type": "main", "index": 0 } ], [ { "node": "Upload file", "type": "main", "index": 0 } ] ] }, "List files from repo": { "main": [ [ { "node": "Aggregate", "type": "main", "index": 0 } ] ] }, "Commit date & file name": { "main": [ [ { "node": "Check if file exists", "type": "main", "index": 0 } ] ] } } }

				
					{
  "nodes": [
    {
      "id": "2aafc10f-0bb7-419f-a6b3-fa90f5f68653",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        100,
        -20
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "da87b4f8-4507-456b-bfc3-3ae7d9400449",
      "name": "Retrieve workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        580,
        -20
      ],
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "6cd7d968-6fa0-4ab0-ac58-ceb15c8b7b4a",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        420,
        -20
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "name"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "854f6e82-babb-474e-a138-2a6c398fd60e",
      "name": "List files from repo",
      "type": "n8n-nodes-base.github",
      "position": [
        260,
        -20
      ],
      "webhookId": "354d699e-44b0-4444-9d31-af7fd4ff5561",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": ""
        },
        "filePath": "=",
        "resource": "file",
        "operation": "list",
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "authentication": "oAuth2"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "8abba016-1f34-420a-b10b-3c8e44297725",
      "name": "Update file",
      "type": "n8n-nodes-base.github",
      "position": [
        1380,
        -100
      ],
      "webhookId": "27218087-8df7-474d-a39f-70cfa9c34ec8",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": ""
        },
        "filePath": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json",
        "resource": "file",
        "operation": "edit",
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "fileContent": "={{ $('To base64').item.json.data }}",
        "commitMessage": "=backup-{{ $('Commit date & file name').item.json.commitDate }}",
        "authentication": "oAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "d55efcc7-5873-4c9a-b374-b7b31814905b",
      "name": "Upload file",
      "type": "n8n-nodes-base.github",
      "position": [
        1380,
        60
      ],
      "webhookId": "ce4b561b-acb9-4cd8-b76f-4928dada9674",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": ""
        },
        "filePath": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json",
        "resource": "file",
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "fileContent": "={{ $('To base64').item.json.data }}",
        "commitMessage": "=backup-{{ $node['Commit date & file name'].json.commitDate }}",
        "authentication": "oAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "09909c9f-8a68-4670-8396-65fae9be51ff",
      "name": "Check if file exists",
      "type": "n8n-nodes-base.if",
      "position": [
        1220,
        -20
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $('Aggregate').item.json.name }}",
              "value2": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json",
              "operation": "contains"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "43990124-eac4-4c57-9da3-39053d9e5850",
      "name": "Json file",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        740,
        -20
      ],
      "parameters": {
        "mode": "each",
        "options": {
          "format": true
        },
        "operation": "toJson"
      },
      "typeVersion": 1.1
    },
    {
      "id": "956de457-4d05-4ea8-be7b-390861a739d4",
      "name": "To base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        900,
        -20
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "fc258985-2621-42a3-9bc6-01048a92b702",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -160
      ],
      "parameters": {
        "color": 5,
        "width": 300,
        "height": 380,
        "content": "### Retrieve previous file names from Github"
      },
      "typeVersion": 1
    },
    {
      "id": "1bfedd8f-1921-4f33-aa45-7ab612f26059",
      "name": "Commit date & file name",
      "type": "n8n-nodes-base.set",
      "position": [
        1060,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fe4a36ef-9f04-40e3-99bd-cc517a49b440",
              "name": "commitDate",
              "type": "string",
              "value": "={{ $now.format('dd-MM-yyyy/H:mm') }}"
            },
            {
              "id": "b0fe1bcc-e79c-4a6b-b8b4-44222c8bf4e8",
              "name": "fileName",
              "type": "string",
              "value": "={{ $('Retrieve workflows').item.json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $('Retrieve workflows').item.json.tags[0].name }}.json"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2f36af66-12ca-451a-a1ca-c5a71b94b644",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 460,
        "height": 380,
        "content": "### Retrieve and process workflows from n8n"
      },
      "typeVersion": 1
    },
    {
      "id": "dc914f31-e6b5-43b0-8a4e-f9f46118fa30",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 380,
        "content": "### Commit + edit/create files if needed"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Retrieve workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Json file": {
      "main": [
        [
          {
            "node": "To base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "To base64": {
      "main": [
        [
          {
            "node": "Commit date & file name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "List files from repo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve workflows": {
      "main": [
        [
          {
            "node": "Json file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if file exists": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List files from repo": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Commit date & file name": {
      "main": [
        [
          {
            "node": "Check if file exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}