feat(10-05): wire batch update to Container Update sub-workflow
- Add Prepare Batch Update Input node to format sub-workflow input - Add Execute Batch Update node calling Container Update sub-workflow - Add Handle Batch Update Result node to process results - Connect update path (output 0) in Route Batch Loop Action - Node count: 209 -> 212 (+3) This completes the batch update integration with the modular sub-workflow, eliminating the need for duplicate update logic in the main workflow.
This commit is contained in:
+84
-1
@@ -5194,6 +5194,50 @@
|
||||
2880,
|
||||
1650
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "// Prepare input for Container Update sub-workflow\nconst data = $json;\nconst container = data.container;\n\n// Extract container info\nconst containerId = container.id || container.Id || '';\nconst containerName = container.name || container.Name || '';\n\nreturn {\n json: {\n containerId: containerId,\n containerName: containerName,\n chatId: data.chatId,\n messageId: data.progressMessageId || 0,\n responseMode: \"inline\"\n }\n};"
|
||||
},
|
||||
"id": "caeae5d6-f9ec-4aa3-83d3-198b6b55be65",
|
||||
"name": "Prepare Batch Update Input",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
4000,
|
||||
-800
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "7AvTzLtKXM2hZTio92_mC"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"id": "720b6da1-60e6-4ec4-8a5f-d403ad05994c",
|
||||
"name": "Execute Batch Update",
|
||||
"type": "n8n-nodes-base.executeWorkflow",
|
||||
"typeVersion": 1.2,
|
||||
"position": [
|
||||
4220,
|
||||
-800
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"jsCode": "// Handle update result from sub-workflow\nconst data = $('Build Progress Message').item.json;\nconst result = $json;\n\n// Update counters based on result\nlet successCount = data.successCount || 0;\nlet failureCount = data.failureCount || 0;\nlet warningCount = data.warningCount || 0;\n\nif (result.success) {\n successCount++;\n} else {\n failureCount++;\n}\n\n// Add to results array\nconst results = data.results || [];\nresults.push({\n container: data.containerName,\n action: 'update',\n success: result.success,\n message: result.message || ''\n});\n\nreturn {\n json: {\n ...data,\n successCount: successCount,\n failureCount: failureCount,\n warningCount: warningCount,\n results: results\n }\n};"
|
||||
},
|
||||
"id": "f5576e75-8cfa-4ac3-9fea-64fae8d31bec",
|
||||
"name": "Handle Batch Update Result",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [
|
||||
4440,
|
||||
-800
|
||||
]
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
@@ -6751,7 +6795,13 @@
|
||||
},
|
||||
"Route Batch Loop Action": {
|
||||
"main": [
|
||||
[],
|
||||
[
|
||||
{
|
||||
"node": "Prepare Batch Update Input",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Build Batch Action Command",
|
||||
@@ -7448,6 +7498,39 @@
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Prepare Batch Update Input": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Execute Batch Update",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Batch Update": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Handle Batch Update Result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Handle Batch Update Result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Prepare Next Iteration",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {},
|
||||
|
||||
Reference in New Issue
Block a user