mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(Execute Workflow Node): Assign fallback pairedItem only if not present in output item and different length of input output (#9145)
This commit is contained in:
parent
f6c9dbf7b8
commit
a95e401696
|
@ -260,11 +260,19 @@ export class ExecuteWorkflow implements INodeType {
|
|||
items,
|
||||
);
|
||||
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
const fallbackPairedItemData = generatePairedItemData(items.length);
|
||||
|
||||
for (const output of workflowResult) {
|
||||
for (const item of output) {
|
||||
item.pairedItem = pairedItem;
|
||||
const sameLength = output.length === items.length;
|
||||
|
||||
for (const [itemIndex, item] of output.entries()) {
|
||||
if (item.pairedItem) continue;
|
||||
|
||||
if (sameLength) {
|
||||
item.pairedItem = { item: itemIndex };
|
||||
} else {
|
||||
item.pairedItem = fallbackPairedItemData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue