260 lines
5.0 KiB
JSON
Executable File
260 lines
5.0 KiB
JSON
Executable File
{
|
|
"id": 26,
|
|
"name": "Git backup of workflows and credentials",
|
|
"active": false,
|
|
"nodes": [
|
|
{
|
|
"parameters": {},
|
|
"name": "Start",
|
|
"type": "n8n-nodes-base.start",
|
|
"position": [
|
|
200,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "npx n8n export:credentials --backup --output repo/credentials/"
|
|
},
|
|
"name": "Export Credentials",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
590,
|
|
400
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "git -C repo add ."
|
|
},
|
|
"name": "git add",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
740,
|
|
400
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "=git -C repo commit -m \"Auto backup ({{ new Date().toISOString() }})\""
|
|
},
|
|
"name": "git commit",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
890,
|
|
400
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "git -C repo push"
|
|
},
|
|
"name": "git push",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
1080,
|
|
400
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"triggerTimes": {
|
|
"item": [
|
|
{
|
|
"hour": 0
|
|
},
|
|
{
|
|
"hour": 12
|
|
},
|
|
{
|
|
"hour": 6
|
|
},
|
|
{
|
|
"hour": 18
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"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 Workflows1",
|
|
"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 Credentials1",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
640,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "cd /home/node/.n8n/backup/ && git add ."
|
|
},
|
|
"name": "git add2",
|
|
"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 commit1",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
1060,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
},
|
|
{
|
|
"parameters": {
|
|
"command": "cd /home/node/.n8n/backup/ && git push \n origin master \n"
|
|
},
|
|
"name": "git push1",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"position": [
|
|
1260,
|
|
620
|
|
],
|
|
"typeVersion": 1
|
|
}
|
|
],
|
|
"connections": {
|
|
"Cron": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Export Workflows1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Start": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Export Workflows1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git add": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git commit",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git commit": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git push",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Export Credentials": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git add",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Export Workflows1": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Export Credentials1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Export Credentials1": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git add2",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git add2": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git commit1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"git commit1": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "git push1",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"createdAt": "2022-05-26T17:20:27.486Z",
|
|
"updatedAt": "2022-05-27T10:00:25.426Z",
|
|
"settings": {
|
|
"saveExecutionProgress": "DEFAULT",
|
|
"errorWorkflow": "25"
|
|
},
|
|
"staticData": null
|
|
} |