From 3d67df490cad944704cd7da85c622feb418a2ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 29 Nov 2022 17:30:39 +0100 Subject: [PATCH] fix(core): Fix `$items().length` in Execute Once mode (#4755) * :bug: Fix `$items.length` in Execute Once mode * :fire: Remove logging --- packages/workflow/src/WorkflowDataProxy.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/workflow/src/WorkflowDataProxy.ts b/packages/workflow/src/WorkflowDataProxy.ts index fe9591fedf..375fccd2c5 100644 --- a/packages/workflow/src/WorkflowDataProxy.ts +++ b/packages/workflow/src/WorkflowDataProxy.ts @@ -1138,21 +1138,14 @@ export class WorkflowDataProxy { return dataProxy.getDataProxy(); }, $items: (nodeName?: string, outputIndex?: number, runIndex?: number) => { - let executionData: INodeExecutionData[]; - if (nodeName === undefined) { - executionData = that.connectionInputData; - } else { - outputIndex = outputIndex || 0; - runIndex = runIndex === undefined ? -1 : runIndex; - executionData = that.getNodeExecutionData(nodeName, false, outputIndex, runIndex); + nodeName = (that.prevNodeGetter() as { name: string }).name; } - if (that.workflow.getNode(that.activeNodeName)?.executeOnce) { - executionData = that.connectionInputData.slice(0, 1); - } + outputIndex = outputIndex || 0; + runIndex = runIndex === undefined ? -1 : runIndex; - return executionData; + return that.getNodeExecutionData(nodeName, false, outputIndex, runIndex); }, $json: {}, // Placeholder $node: this.nodeGetter(),