From 36345b0de8bdbd23c57ec66c45e9eb8d0050abf8 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Wed, 4 Feb 2026 10:17:36 -0500 Subject: [PATCH] fix(09-04): fix batch Start from inline keyboard Prepare Batch Exec now references Prepare Immediate Batch Exec directly instead of relying on $json which gets overwritten by Delete Batch Select Message. Also handles both 'action' and 'batchAction' field names. Co-Authored-By: Claude Opus 4.5 --- n8n-workflow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",