diff --git a/n8n-workflow.json b/n8n-workflow.json index 7f5940a..e47a401 100644 --- a/n8n-workflow.json +++ b/n8n-workflow.json @@ -5017,7 +5017,7 @@ }, { "parameters": { - "jsCode": "// Prepare batch exec data for execution\n// Input from bexec callback (start/restart/update)\nconst data = $json;\n\n// containerNames is a comma-separated array from callback\nconst containerNames = data.containerNames || [];\nconst action = data.batchAction || 'start';\n\nreturn {\n json: {\n allMatched: containerNames.map(name => ({ Name: name, Id: null })),\n action: action,\n chatId: data.chatId,\n messageId: data.messageId\n }\n};" + "jsCode": "// Prepare batch exec data for execution\n// Try to get data from Prepare Immediate Batch Exec first (inline keyboard flow)\n// Fall back to $json for text command flow\nlet data;\ntry {\n data = $(\"Prepare Immediate Batch Exec\").item.json;\n} catch (e) {\n data = $json;\n}\n\n// containerNames can be array or comma-separated string\nlet containerNames = data.containerNames || data.containers || [];\nif (typeof containerNames === 'string') {\n containerNames = containerNames.split(',').filter(n => n);\n}\nif (Array.isArray(containerNames) && containerNames[0] && containerNames[0].name) {\n containerNames = containerNames.map(c => c.name);\n}\n\n// action field might be 'action' or 'batchAction'\nconst action = data.action || data.batchAction || 'start';\n\nreturn {\n json: {\n allMatched: containerNames.map(name => ({ Name: name, Id: null })),\n action: action,\n chatId: data.chatId,\n messageId: data.messageId\n }\n};" }, "id": "code-prepare-batch-exec", "name": "Prepare Batch Exec",