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:
Michael Kret
2024-04-17 11:57:51 +03:00
committed by GitHub
parent f6c9dbf7b8
commit a95e401696

View File

@@ -260,11 +260,19 @@ export class ExecuteWorkflow implements INodeType {
items, items,
); );
const pairedItem = generatePairedItemData(items.length); const fallbackPairedItemData = generatePairedItemData(items.length);
for (const output of workflowResult) { for (const output of workflowResult) {
for (const item of output) { const sameLength = output.length === items.length;
item.pairedItem = pairedItem;
for (const [itemIndex, item] of output.entries()) {
if (item.pairedItem) continue;
if (sameLength) {
item.pairedItem = { item: itemIndex };
} else {
item.pairedItem = fallbackPairedItemData;
}
} }
} }