260 lines
7.7 KiB
JSON
260 lines
7.7 KiB
JSON
{
|
||
"createdAt": "2025-11-07T02:55:16.049Z",
|
||
"updatedAt": "2025-11-07T06:18:21.000Z",
|
||
"id": "LOjRm3q8w17J9zF4",
|
||
"name": "Qdrant Backup",
|
||
"active": false,
|
||
"isArchived": false,
|
||
"nodes": [
|
||
{
|
||
"parameters": {
|
||
"url": "http://10.20.22.1:6333/collections",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.2,
|
||
"position": [
|
||
-480,
|
||
160
|
||
],
|
||
"id": "50e8c01f-fa1e-4502-96da-76860d7a056f",
|
||
"name": "HTTP Request4"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"jsCode": "// Extract each collection as a separate item\nreturn $json.result.collections.map(c => {\n return {\n json: {\n collection: c.name\n }\n };\n});\n"
|
||
},
|
||
"type": "n8n-nodes-base.code",
|
||
"typeVersion": 2,
|
||
"position": [
|
||
-272,
|
||
160
|
||
],
|
||
"id": "50333dee-92f3-4fda-bd99-3df4971427ca",
|
||
"name": "Code in JavaScript2"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.splitInBatches",
|
||
"typeVersion": 3,
|
||
"position": [
|
||
-64,
|
||
160
|
||
],
|
||
"id": "db94cb46-8a7e-470a-a103-4e67ecb2691c",
|
||
"name": "Loop Over Items1"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"method": "POST",
|
||
"url": "={{ `http://10.20.22.1:6333/collections/${$json.collection}/snapshots` }}",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.2,
|
||
"position": [
|
||
272,
|
||
176
|
||
],
|
||
"id": "0f5ed001-2d8e-496e-aaab-93a2b542f9a2",
|
||
"name": "HTTP Request5"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"url": "={{ `http://10.20.22.1:6333/collections/${$json.collection}/snapshots/${$json.result.name}` }}\n",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.2,
|
||
"position": [
|
||
640,
|
||
304
|
||
],
|
||
"id": "520ac68c-8453-4f1f-915d-c283ec618bcd",
|
||
"name": "HTTP Request6"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "write",
|
||
"fileName": "={{ (() => {\n const collection = $json.collection;\n\n const now = new Date();\n\n const pad = (n) => String(n).padStart(2, '0');\n\n const formatted = [\n now.getFullYear(),\n pad(now.getMonth() + 1),\n pad(now.getDate())\n ].join('') + '-' + [pad(now.getHours()), pad(now.getMinutes())].join(':');\n\n return `/data/bill/qdrant_backups/snapshots/${collection}/${formatted}.snapshot`;\n})() }}\n",
|
||
"options": {
|
||
"append": false
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.readWriteFile",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
816,
|
||
304
|
||
],
|
||
"id": "07399205-fcff-4b29-b26d-202553604932",
|
||
"name": "Read/Write Files from Disk1"
|
||
},
|
||
{
|
||
"parameters": {},
|
||
"type": "n8n-nodes-base.manualTrigger",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-688,
|
||
160
|
||
],
|
||
"id": "094a462f-e698-4858-abcd-4bf1f9dabd24",
|
||
"name": "When clicking ‘Execute workflow’"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"mode": "combine",
|
||
"combineBy": "combineAll",
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.merge",
|
||
"typeVersion": 3.2,
|
||
"position": [
|
||
464,
|
||
304
|
||
],
|
||
"id": "41b09da2-6937-4af2-ab14-3c084ad3ecbf",
|
||
"name": "Merge"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"command": "cd /data/bill/qdrant_backups\ngit add snapshots/${$json.collection}/*\ngit commit -m \"Backup: ${$json.collection} @ ${new Date().toISOString()}\"\ngit push origin main\n"
|
||
},
|
||
"type": "n8n-nodes-base.executeCommand",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
992,
|
||
304
|
||
],
|
||
"id": "490b1070-9eca-4af0-b476-d90a1298ab42",
|
||
"name": "Execute Command"
|
||
}
|
||
],
|
||
"connections": {
|
||
"HTTP Request4": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Code in JavaScript2",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Code in JavaScript2": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Loop Over Items1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Loop Over Items1": {
|
||
"main": [
|
||
[],
|
||
[
|
||
{
|
||
"node": "HTTP Request5",
|
||
"type": "main",
|
||
"index": 0
|
||
},
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 1
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"HTTP Request5": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Merge",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"HTTP Request6": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Read/Write Files from Disk1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Read/Write Files from Disk1": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Execute Command",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"When clicking ‘Execute workflow’": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "HTTP Request4",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Merge": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "HTTP Request6",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Execute Command": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Loop Over Items1",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
}
|
||
},
|
||
"settings": {
|
||
"executionOrder": "v1"
|
||
},
|
||
"staticData": null,
|
||
"meta": null,
|
||
"pinData": {},
|
||
"versionId": "9d9abf4d-0eb9-4070-9d77-5e0d2f743fef",
|
||
"triggerCount": 0,
|
||
"shared": [
|
||
{
|
||
"createdAt": "2025-11-07T02:55:16.059Z",
|
||
"updatedAt": "2025-11-07T02:55:16.059Z",
|
||
"role": "workflow:owner",
|
||
"workflowId": "LOjRm3q8w17J9zF4",
|
||
"projectId": "oI3LZpkceKxAFXfg"
|
||
}
|
||
],
|
||
"tags": []
|
||
} |