diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index c2a90d6d98..375b56e339 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -1211,7 +1211,6 @@ export class Workflow { if (node.executeOnce === true) { // If node should be executed only once so use only the first input item - connectionInputData = connectionInputData.slice(0, 1); const newInputData: ITaskDataConnections = {}; for (const inputName of Object.keys(inputData)) { newInputData[inputName] = inputData[inputName].map((input) => { diff --git a/packages/workflow/src/WorkflowDataProxy.ts b/packages/workflow/src/WorkflowDataProxy.ts index 3cc2c280a7..d8a8eafe47 100644 --- a/packages/workflow/src/WorkflowDataProxy.ts +++ b/packages/workflow/src/WorkflowDataProxy.ts @@ -358,12 +358,6 @@ export class WorkflowDataProxy { executionData = taskData.main[outputIndex] as INodeExecutionData[]; } else { // Short syntax got used to return data from active node - - // TODO: Here have to generate connection Input data for the current node by itself - // Data needed: - // #- the run-index - // - node which did send data (has to be the one from last recent execution) - // - later also the name of the input and its index (currently not needed as it is always "main" and index "0") executionData = that.connectionInputData; } @@ -1174,6 +1168,15 @@ export class WorkflowDataProxy { $items: (nodeName?: string, outputIndex?: number, runIndex?: number) => { if (nodeName === undefined) { nodeName = (that.prevNodeGetter() as { name: string }).name; + const node = this.workflow.nodes[nodeName]; + let result = that.connectionInputData; + if (node.executeOnce === true) { + result = result.slice(0, 1); + } + if (result.length) { + return result; + } + return []; } outputIndex = outputIndex || 0;