269 lines
5.3 KiB
JSON
Executable File
269 lines
5.3 KiB
JSON
Executable File
{
|
|
"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
|
|
},
|
|
{
|
|
"parameters": {
|
|
"triggerTimes": {
|
|
"item": [
|
|
{
|
|
"hour": 0
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "Cron",
|
|
"type": "n8n-nodes-base.cron",
|
|
"position": [
|
|
200,
|
|
400
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"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
|
|
},
|
|
{
|
|
"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
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "cd /home/node/.n8n/backup/ && git add ."
|
|
},
|
|
"name": "git add",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
860,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "=cd /home/node/.n8n/backup/ && git commit -m \"Auto backup ({{ new Date().toISOString() }})\""
|
|
},
|
|
"name": "git commit",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
1060,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"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": [
|
|
1240,
|
|
640
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"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": [
|
|
920,
|
|
760
|
|
]
|
|
},
|
|
{
|
|
"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": [
|
|
640,
|
|
840
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"operation": "addConfig",
|
|
"repositoryPath": "/home/node/.n8n/backup",
|
|
"key": "user.name",
|
|
"value": "nia",
|
|
"options": {}
|
|
},
|
|
"name": "Git1",
|
|
"type": "n8n-nodes-base.git",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
820,
|
|
840
|
|
]
|
|
},
|
|
{
|
|
"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": [
|
|
1000,
|
|
840
|
|
],
|
|
"credentials": {
|
|
"gitPassword": {
|
|
"id": "30",
|
|
"name": "Git account"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"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": "git add",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git add": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "add username",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git commit": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git push",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"add username": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git commit",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Git": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Git1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Git1": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Git2",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"createdAt": "2022-05-26T17:20:27.486Z",
|
|
"updatedAt": "2022-05-30T03:15:01.196Z",
|
|
"settings": {
|
|
"errorWorkflow": "25"
|
|
},
|
|
"staticData": null
|
|
} |