{ "createdAt": "2022-05-26T17:20:27.486Z", "updatedAt": "2023-01-17T15:51:25.034Z", "id": "26", "name": "Git backup of workflows and credentials", "active": true, "nodes": [ { "parameters": {}, "name": "Start", "type": "n8n-nodes-base.start", "position": [ 200, 620 ], "typeVersion": 1, "id": "cf28aca0-f5d1-4164-8513-452e949a782a" }, { "parameters": { "triggerTimes": { "item": [ { "hour": 0 } ] } }, "name": "Cron", "type": "n8n-nodes-base.cron", "position": [ 200, 400 ], "typeVersion": 1, "id": "97f1183c-5136-44eb-83d3-6edfc70a5cd9" }, { "parameters": { "command": "npx n8n export:workflow --backup --output /home/node/.n8n/backup/flows/" }, "name": "Export Workflows", "type": "n8n-nodes-base.executeCommand", "position": [ 460, 620 ], "typeVersion": 1, "id": "3b5e3a9e-4ea7-41ba-b59a-f11fd0cb79be" }, { "parameters": { "command": "npx n8n export:credentials --backup --output /home/node/.n8n/backup/credentials/" }, "name": "Export Credentials", "type": "n8n-nodes-base.executeCommand", "position": [ 640, 620 ], "typeVersion": 1, "id": "f72a0e71-4f56-4c90-8617-6ea376ee3899" }, { "parameters": { "command": "cd /home/node/.n8n/backup/ && git add ." }, "name": "git add", "type": "n8n-nodes-base.executeCommand", "position": [ 800, 360 ], "typeVersion": 1, "id": "81be2c11-d3e0-45ae-99f9-640524a04488" }, { "parameters": { "command": "=cd /home/node/.n8n/backup/ && git commit -m \"Auto backup ({{ new Date().toISOString() }})\"" }, "name": "git commit", "type": "n8n-nodes-base.executeCommand", "position": [ 1180, 320 ], "typeVersion": 1, "id": "9acce3e6-fa8e-4aa7-b51b-f8fb86ab419b" }, { "parameters": { "command": "cd /home/node/.n8n/backup/ && git push https://nia:4159b2141ce710381857585e10f643c40ea613e3@lab.cynic.club/nia/n8n.git --all \n" }, "name": "git push", "type": "n8n-nodes-base.executeCommand", "position": [ 1360, 380 ], "typeVersion": 1, "id": "978fc3dc-4df5-4758-af67-2d7c87e20c47" }, { "parameters": { "command": "git config --global user.email \"ihor.nahornyy@gmail.com\" &&\n git config --global user.name \"nia\"" }, "name": "add username", "type": "n8n-nodes-base.executeCommand", "typeVersion": 1, "position": [ 1000, 360 ], "id": "c3c605fc-0519-4c8a-8df1-f3957ff65a89" }, { "parameters": { "operation": "addConfig", "repositoryPath": "/home/node/.n8n/backup", "key": "user.email", "value": "ihor.nahornyy@gmail.com", "options": {} }, "name": "Git", "type": "n8n-nodes-base.git", "typeVersion": 1, "position": [ 1000, 620 ], "id": "e891c92f-90c5-4562-bffb-b4a3133f2af6" }, { "parameters": { "operation": "addConfig", "repositoryPath": "/home/node/.n8n/backup", "key": "user.name", "value": "nia", "options": {} }, "name": "Git1", "type": "n8n-nodes-base.git", "typeVersion": 1, "position": [ 1160, 620 ], "id": "de49bfa5-9563-4345-b415-8bd27413d6b7" }, { "parameters": { "authentication": "gitPassword", "operation": "push", "repositoryPath": "/home/node/.n8n/backup", "options": { "targetRepository": "https://lab.cynic.club/nia/n8n.git" } }, "name": "Git2", "type": "n8n-nodes-base.git", "typeVersion": 1, "position": [ 1480, 620 ], "credentials": { "gitPassword": { "id": "30", "name": "Git account" } }, "id": "7c68e35c-f5ec-4a8b-8d38-ee874100534e" }, { "parameters": { "operation": "add", "repositoryPath": "/home/node/.n8n/backup", "pathsToAdd": "." }, "name": "Git3", "type": "n8n-nodes-base.git", "typeVersion": 1, "position": [ 820, 620 ], "id": "52382fb1-c266-4e8d-904d-12381c0a92bf" }, { "parameters": { "operation": "commit", "repositoryPath": "/home/node/.n8n/backup", "message": "=Auto backup ({{ new Date().toISOString() }})", "options": {} }, "name": "Git4", "type": "n8n-nodes-base.git", "typeVersion": 1, "position": [ 1320, 620 ], "id": "fe2b1325-e552-42b9-b8b0-ec8cd7dfbd94" } ], "connections": { "Cron": { "main": [ [ { "node": "Export Workflows", "type": "main", "index": 0 } ] ] }, "Start": { "main": [ [ { "node": "Export Workflows", "type": "main", "index": 0 } ] ] }, "Export Workflows": { "main": [ [ { "node": "Export Credentials", "type": "main", "index": 0 } ] ] }, "Export Credentials": { "main": [ [ { "node": "Git3", "type": "main", "index": 0 } ] ] }, "git add": { "main": [ [ { "node": "add username", "type": "main", "index": 0 } ] ] }, "git commit": { "main": [ [] ] }, "Git": { "main": [ [ { "node": "Git1", "type": "main", "index": 0 } ] ] }, "Git1": { "main": [ [ { "node": "Git4", "type": "main", "index": 0 } ] ] }, "Git3": { "main": [ [ { "node": "Git", "type": "main", "index": 0 } ] ] }, "Git4": { "main": [ [ { "node": "Git2", "type": "main", "index": 0 } ] ] } }, "settings": { "errorWorkflow": "25" }, "staticData": null, "pinData": null, "versionId": "9b91cdd0-e062-4b2c-91a2-63f70ec6f0da", "triggerCount": 1, "tags": [ { "createdAt": "2022-05-19T09:37:15.931Z", "updatedAt": "2022-05-19T09:37:15.931Z", "id": "2", "name": "my" } ] }