{ "name": "BackUp", "nodes": [ { "parameters": {}, "id": "9457727c-9934-4558-961c-56055afa4175", "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 480, 96 ], "typeVersion": 1 }, { "parameters": {}, "id": "e5598e7e-0878-4aa0-badf-1bd5aa581cfd", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ -80, 880 ], "typeVersion": 1 }, { "parameters": { "url": "={{ $json.download_url }}", "options": {} }, "id": "c8773b0b-7fe0-4137-ae74-cf8948bc7148", "name": "Get File", "type": "n8n-nodes-base.httpRequest", "position": [ 688, 544 ], "typeVersion": 4.2 }, { "parameters": { "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "45ce825e-9fa6-430c-8931-9aaf22c42585", "operator": { "type": "string", "operation": "empty", "singleValue": true }, "leftValue": "={{ $json.content }}", "rightValue": "" }, { "id": "9619a55f-7fb1-4f24-b1a7-7aeb82365806", "operator": { "type": "string", "operation": "notExists", "singleValue": true }, "leftValue": "={{ $json.error }}", "rightValue": "" } ] }, "options": {} }, "id": "95e6f15e-584a-491e-91f8-cb6ec5560bc4", "name": "If file too large", "type": "n8n-nodes-base.if", "position": [ 448, 560 ], "typeVersion": 2 }, { "parameters": { "resource": "file", "owner": { "__rl": true, "value": "={{ $('Config1').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config1').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config1').item.json.repo_path }}{{ $json.subPath }}{{$('Execute Workflow Trigger').first().json.id}}.json", "fileContent": "={{$('isDiffOrNew1').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{$json.github_status}})" }, "id": "823dd86d-3ae7-44f5-9653-5766f2a36832", "name": "Create new file", "type": "n8n-nodes-base.github", "position": [ 1488, 1024 ], "typeVersion": 1, "webhookId": "124d821e-6a7e-46a4-ad2b-22508012fcfd", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "resource": "file", "operation": "edit", "owner": { "__rl": true, "value": "={{ $('Config1').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config1').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config1').item.json.repo_path }}{{ $json.subPath }}{{$('Execute Workflow Trigger').first().json.id}}.json", "fileContent": "={{$('isDiffOrNew1').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{$json.github_status}})" }, "id": "030762b8-3e53-497a-9690-87fdeb1a4b69", "name": "Edit existing file", "type": "n8n-nodes-base.github", "position": [ 1488, 832 ], "typeVersion": 1, "webhookId": "bb54fbfe-0833-4479-b05f-c9802615486b", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "rule": { "interval": [ { "triggerAtHour": 1, "triggerAtMinute": 33 } ] } }, "id": "e29b4746-16e7-4507-beba-a5fdbd9604e4", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 480, 288 ], "typeVersion": 1.2 }, { "parameters": { "assignments": { "assignments": [ { "id": "dae43d3b-56e5-4098-b602-862ebf5cd073", "name": "subPath", "type": "string", "value": "={{ $('Execute Workflow Trigger').first().json.createdAt.split('-')[0] }}/{{ $('Execute Workflow Trigger').first().json.createdAt.split('-')[1] }}/" } ] }, "includeOtherFields": true, "options": {} }, "id": "c032acea-dba0-44ba-aaa8-7b2c8c876c7c", "name": "Create sub path", "type": "n8n-nodes-base.set", "position": [ 848, 832 ], "typeVersion": 3.3 }, { "parameters": { "resource": "file", "operation": "get", "owner": { "__rl": true, "value": "={{ $('Config1').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config1').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config1').item.json.repo_path }}{{ $('Execute Workflow Trigger').first().json.createdAt.split('-')[0] }}/{{ $('Execute Workflow Trigger').first().json.createdAt.split('-')[1] }}/{{$json.id}}.json", "asBinaryProperty": false, "additionalParameters": {} }, "id": "9fb3bca9-081f-4ca3-8168-9dd9ca45e9c8", "name": "Get file data", "type": "n8n-nodes-base.github", "position": [ 240, 560 ], "typeVersion": 1, "alwaysOutputData": true, "webhookId": "cbea2447-0ad3-459c-8d08-43639bd02fa1", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } }, "continueOnFail": true }, { "parameters": { "content": "## Subworkflow", "height": 732, "width": 2039, "color": 6 }, "id": "178cdd09-6a25-4814-a543-eb6ae4055775", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ -128, 464 ], "typeVersion": 1 }, { "parameters": {}, "id": "9882deb0-8af7-469d-9417-f79404db80ba", "name": "Merge Items1", "type": "n8n-nodes-base.merge", "position": [ 448, 832 ], "typeVersion": 2 }, { "parameters": { "jsCode": "const orderJsonKeys = (jsonObj) => {\n const ordered = {};\n Object.keys(jsonObj).sort().forEach(key => {\n ordered[key] = jsonObj[key];\n });\n return ordered;\n}\n\n// Check if file returned with content\nif (Object.keys($input.all()[0].json).includes(\"content\")) {\n // Decode base64 content and parse JSON\n const origWorkflow = JSON.parse(Buffer.from($input.all()[0].json.content, 'base64').toString());\n const n8nWorkflow = $input.all()[1].json;\n \n // Order JSON objects\n const orderedOriginal = orderJsonKeys(origWorkflow);\n const orderedActual = orderJsonKeys(n8nWorkflow);\n\n // Determine difference\n if (JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual)) {\n $input.all()[0].json.github_status = \"same\";\n } else {\n $input.all()[0].json.github_status = \"different\";\n $input.all()[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n }\n $input.all()[0].json.content_decoded = orderedOriginal;\n// No file returned / new workflow\n} else if (Object.keys($input.all()[0].json).includes(\"data\")) {\n const origWorkflow = JSON.parse($input.all()[0].json.data);\n const n8nWorkflow = $input.all()[1].json;\n \n // Order JSON objects\n const orderedOriginal = orderJsonKeys(origWorkflow);\n const orderedActual = orderJsonKeys(n8nWorkflow);\n\n // Determine difference\n if (JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual)) {\n $input.all()[0].json.github_status = \"same\";\n } else {\n $input.all()[0].json.github_status = \"different\";\n $input.all()[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n }\n $input.all()[0].json.content_decoded = orderedOriginal;\n\n} else {\n // Order JSON object\n const n8nWorkflow = $input.all()[1].json;\n const orderedActual = orderJsonKeys(n8nWorkflow);\n \n // Proper formatting\n $input.all()[0].json.github_status = \"new\";\n $input.all()[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n}\n\n// Return items\nreturn $input.all();\n" }, "id": "84144b9e-7da9-4f35-a471-a7eb8ac53e98", "name": "isDiffOrNew1", "type": "n8n-nodes-base.code", "position": [ 640, 832 ], "typeVersion": 1 }, { "parameters": { "dataType": "string", "value1": "={{$json.github_status}}", "rules": { "rules": [ { "value2": "same" }, { "value2": "different", "output": 1 }, { "value2": "new", "output": 2 } ] } }, "id": "750e5445-6f9f-421d-b032-1949f62cf375", "name": "Check Status1", "type": "n8n-nodes-base.switch", "position": [ 1040, 832 ], "typeVersion": 1 }, { "parameters": {}, "id": "4fa38704-2059-4635-bb61-d18edf6a8589", "name": "Same file - Do nothing1", "type": "n8n-nodes-base.noOp", "position": [ 1264, 672 ], "typeVersion": 1 }, { "parameters": {}, "id": "51b0b898-65c4-4591-a8f2-7b710a48c2bc", "name": "File is different1", "type": "n8n-nodes-base.noOp", "position": [ 1264, 832 ], "typeVersion": 1 }, { "parameters": {}, "id": "7bab4157-3d02-4d34-8b65-7f985808cf56", "name": "File is new1", "type": "n8n-nodes-base.noOp", "position": [ 1264, 1024 ], "typeVersion": 1 }, { "parameters": { "options": {} }, "id": "68dfe531-a548-461a-b281-cce25569ed39", "name": "Loop Over Items1", "type": "n8n-nodes-base.splitInBatches", "position": [ 1296, 160 ], "typeVersion": 3 }, { "parameters": { "content": "## Backup to GitHub \nThis workflow will backup all instance workflows to GitHub every 24 hours.\n\nThe files are saved into folders using `YYYY/MM/` for the directory path and `ID.json` for the filename.\n\nThe Repo Owner, Repo Name and Main folder are set using the **Variables** feature but can be replaced with the `Config` node in the subworkflow. \n\nThe workflow runs calls itself to help reduce memory usage, Once the workflow has completed it will send an optional notification to Slack.\n\n### Time to Run\nTested with 1423 workflows on `1.44.1` it took under 30 minutes for the first run and under 12 minutes once the initial run is complete.", "height": 417, "width": 513, "color": 4 }, "id": "8d6ce308-1c4b-41f4-84be-a62865995beb", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -128, 0 ], "typeVersion": 1 }, { "parameters": { "content": "## Main workflow loop", "height": 416, "width": 1465, "color": 7 }, "id": "a681d7c1-d939-4524-b934-1ba038d5a608", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 448, 0 ], "typeVersion": 1 }, { "parameters": { "workflowId": "={{ $workflow.id }}", "mode": "each", "options": {} }, "id": "a75d4fb7-e420-42e9-a2c2-911fa88a0b70", "name": "Execute Workflow1", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1504, 176 ], "typeVersion": 1, "onError": "continueErrorOutput" }, { "parameters": { "assignments": { "assignments": [ { "id": "8f6d1741-772f-462a-811f-4c334185e4f0", "name": "repo_owner", "type": "string", "value": "=" }, { "id": "8cac215c-4fd7-422f-9fd2-6b2d1e5e0383", "name": "repo_name", "type": "string", "value": "=" }, { "id": "eee305e9-4164-462a-86bd-80f0d58a31ae", "name": "repo_path", "type": "string", "value": "=" } ] }, "includeOtherFields": true, "options": {} }, "id": "06e32623-9ca7-4c77-b7c0-d614b30b6c73", "name": "Config1", "type": "n8n-nodes-base.set", "position": [ 208, 848 ], "typeVersion": 3.4 }, { "parameters": { "filters": {}, "requestOptions": {} }, "id": "1fd82f91-c152-44d8-a71a-35ca2f441a93", "name": "Get many workflows", "type": "n8n-nodes-base.n8n", "position": [ 832, 160 ], "typeVersion": 1, "alwaysOutputData": false, "credentials": { "n8nApi": { "id": "ciSQOiKSg5yW3ch1", "name": "n8n account" } } }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "faa8b2c4-15f4-4778-92f3-ff1ac5242963", "leftValue": "={{ $json.isArchived }}", "rightValue": false, "operator": { "type": "boolean", "operation": "equals" } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.filter", "typeVersion": 2.3, "position": [ 1040, 160 ], "id": "0876e86a-42de-4fae-80cc-ed164c43d9bc", "name": "Filter" }, { "parameters": { "assignments": { "assignments": [ { "id": "8d513345-6484-431f-afb7-7cf045c90f4f", "name": "Done", "type": "boolean", "value": true } ] }, "options": {} }, "id": "fcc7aff3-1e52-4f27-a336-42a0e0228fba", "name": "Return", "type": "n8n-nodes-base.set", "position": [ 1728, 672 ], "typeVersion": 3.3 } ], "pinData": { "On clicking 'execute'": [ { "json": {} } ], "Execute Workflow Trigger": [ { "json": { "updatedAt": "2026-01-20T17:43:54.396Z", "createdAt": "2026-01-20T16:40:47.616Z", "id": "EYU0lsW4Q8mqcGEt0WdAP", "name": "BackUp bis", "active": true, "isArchived": false, "nodes": [ { "parameters": {}, "id": "17c0d46b-e236-4284-a8c3-9d09ac6dfdff", "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 480, 80 ], "typeVersion": 1 }, { "parameters": { "content": "## Subworkflow", "height": 828, "width": 1911, "color": 6 }, "id": "f8a637bf-d506-4464-89c5-ee6fb6904b34", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 464 ], "typeVersion": 1 }, { "parameters": {}, "id": "023fcc88-4437-404b-b7ff-cdad049f9b4f", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 64, 880 ], "typeVersion": 1 }, { "parameters": { "assignments": { "assignments": [ { "id": "8d513345-6484-431f-afb7-7cf045c90f4f", "name": "Done", "type": "boolean", "value": true } ] }, "options": {} }, "id": "b2802a84-5f26-4df7-a3e6-433a949d517b", "name": "Return", "type": "n8n-nodes-base.set", "position": [ 1728, 672 ], "typeVersion": 3.3 }, { "parameters": { "jsCode": "const orderJsonKeys = (jsonObj) => {\n const ordered = {};\n Object.keys(jsonObj).sort().forEach(key => {\n ordered[key] = jsonObj[key];\n });\n return ordered;\n}\n\nconst n8nWorkflowLastUpdate = $('Execute Workflow Trigger').first().json.updatedAt;\n\nif ($('Get backup workflow').first().json && !$('Get backup workflow').first().json.error) {\n // Get gitLabworkflow\n const contentJSON = $('Get backup workflow').first().json;\n\n const gitLabWorkFlowLastUpdate = contentJSON.updatedAt;\n \n if ( gitLabWorkFlowLastUpdate === n8nWorkflowLastUpdate) {\n $input.all()[0].json.gitlab_status = \"same\";\n } else {\n // there is an update\n $input.all()[0].json.gitlab_status = \"update\";\n }\n} else {\n // Create new file on gitlab\n $input.all()[0].json.gitlab_status = \"new\";\n}\n\n// add last update date\n$('Execute Workflow Trigger').first().json.lastUpdate = n8nWorkflowLastUpdate;\n\n// create object for gitlab backup\nconst n8nAllWorkflowUpdated = $('Execute Workflow Trigger').first().json;\nconst final = orderJsonKeys(n8nAllWorkflowUpdated);\n$input.all()[0].json.n8n_data_stringy = JSON.stringify(final, null, 2);\n\n// Return items\nreturn $input.all();\n" }, "id": "4eb7389b-e888-4dcc-bf61-7db7c73e9920", "name": "isDiffOrNew", "type": "n8n-nodes-base.code", "position": [ 672, 880 ], "typeVersion": 1, "executeOnce": false }, { "parameters": { "dataType": "string", "value1": "={{ $json.gitlab_status }}", "rules": { "rules": [ { "value2": "same" }, { "value2": "update", "output": 1 }, { "value2": "new", "output": 2 } ] } }, "id": "77f76a7e-f188-4bef-b214-e89dbcafca4e", "name": "Check Status", "type": "n8n-nodes-base.switch", "position": [ 1040, 848 ], "typeVersion": 1 }, { "parameters": {}, "id": "4bdd0d76-175c-4b45-b3b3-f0d11ac5de39", "name": "Same file - Do nothing", "type": "n8n-nodes-base.noOp", "position": [ 1264, 672 ], "typeVersion": 1 }, { "parameters": {}, "id": "a9879c05-8413-43bc-8414-be8748fbe4ef", "name": "File is different", "type": "n8n-nodes-base.noOp", "position": [ 1264, 848 ], "typeVersion": 1 }, { "parameters": {}, "id": "c5610ee0-c35f-4a9f-a607-cabfaf4bfe66", "name": "File is new", "type": "n8n-nodes-base.noOp", "position": [ 1264, 1040 ], "typeVersion": 1 }, { "parameters": { "options": {} }, "id": "5570c18f-c0b7-42cd-b7d0-d1f2bccdf878", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ 1008, 192 ], "typeVersion": 3 }, { "parameters": { "content": "## Backup to GitLab /OPS/n8n/n8n_backup\nThis workflow will backup all instance workflows to GitLab every 24 hours.\n\nThe files are saved into folders directory path and `ID.json` for the filename.\n\nThe Repo Owner, Repo Name and Main folder are set using the **Variables** feature but can be replaced with the `Config` node in the subworkflow. \n\nThe workflow runs calls itself to help reduce memory usage, Once the workflow has completed it will send an optional notification to Slack.\n\ntest", "height": 417, "width": 385, "color": 4 }, "id": "56242465-15d4-40af-b63f-5b804b32a4c7", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 0 ], "typeVersion": 1 }, { "parameters": { "content": "## Main workflow loop", "height": 448, "width": 1497, "color": 7 }, "id": "f2582589-f187-42f1-8df1-d2f62d5f7b96", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 416, 0 ], "typeVersion": 1 }, { "parameters": { "workflowId": "={{ $workflow.id }}", "mode": "each", "options": {} }, "id": "89155bb4-a958-4eea-955b-bae0dfc14dc4", "name": "Execute Workflow", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1488, 208 ], "typeVersion": 1, "onError": "continueErrorOutput" }, { "parameters": { "assignments": { "assignments": [ { "id": "8f6d1741-772f-462a-811f-4c334185e4f0", "name": "repo_owner", "type": "string", "value": "ttresse" }, { "id": "8cac215c-4fd7-422f-9fd2-6b2d1e5e0383", "name": "repo_name", "type": "string", "value": "=n8n-backup" }, { "id": "eee305e9-4164-462a-86bd-80f0d58a31ae", "name": "repo_path", "type": "string", "value": "=vps" } ] }, "includeOtherFields": true, "options": {} }, "id": "685c94e7-ffc4-47d1-89bd-2986dcc93db0", "name": "Config", "type": "n8n-nodes-base.set", "position": [ 256, 880 ], "typeVersion": 3.4 }, { "parameters": { "rule": { "interval": [ { "triggerAtHour": 3 } ] } }, "id": "eb37d716-5500-47ba-8ec6-ba7df9f63caf", "name": "Schedule Trigger1", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 480, 288 ], "typeVersion": 1.2 }, { "parameters": { "filters": {}, "requestOptions": {} }, "id": "46ee73a8-a4bd-43fa-bb4c-75ccd8c6a8c9", "name": "Get many workflows", "type": "n8n-nodes-base.n8n", "position": [ 784, 192 ], "typeVersion": 1, "alwaysOutputData": false, "credentials": { "n8nApi": { "id": "ciSQOiKSg5yW3ch1", "name": "n8n account" } } }, { "parameters": { "resource": "file", "operation": "edit", "owner": { "__rl": true, "value": "={{ $('Config').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $('Execute Workflow Trigger').item.json.id }}.json", "fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{ $('isDiffOrNew').item.json.gitlab_status }})" }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 1456, 848 ], "id": "cc00c06e-280f-43f5-a8f0-dd2ab122d2b4", "name": "Edit file", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "resource": "file", "owner": { "__rl": true, "value": "={{ $('Config').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $('Execute Workflow Trigger').item.json.id }}.json", "fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{ $json.gitlab_status }})" }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 1520, 1024 ], "id": "ce5ccc86-118b-43f9-9fda-8153cc4f748d", "name": "Create file", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "resource": "file", "operation": "get", "owner": { "__rl": true, "value": "={{ $json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $json.id }}.json", "additionalParameters": {} }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 496, 880 ], "id": "356749c0-a305-413a-a867-75bd007ed65a", "name": "Get backup workflow", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "alwaysOutputData": false, "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } }, "onError": "continueRegularOutput" } ], "connections": { "Config": { "main": [ [ { "node": "Get backup workflow", "type": "main", "index": 0 } ] ] }, "File is new": { "main": [ [ { "node": "Create file", "type": "main", "index": 0 } ] ] }, "isDiffOrNew": { "main": [ [ { "node": "Check Status", "type": "main", "index": 0 } ] ] }, "Check Status": { "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 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "Execute Workflow", "type": "main", "index": 0 } ] ] }, "Execute Workflow": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ], [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "File is different": { "main": [ [ { "node": "Edit file", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Get many workflows", "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 } ] ] }, "Schedule Trigger1": { "main": [ [ { "node": "Get many workflows", "type": "main", "index": 0 } ] ] }, "Get many workflows": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Edit file": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "Create file": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "Get backup workflow": { "main": [ [ { "node": "isDiffOrNew", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "availableInMCP": false, "timeSavedMode": "fixed", "callerPolicy": "workflowsFromSameOwner" }, "staticData": null, "meta": { "templateCredsSetupCompleted": true }, "pinData": { "Schedule Trigger1": [ { "json": { "timestamp": "2025-11-24T16:40:32.125+01:00", "Readable date": "November 24th 2025, 4:40:32 pm", "Readable time": "4:40:32 pm", "Day of week": "Monday", "Year": "2025", "Month": "November", "Day of month": "24", "Hour": "16", "Minute": "40", "Second": "32", "Timezone": "Europe/Paris (UTC+01:00)" } } ], "On clicking 'execute'": [ { "json": {} } ], "Execute Workflow Trigger": [ { "json": { "updatedAt": "2026-01-19T12:47:40.782Z", "createdAt": "2026-01-16T17:30:59.676Z", "id": "zDTbKSoE6wozjyghd5LNg", "name": "Post X with BTC metrics", "active": true, "isArchived": false, "nodes": [ { "parameters": { "httpMethod": "POST", "path": "btc-daily-post", "options": {} }, "type": "n8n-nodes-base.webhook", "typeVersion": 2.1, "position": [ -256, 0 ], "id": "fcf6dd4b-84b6-40ef-bddd-15fb3ab29ca2", "name": "Webhook", "webhookId": "756efa11-af59-4f66-8cbe-2156f25807a6" }, { "parameters": { "text": "={{ $('Webhook').item.json.body['##datetime##'] }} | #Bitcoin ${{ $('Webhook').item.json.body['##btc_price_now##'] }}\n\n7d: ${{ $('Webhook').item.json.body['##btc_7d_ago##'] }} | 1m: ${{ $('Webhook').item.json.body['##btc_1m_ago##'] }} | 1y: ${{ $('Webhook').item.json.body['##btc_1y_ago##'] }} | {{ $('Webhook').item.json.body['##btc_percent_ath##'] }}% from ATH\nFear & Greed: {{ $('Webhook').item.json.body['##fg##'] }} ({{ $('Webhook').item.json.body['##fg_sentiment##'] }})\nMarket cap: ${{ $('Webhook').item.json.body['##total_marketcap##'] }}T ({{ $('Webhook').item.json.body['##marketcap_diff##'] }}%)\nDominance: {{ $('Webhook').item.json.body['##first_dom##'] }} {{ $('Webhook').item.json.body['##first_dominance##'] }}% | {{ $('Webhook').item.json.body['##second_dom##'] }} {{ $('Webhook').item.json.body['##second_dominance##'] }}% | {{ $('Webhook').item.json.body['##third_dom##'] }} {{ $('Webhook').item.json.body['##third_dominance##'] }}%", "additionalFields": {} }, "type": "n8n-nodes-base.twitter", "typeVersion": 2, "position": [ 240, -16 ], "id": "b6b87647-2ce3-4ee3-916e-b2a1ade6ccb1", "name": "Create Tweet", "credentials": { "twitterOAuth2Api": { "id": "p2idWRCUmM99PcpT", "name": "X account" } } }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "392ec53b-48e8-4398-a6d7-178d45631a7a", "leftValue": "={{ $json.body['##datetime##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "8d18fca5-5e37-47eb-8ff9-985483b34744", "leftValue": "={{ $json.body['##btc_price_now##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "270884d7-2b76-4cde-a2ec-7182612dc718", "leftValue": "={{ $json.body['##btc_percent_ath##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "85c23bb8-64e6-415b-8b78-9d32b0529a3f", "leftValue": "={{ $json.body['##fg##'] }}", "rightValue": 0, "operator": { "type": "number", "operation": "notEmpty", "singleValue": true } }, { "id": "704c1bce-4689-4d6c-8f39-1f1493ea1d84", "leftValue": "={{ $json.body['##fg_sentiment##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "5d466368-9f44-436b-8614-07bcb31de48c", "leftValue": "={{ $json.body['##marketcap_diff##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "2329edca-6257-4bb1-999c-84ace4efd6ae", "leftValue": "={{ $json.body['##total_marketcap##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "28a81f69-1a6a-4f34-92d1-3b4ef1b1d7ab", "leftValue": "={{ $json.body['##first_dom##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "72a3c193-e03b-4b5f-993f-ff4a1038545a", "leftValue": "={{ $json.body['##second_dom##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "0a8d6d00-3ef8-47f6-b838-b143b9a31c6e", "leftValue": "={{ $json.body['##first_dominance##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [ -32, 0 ], "id": "928da271-a596-468a-a863-fe8c3047afdb", "name": "If" } ], "connections": { "Webhook": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "Create Tweet", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "availableInMCP": false }, "staticData": null, "meta": { "templateCredsSetupCompleted": true }, "pinData": { "Webhook": [ { "json": { "headers": { "host": "n8n.vps.huygens.work", "user-agent": "axios/1.12.0", "content-length": "1133", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7", "accept-encoding": "gzip, compress, deflate, br", "content-type": "application/json", "x-forwarded-for": "37.65.176.223", "x-forwarded-host": "n8n.vps.huygens.work", "x-forwarded-port": "443", "x-forwarded-proto": "https", "x-forwarded-server": "6fc3eb539d68", "x-real-ip": "37.65.176.223" }, "params": {}, "query": {}, "body": { "##date##": "18 Jan. 26", "##datetime##": "18 Jan. 26 - 12:40 UTC", "##btc_price_now##": "95,214", "##btc_7d_ago##": "91,240", "##btc_1m_ago##": "88,217", "##btc_1y_ago##": "102,990", "##btc_percent_ath##": "-24", "##fg##": 49, "##fg_sentiment_color##": "#9ca3af", "##fg_sentiment##": "Neutral", "##fg_2d_ago_rot##": "0", "##fg_2d_ago_color##": "#9ca3af", "##fg_2d_ago##": "49", "##fg_7d_ago_rot##": "-45", "##fg_7d_ago_color##": "#00c46b", "##fg_7d_ago##": "29", "##fg_1m_ago_rot##": "-45", "##fg_1m_ago_color##": "#00c46b", "##fg_1m_ago##": "16", "##first_dom##": "BTC", "##second_dom##": "ETH", "##third_dom##": "USDT", "##fourth_dom##": "BNB", "##fifth_dom##": "XRP", "##sixth_dom##": "SOL", "##seventh_dom##": "USDC", "##eighth_dom##": "TRX", "##ninth_dom##": "STETH", "##tenth_dom##": "DOGE", "##first_dominance##": "57.34", "##second_dominance##": "12.14", "##third_dominance##": "5.64", "##fourth_dominance##": "3.9", "##fifth_dominance##": "3.76", "##sixth_dominance##": "2.42", "##seventh_dominance##": "2.29", "##eighth_dominance##": "0.91", "##ninth_dominance##": "0.9", "##tenth_dominance##": "0.69", "##total_marketcap##": "3,316", "##marketcap_diff##": "-0.26", "##marketcap_diff_color##": "#ff884d" }, "webhookUrl": "https://n8n.vps.huygens.work/webhook/btc-daily-post", "executionMode": "production" }, "pairedItem": { "item": 0 } } ] }, "versionId": "4f3636c3-9306-4547-a346-195104433a71", "activeVersionId": "4f3636c3-9306-4547-a346-195104433a71", "triggerCount": 1, "shared": [ { "updatedAt": "2026-01-16T17:30:59.683Z", "createdAt": "2026-01-16T17:30:59.683Z", "role": "workflow:owner", "workflowId": "zDTbKSoE6wozjyghd5LNg", "projectId": "cCEPBw2hpHqTYswB" } ], "activeVersion": { "updatedAt": "2026-01-18T18:33:01.000Z", "createdAt": "2026-01-18T18:32:43.335Z", "versionId": "4f3636c3-9306-4547-a346-195104433a71", "workflowId": "zDTbKSoE6wozjyghd5LNg", "nodes": [ { "parameters": { "httpMethod": "POST", "path": "btc-daily-post", "options": {} }, "type": "n8n-nodes-base.webhook", "typeVersion": 2.1, "position": [ -256, 0 ], "id": "fcf6dd4b-84b6-40ef-bddd-15fb3ab29ca2", "name": "Webhook", "webhookId": "756efa11-af59-4f66-8cbe-2156f25807a6" }, { "parameters": { "text": "={{ $('Webhook').item.json.body['##datetime##'] }} | #Bitcoin ${{ $('Webhook').item.json.body['##btc_price_now##'] }}\n\n7d: ${{ $('Webhook').item.json.body['##btc_7d_ago##'] }} | 1m: ${{ $('Webhook').item.json.body['##btc_1m_ago##'] }} | 1y: ${{ $('Webhook').item.json.body['##btc_1y_ago##'] }} | {{ $('Webhook').item.json.body['##btc_percent_ath##'] }}% from ATH\nFear & Greed: {{ $('Webhook').item.json.body['##fg##'] }} ({{ $('Webhook').item.json.body['##fg_sentiment##'] }})\nMarket cap: ${{ $('Webhook').item.json.body['##total_marketcap##'] }}T ({{ $('Webhook').item.json.body['##marketcap_diff##'] }}%)\nDominance: {{ $('Webhook').item.json.body['##first_dom##'] }} {{ $('Webhook').item.json.body['##first_dominance##'] }}% | {{ $('Webhook').item.json.body['##second_dom##'] }} {{ $('Webhook').item.json.body['##second_dominance##'] }}% | {{ $('Webhook').item.json.body['##third_dom##'] }} {{ $('Webhook').item.json.body['##third_dominance##'] }}%", "additionalFields": {} }, "type": "n8n-nodes-base.twitter", "typeVersion": 2, "position": [ 240, -16 ], "id": "b6b87647-2ce3-4ee3-916e-b2a1ade6ccb1", "name": "Create Tweet", "credentials": { "twitterOAuth2Api": { "id": "p2idWRCUmM99PcpT", "name": "X account" } } }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "392ec53b-48e8-4398-a6d7-178d45631a7a", "leftValue": "={{ $json.body['##datetime##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "8d18fca5-5e37-47eb-8ff9-985483b34744", "leftValue": "={{ $json.body['##btc_price_now##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "270884d7-2b76-4cde-a2ec-7182612dc718", "leftValue": "={{ $json.body['##btc_percent_ath##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "85c23bb8-64e6-415b-8b78-9d32b0529a3f", "leftValue": "={{ $json.body['##fg##'] }}", "rightValue": 0, "operator": { "type": "number", "operation": "notEmpty", "singleValue": true } }, { "id": "704c1bce-4689-4d6c-8f39-1f1493ea1d84", "leftValue": "={{ $json.body['##fg_sentiment##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "5d466368-9f44-436b-8614-07bcb31de48c", "leftValue": "={{ $json.body['##marketcap_diff##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "2329edca-6257-4bb1-999c-84ace4efd6ae", "leftValue": "={{ $json.body['##total_marketcap##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "28a81f69-1a6a-4f34-92d1-3b4ef1b1d7ab", "leftValue": "={{ $json.body['##first_dom##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "72a3c193-e03b-4b5f-993f-ff4a1038545a", "leftValue": "={{ $json.body['##second_dom##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "0a8d6d00-3ef8-47f6-b838-b143b9a31c6e", "leftValue": "={{ $json.body['##first_dominance##'] }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [ -32, 0 ], "id": "928da271-a596-468a-a863-fe8c3047afdb", "name": "If" } ], "connections": { "Webhook": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "Create Tweet", "type": "main", "index": 0 } ] ] } }, "authors": "Thibaut TRESSE", "name": "Version 1.0", "description": "Set X daily post", "autosaved": false }, "tags": [ { "updatedAt": "2026-01-16T17:31:02.259Z", "createdAt": "2026-01-16T17:31:02.259Z", "id": "Ta26VXjbzUjmnoEo", "name": "webhook" }, { "updatedAt": "2026-01-16T17:31:02.898Z", "createdAt": "2026-01-16T17:31:02.898Z", "id": "qUq8NghXDHvr1gnb", "name": "x" } ] }, "pairedItem": { "item": 0 } } ] }, "versionId": "e1114a4e-48cf-449d-98c1-5265ab58d088", "activeVersionId": "d2ee6a28-f997-4b4d-ab8c-a82719457d46", "triggerCount": 1, "shared": [ { "updatedAt": "2026-01-20T16:40:47.634Z", "createdAt": "2026-01-20T16:40:47.634Z", "role": "workflow:owner", "workflowId": "EYU0lsW4Q8mqcGEt0WdAP", "projectId": "cCEPBw2hpHqTYswB" } ], "activeVersion": { "updatedAt": "2026-01-20T17:30:02.000Z", "createdAt": "2026-01-20T17:29:40.941Z", "versionId": "d2ee6a28-f997-4b4d-ab8c-a82719457d46", "workflowId": "EYU0lsW4Q8mqcGEt0WdAP", "nodes": [ { "parameters": {}, "id": "17c0d46b-e236-4284-a8c3-9d09ac6dfdff", "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 480, 80 ], "typeVersion": 1 }, { "parameters": { "content": "## Subworkflow", "height": 828, "width": 1911, "color": 6 }, "id": "f8a637bf-d506-4464-89c5-ee6fb6904b34", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 464 ], "typeVersion": 1 }, { "parameters": {}, "id": "023fcc88-4437-404b-b7ff-cdad049f9b4f", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [ 64, 880 ], "typeVersion": 1 }, { "parameters": { "assignments": { "assignments": [ { "id": "8d513345-6484-431f-afb7-7cf045c90f4f", "name": "Done", "type": "boolean", "value": true } ] }, "options": {} }, "id": "b2802a84-5f26-4df7-a3e6-433a949d517b", "name": "Return", "type": "n8n-nodes-base.set", "position": [ 1728, 672 ], "typeVersion": 3.3 }, { "parameters": { "jsCode": "const orderJsonKeys = (jsonObj) => {\n const ordered = {};\n Object.keys(jsonObj).sort().forEach(key => {\n ordered[key] = jsonObj[key];\n });\n return ordered;\n}\n\nconst n8nWorkflowLastUpdate = $('Execute Workflow Trigger').first().json.updatedAt\nif ($('Get backup workflow').first().json && !$('Get backup workflow').first().json.error) {\n // Get gitLabworkflow\n const contentJSON = $('Get backup workflow').first().json;\n\n const gitLabWorkFlowLastUpdate = contentJSON.updatedAt;\n \n if ( gitLabWorkFlowLastUpdate === n8nWorkflowLastUpdate) {\n $input.all()[0].json.gitlab_status = \"same\";\n } else {\n // there is an update\n $input.all()[0].json.gitlab_status = \"update\";\n }\n} else {\n // Create new file on gitlab\n $input.all()[0].json.gitlab_status = \"new\";\n}\n\n// add last update date\n$('Execute Workflow Trigger').first().json.lastUpdate = n8nWorkflowLastUpdate;\n\n// create object for gitlab backup\nconst n8nAllWorkflowUpdated = $('Execute Workflow Trigger').first().json;\nconst final = orderJsonKeys(n8nAllWorkflowUpdated);\n$input.all()[0].json.n8n_data_stringy = JSON.stringify(final, null, 2);\n\n// Return items\nreturn $input.all();\n" }, "id": "4eb7389b-e888-4dcc-bf61-7db7c73e9920", "name": "isDiffOrNew", "type": "n8n-nodes-base.code", "position": [ 672, 880 ], "typeVersion": 1, "executeOnce": false }, { "parameters": { "dataType": "string", "value1": "={{ $json.gitlab_status }}", "rules": { "rules": [ { "value2": "same" }, { "value2": "update", "output": 1 }, { "value2": "new", "output": 2 } ] } }, "id": "77f76a7e-f188-4bef-b214-e89dbcafca4e", "name": "Check Status", "type": "n8n-nodes-base.switch", "position": [ 1040, 848 ], "typeVersion": 1 }, { "parameters": {}, "id": "4bdd0d76-175c-4b45-b3b3-f0d11ac5de39", "name": "Same file - Do nothing", "type": "n8n-nodes-base.noOp", "position": [ 1264, 672 ], "typeVersion": 1 }, { "parameters": {}, "id": "a9879c05-8413-43bc-8414-be8748fbe4ef", "name": "File is different", "type": "n8n-nodes-base.noOp", "position": [ 1264, 848 ], "typeVersion": 1 }, { "parameters": {}, "id": "c5610ee0-c35f-4a9f-a607-cabfaf4bfe66", "name": "File is new", "type": "n8n-nodes-base.noOp", "position": [ 1264, 1040 ], "typeVersion": 1 }, { "parameters": { "options": {} }, "id": "5570c18f-c0b7-42cd-b7d0-d1f2bccdf878", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ 1008, 192 ], "typeVersion": 3 }, { "parameters": { "content": "## Backup to GitLab /OPS/n8n/n8n_backup\nThis workflow will backup all instance workflows to GitLab every 24 hours.\n\nThe files are saved into folders directory path and `ID.json` for the filename.\n\nThe Repo Owner, Repo Name and Main folder are set using the **Variables** feature but can be replaced with the `Config` node in the subworkflow. \n\nThe workflow runs calls itself to help reduce memory usage, Once the workflow has completed it will send an optional notification to Slack.\n\ntest", "height": 417, "width": 385, "color": 4 }, "id": "56242465-15d4-40af-b63f-5b804b32a4c7", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 0 ], "typeVersion": 1 }, { "parameters": { "content": "## Main workflow loop", "height": 448, "width": 1497, "color": 7 }, "id": "f2582589-f187-42f1-8df1-d2f62d5f7b96", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 416, 0 ], "typeVersion": 1 }, { "parameters": { "workflowId": "={{ $workflow.id }}", "mode": "each", "options": {} }, "id": "89155bb4-a958-4eea-955b-bae0dfc14dc4", "name": "Execute Workflow", "type": "n8n-nodes-base.executeWorkflow", "position": [ 1488, 208 ], "typeVersion": 1, "onError": "continueErrorOutput" }, { "parameters": { "assignments": { "assignments": [ { "id": "8f6d1741-772f-462a-811f-4c334185e4f0", "name": "repo_owner", "type": "string", "value": "ttresse" }, { "id": "8cac215c-4fd7-422f-9fd2-6b2d1e5e0383", "name": "repo_name", "type": "string", "value": "=n8n-backup" }, { "id": "eee305e9-4164-462a-86bd-80f0d58a31ae", "name": "repo_path", "type": "string", "value": "=vps" } ] }, "includeOtherFields": true, "options": {} }, "id": "685c94e7-ffc4-47d1-89bd-2986dcc93db0", "name": "Config", "type": "n8n-nodes-base.set", "position": [ 256, 880 ], "typeVersion": 3.4 }, { "parameters": { "rule": { "interval": [ { "triggerAtHour": 3 } ] } }, "id": "eb37d716-5500-47ba-8ec6-ba7df9f63caf", "name": "Schedule Trigger1", "type": "n8n-nodes-base.scheduleTrigger", "position": [ 480, 288 ], "typeVersion": 1.2 }, { "parameters": { "filters": {}, "requestOptions": {} }, "id": "46ee73a8-a4bd-43fa-bb4c-75ccd8c6a8c9", "name": "Get many workflows", "type": "n8n-nodes-base.n8n", "position": [ 784, 192 ], "typeVersion": 1, "alwaysOutputData": false, "credentials": { "n8nApi": { "id": "ciSQOiKSg5yW3ch1", "name": "n8n account" } } }, { "parameters": { "resource": "file", "operation": "edit", "owner": { "__rl": true, "value": "={{ $('Config').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $('Execute Workflow Trigger').item.json.id }}.json", "fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{ $('isDiffOrNew').item.json.gitlab_status }})" }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 1456, 848 ], "id": "cc00c06e-280f-43f5-a8f0-dd2ab122d2b4", "name": "Edit file", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "resource": "file", "owner": { "__rl": true, "value": "={{ $('Config').item.json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $('Config').item.json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $('Execute Workflow Trigger').item.json.id }}.json", "fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}", "commitMessage": "={{$('Execute Workflow Trigger').first().json.name}} ({{ $json.gitlab_status }})" }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 1520, 1024 ], "id": "ce5ccc86-118b-43f9-9fda-8153cc4f748d", "name": "Create file", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } } }, { "parameters": { "resource": "file", "operation": "get", "owner": { "__rl": true, "value": "={{ $json.repo_owner }}", "mode": "name" }, "repository": { "__rl": true, "value": "={{ $json.repo_name }}", "mode": "name" }, "filePath": "={{ $('Config').item.json.repo_path }}/{{ $('Execute Workflow Trigger').item.json.name }}/{{ $json.id }}.json", "additionalParameters": {} }, "type": "n8n-nodes-base.github", "typeVersion": 1.1, "position": [ 496, 880 ], "id": "356749c0-a305-413a-a867-75bd007ed65a", "name": "Get backup workflow", "webhookId": "ad18af03-c685-4879-93ab-f5d1360ea6ed", "alwaysOutputData": false, "credentials": { "githubApi": { "id": "lXyPp9eNJot7fSLS", "name": "GitHub account" } }, "onError": "continueRegularOutput" } ], "connections": { "Config": { "main": [ [ { "node": "Get backup workflow", "type": "main", "index": 0 } ] ] }, "File is new": { "main": [ [ { "node": "Create file", "type": "main", "index": 0 } ] ] }, "isDiffOrNew": { "main": [ [ { "node": "Check Status", "type": "main", "index": 0 } ] ] }, "Check Status": { "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 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "Execute Workflow", "type": "main", "index": 0 } ] ] }, "Execute Workflow": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ], [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "File is different": { "main": [ [ { "node": "Edit file", "type": "main", "index": 0 } ] ] }, "On clicking 'execute'": { "main": [ [ { "node": "Get many workflows", "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 } ] ] }, "Schedule Trigger1": { "main": [ [ { "node": "Get many workflows", "type": "main", "index": 0 } ] ] }, "Get many workflows": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Edit file": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "Create file": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "Get backup workflow": { "main": [ [ { "node": "isDiffOrNew", "type": "main", "index": 0 } ] ] } }, "authors": "Thibaut TRESSE", "name": "1.2", "description": "", "autosaved": false }, "tags": [ { "updatedAt": "2026-01-20T16:56:27.472Z", "createdAt": "2026-01-20T16:56:27.472Z", "id": "kIBNGXaXhrncXGnD", "name": "github" } ] }, "pairedItem": { "item": 0 } } ] }, "connections": { "On clicking 'execute'": { "main": [ [ { "node": "Get many workflows", "type": "main", "index": 0 } ] ] }, "Execute Workflow Trigger": { "main": [ [ { "node": "Config1", "type": "main", "index": 0 } ] ] }, "Get File": { "main": [ [ { "node": "Merge Items1", "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": "Check Status1", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Get many workflows", "type": "main", "index": 0 } ] ] }, "If file too large": { "main": [ [ { "node": "Get File", "type": "main", "index": 0 } ], [ { "node": "Merge Items1", "type": "main", "index": 0 } ] ] }, "Edit existing file": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "Merge Items1": { "main": [ [ { "node": "isDiffOrNew1", "type": "main", "index": 0 } ] ] }, "isDiffOrNew1": { "main": [ [ { "node": "Create sub path", "type": "main", "index": 0 } ] ] }, "Check Status1": { "main": [ [ { "node": "Same file - Do nothing1", "type": "main", "index": 0 } ], [ { "node": "File is different1", "type": "main", "index": 0 } ], [ { "node": "File is new1", "type": "main", "index": 0 } ] ] }, "Same file - Do nothing1": { "main": [ [ { "node": "Return", "type": "main", "index": 0 } ] ] }, "File is different1": { "main": [ [ { "node": "Edit existing file", "type": "main", "index": 0 } ] ] }, "File is new1": { "main": [ [ { "node": "Create new file", "type": "main", "index": 0 } ] ] }, "Loop Over Items1": { "main": [ [], [ { "node": "Execute Workflow1", "type": "main", "index": 0 } ] ] }, "Execute Workflow1": { "main": [ [ { "node": "Loop Over Items1", "type": "main", "index": 0 } ], [ { "node": "Loop Over Items1", "type": "main", "index": 0 } ] ] }, "Config1": { "main": [ [ { "node": "Get file data", "type": "main", "index": 0 }, { "node": "Merge Items1", "type": "main", "index": 1 } ] ] }, "Get many workflows": { "main": [ [ { "node": "Filter", "type": "main", "index": 0 } ] ] }, "Filter": { "main": [ [ { "node": "Loop Over Items1", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1", "binaryMode": "separate", "availableInMCP": false }, "versionId": "c0fc768d-36ab-4ef4-ab0a-f6b57c704ebb", "meta": { "instanceId": "b0bd83bbcf974c41d296ec417bc83981f52e9b01b85daa894438f303ad70cd2f" }, "id": "38qAmYjzL3lievW5", "tags": [] }