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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}
}