mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Fix execute-once incoming data handling (#5211)
This commit is contained in:
@@ -1211,7 +1211,6 @@ export class Workflow {
|
|||||||
|
|
||||||
if (node.executeOnce === true) {
|
if (node.executeOnce === true) {
|
||||||
// If node should be executed only once so use only the first input item
|
// If node should be executed only once so use only the first input item
|
||||||
connectionInputData = connectionInputData.slice(0, 1);
|
|
||||||
const newInputData: ITaskDataConnections = {};
|
const newInputData: ITaskDataConnections = {};
|
||||||
for (const inputName of Object.keys(inputData)) {
|
for (const inputName of Object.keys(inputData)) {
|
||||||
newInputData[inputName] = inputData[inputName].map((input) => {
|
newInputData[inputName] = inputData[inputName].map((input) => {
|
||||||
|
|||||||
@@ -358,12 +358,6 @@ export class WorkflowDataProxy {
|
|||||||
executionData = taskData.main[outputIndex] as INodeExecutionData[];
|
executionData = taskData.main[outputIndex] as INodeExecutionData[];
|
||||||
} else {
|
} else {
|
||||||
// Short syntax got used to return data from active node
|
// 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;
|
executionData = that.connectionInputData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1174,6 +1168,15 @@ export class WorkflowDataProxy {
|
|||||||
$items: (nodeName?: string, outputIndex?: number, runIndex?: number) => {
|
$items: (nodeName?: string, outputIndex?: number, runIndex?: number) => {
|
||||||
if (nodeName === undefined) {
|
if (nodeName === undefined) {
|
||||||
nodeName = (that.prevNodeGetter() as { name: string }).name;
|
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;
|
outputIndex = outputIndex || 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user