The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"parameters": {},
"id": "940ee3a3-ca29-4061-bda9-b5eb67d05ec6",
"name": "Execute workflow",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
208,
288
]
},
{
"parameters": {
"options": {}
},
"id": "8cdaa191-9e39-49fa-be52-6933e57bf134",
"name": "Set date",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 2,
"position": [
400,
288
]
},
{
"parameters": {
"operation": "formatDate",
"date": "={{ $json.currentDate }}",
"format": "custom",
"customFormat": "dd-MM-yyyy/H:mm",
"options": {}
},
"id": "4ec36b31-6574-4407-a0b5-265b5bb0a3a5",
"name": "Format date",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 2,
"position": [
608,
288
]
},
{
"parameters": {
"content": "## Trigger\nYou can change it to [\"Schedule\" trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/) to make backups on regular basis.",
"height": 339.51767272727324,
"width": 182.4715262478496
},
"id": "894f9417-532e-4aa7-892a-acc2885e003d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
160,
128
]
},
{
"parameters": {
"content": "## Set and format date/time\nThose nodes are responsible for setting a current date and time in format `dd-MM-yyyy/H:mm`. Date and time are used to compose commit messages in GitHub, for example: `backup-12-07-2023/14:18`.",
"height": 339.42690909090965,
"width": 585.4045090909088
},
"id": "02b9cc7d-75ab-4327-8522-d984b6f6d349",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
368,
128
]
},
{
"parameters": {
"content": "## Make a list of existing files\nReturn a list of existing files (backups) in GitHub repository. Data returned by those nodes is used by \"IF\" node (later in workflow) to check whether the backup files should be created or updated.",
"height": 339.42690909090965,
"width": 389.89265454545443
},
"id": "7ec64156-5ee2-4d86-a4bf-d1dafc2548a3",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1424,
368
]
},
{
"parameters": {
"content": "## Retrieve workflows\nGet all workflows form your n8n instance. Remember that **your credentials need to point to the instance that you want to backup.**\n\n\u26a0\ufe0f **Config n8n node whether only published workflows should be returned.**",
"height": 355,
"width": 384
},
"id": "3fd56acf-3c55-4ede-aa0c-68c197258593",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1888,
16
]
},
{
"parameters": {
"content": "## Upload backup\nCheck if workflows were uploaded to repository before. If yes (true), upload the new version of the file. Otherwise (false) create the file in repository.",
"height": 572,
"width": 704
},
"id": "14d01243-ab11-4741-a253-c810fe16cb78",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
2288,
-64
]
},
{
"parameters": {
"content": "## \u26a0\ufe0f Note\n\n1. Complete video guide for this workflow is available [on my YouTube](https://www.youtube.com/watch?v=dNuVuoPD0Jo). \n2. Remember to add your credentials and configure GitHub nodes (covered in the video guide).\n3. If you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows) and/or [my newsletter](https://workfloows.com/).",
"height": 219,
"width": 381
},
"id": "510a3a5d-9acb-4dbb-88c5-438b5f497bd9",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
160,
-112
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "9d771254-ea55-45c9-b02b-ddac2c157278",
"name": "commitDate",
"value": "={{ $json.formattedDate }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
816,
288
],
"id": "c3034c54-b76b-458d-8c48-5f69fd4e2549",
"name": "Set commit date"
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"operation": "list",
"owner": {
"__rl": true,
"value": "workfloows",
"mode": "list",
"cachedResultName": "workfloows",
"cachedResultUrl": "https://github.com/workfloows"
},
"repository": {
"__rl": true,
"value": "n8n-local-backup",
"mode": "list",
"cachedResultName": "n8n-local-backup",
"cachedResultUrl": "https://github.com/workfloows/n8n-local-backup"
}
},
"type": "n8n-nodes-base.github",
"typeVersion": 1.1,
"position": [
1040,
288
],
"id": "74b0983b-3b1c-430e-8062-dc6be462e14e",
"name": "Get repository",
"alwaysOutputData": true,
"credentials": {
"githubOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "898e0cf9-dff9-4376-be4f-eed4fa1feb99",
"leftValue": "={{ $input.item.json }}",
"rightValue": 0,
"operator": {
"type": "object",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
1232,
288
],
"id": "2dc2d4db-c382-40c5-b5fc-93e1d4ae9b4f",
"name": "Check if repo empty"
},
{
"parameters": {
"filters": {
"activeWorkflows": true
},
"requestOptions": {}
},
"id": "9a4bd12b-2885-427b-a9ba-e072e6779c66",
"name": "Retrieve workflows",
"type": "n8n-nodes-base.n8n",
"typeVersion": 1,
"position": [
1936,
208
],
"credentials": {
"n8nApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "toJson",
"mode": "each",
"options": {
"fileName": "={{ $json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $json.id }}.json"
}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
2112,
208
],
"id": "6c32d198-ca6d-4283-aead-89951cb62c1c",
"name": "Convert to file"
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"operation": "list",
"owner": {
"__rl": true,
"value": "workfloows",
"mode": "list",
"cachedResultName": "workfloows",
"cachedResultUrl": "https://github.com/workfloows"
},
"repository": {
"__rl": true,
"value": "n8n-local-backup",
"mode": "list"
}
},
"type": "n8n-nodes-base.github",
"typeVersion": 1.1,
"position": [
1472,
544
],
"id": "15d612c2-d868-403b-9dd4-35031a1ad952",
"name": "List files",
"alwaysOutputData": false,
"executeOnce": true,
"credentials": {
"githubOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "0a912bde-0a4a-4ad6-b379-6d1d639f49ca",
"leftValue": "={{\n $('Combine file names').isExecuted &&\n $('Combine file names').item.json.name.includes(\n $('Convert to file').item.binary.data.fileName\n )\n}}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
2528,
208
],
"id": "879e570a-84ca-4812-94c4-e7798f25fc80",
"name": "Check if file exists"
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"operation": "edit",
"owner": {
"__rl": true,
"value": "workfloows",
"mode": "list",
"cachedResultName": "workfloows",
"cachedResultUrl": "https://github.com/workfloows"
},
"repository": {
"__rl": true,
"value": "n8n-local-backup",
"mode": "list",
"cachedResultName": "n8n-local-backup",
"cachedResultUrl": "https://github.com/workfloows/n8n-local-backup"
},
"filePath": "={{ $('Convert to file').item.binary.data.fileName }}",
"fileContent": "={{ $json.data }}",
"commitMessage": "=backup-{{ $('Set commit date').item.json.commitDate }}"
},
"type": "n8n-nodes-base.github",
"typeVersion": 1.1,
"position": [
2768,
64
],
"id": "c04075d6-25a8-4959-af76-49123e0e6112",
"name": "Update a file",
"credentials": {
"githubOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"owner": {
"__rl": true,
"value": "workfloows",
"mode": "list",
"cachedResultName": "workfloows",
"cachedResultUrl": "https://github.com/workfloows"
},
"repository": {
"__rl": true,
"value": "n8n-local-backup",
"mode": "list",
"cachedResultName": "n8n-local-backup",
"cachedResultUrl": "https://github.com/workfloows/n8n-local-backup"
},
"filePath": "={{ $('Convert to file').item.binary.data.fileName }}",
"fileContent": "={{ $json.data }}",
"commitMessage": "=backup-{{ $('Set commit date').item.json.commitDate }}"
},
"type": "n8n-nodes-base.github",
"typeVersion": 1.1,
"position": [
2784,
336
],
"id": "624c9b07-f0e1-4bea-9823-aefb959f5d33",
"name": "Create a file",
"credentials": {
"githubOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "name"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1664,
544
],
"id": "82d290cb-5943-467c-8dd4-ea7f2fe1bc67",
"name": "Combine file names"
},
{
"parameters": {
"operation": "binaryToPropery",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1.1,
"position": [
2336,
208
],
"id": "80c77f1e-fb77-47b3-9807-00879f570128",
"name": "Move to base64"
},
{
"parameters": {
"content": "## Author\nIf you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows) and/or [my newsletter](https://workfloows.com/).\n\nFeel free to follow me also [on LinkedIn](https://www.linkedin.com/in/oskarkramarz/).\n\n**Thank you for your support!**\nOskar from [Workfloows](https://workfloows.com)",
"height": 272,
"width": 374,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-240,
-112
],
"id": "0ba54175-1008-4505-a934-8304074c9391",
"name": "Sticky Note6"
}
],
"connections": {
"Execute workflow": {
"main": [
[
{
"node": "Set date",
"type": "main",
"index": 0
}
]
]
},
"Set date": {
"main": [
[
{
"node": "Format date",
"type": "main",
"index": 0
}
]
]
},
"Format date": {
"main": [
[
{
"node": "Set commit date",
"type": "main",
"index": 0
}
]
]
},
"Set commit date": {
"main": [
[
{
"node": "Get repository",
"type": "main",
"index": 0
}
]
]
},
"Get repository": {
"main": [
[
{
"node": "Check if repo empty",
"type": "main",
"index": 0
}
],
[]
]
},
"Check if repo empty": {
"main": [
[
{
"node": "Retrieve workflows",
"type": "main",
"index": 0
}
],
[
{
"node": "List files",
"type": "main",
"index": 0
}
]
]
},
"Retrieve workflows": {
"main": [
[
{
"node": "Convert to file",
"type": "main",
"index": 0
}
]
]
},
"Convert to file": {
"main": [
[
{
"node": "Move to base64",
"type": "main",
"index": 0
}
]
]
},
"List files": {
"main": [
[
{
"node": "Combine file names",
"type": "main",
"index": 0
}
]
]
},
"Check if file exists": {
"main": [
[
{
"node": "Update a file",
"type": "main",
"index": 0
}
],
[
{
"node": "Create a file",
"type": "main",
"index": 0
}
]
]
},
"Combine file names": {
"main": [
[
{
"node": "Retrieve workflows",
"type": "main",
"index": 0
}
]
]
},
"Move to base64": {
"main": [
[
{
"node": "Check if file exists",
"type": "main",
"index": 0
}
]
]
}
},
"meta": {
"templateCredsSetupCompleted": true
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
discordWebhookApigithubOAuth2Apin8nApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
How this works
Regularly backing up your n8n workflows ensures you never lose critical automations due to errors or platform issues, providing peace of mind for teams relying on seamless operations. This workflow is ideal for n8n users managing multiple automations who want automated, version-controlled storage without manual effort. It kicks off with a scheduled cron trigger to fetch all workflows via the n8n integration, then formats dates and pushes JSON files to GitHub for secure, timestamped backups, incorporating item lists to handle files efficiently.
Use this workflow for daily or weekly automated backups in production environments where workflow integrity is paramount, especially if you're already using GitHub for version control. Avoid it for one-off exports or if your workflows contain sensitive data requiring encrypted storage beyond GitHub's defaults. Common variations include adding Discord notifications for backup completion or adjusting the cron schedule for more frequent runs during high-activity periods.
About this workflow
Backup n8n workflows. Uses dateTime, github, itemLists, n8n. Scheduled trigger; 20 nodes.
Source: https://github.com/SamVivan1/n8n-Workflows-Backup/blob/main/backup-n8n-workflows-g3FxqxmmnS7h1qU7.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Backup n8n workflows. Uses dateTime, github, itemLists, n8n. Scheduled trigger; 20 nodes.
A robust workflow to back up and synchronize your n8n workflows to a GitHub repository, with intelligent change detection and support for file renames.
This workflow will backup all of your existed workflows to a single Github repository.
Stop the panic attacks. We've all been there - accidentally deleted a workflow that took hours to build, or worse, corrupted your entire automation setup. This workflow is your safety net.
This workflow is ideal for n8n self-hosted users, DevOps engineers, and automation developers who want to automatically back up their n8n workflows to GitHub on a regular basis.