mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
fix(core): Fix $items().length
in Execute Once mode (#4755)
* 🐛 Fix `$items.length` in Execute Once mode * 🔥 Remove logging
This commit is contained in:
parent
b319671fd0
commit
3d67df490c
|
@ -1138,21 +1138,14 @@ export class WorkflowDataProxy {
|
||||||
return dataProxy.getDataProxy();
|
return dataProxy.getDataProxy();
|
||||||
},
|
},
|
||||||
$items: (nodeName?: string, outputIndex?: number, runIndex?: number) => {
|
$items: (nodeName?: string, outputIndex?: number, runIndex?: number) => {
|
||||||
let executionData: INodeExecutionData[];
|
|
||||||
|
|
||||||
if (nodeName === undefined) {
|
if (nodeName === undefined) {
|
||||||
executionData = that.connectionInputData;
|
nodeName = (that.prevNodeGetter() as { name: string }).name;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
outputIndex = outputIndex || 0;
|
outputIndex = outputIndex || 0;
|
||||||
runIndex = runIndex === undefined ? -1 : runIndex;
|
runIndex = runIndex === undefined ? -1 : runIndex;
|
||||||
executionData = that.getNodeExecutionData(nodeName, false, outputIndex, runIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (that.workflow.getNode(that.activeNodeName)?.executeOnce) {
|
return that.getNodeExecutionData(nodeName, false, outputIndex, runIndex);
|
||||||
executionData = that.connectionInputData.slice(0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return executionData;
|
|
||||||
},
|
},
|
||||||
$json: {}, // Placeholder
|
$json: {}, // Placeholder
|
||||||
$node: this.nodeGetter(),
|
$node: this.nodeGetter(),
|
||||||
|
|
Loading…
Reference in a new issue