fix: Manually reverted PR 11716 Do not assign all paired items (no-changelog) (#13429)

This commit is contained in:
Shireen Missi
2025-02-21 19:38:35 +00:00
committed by GitHub
parent c3f111275b
commit 2ef6f111d0
34 changed files with 243 additions and 55 deletions

View File

@@ -9,6 +9,7 @@ import type {
import { getWorkflowInfo } from './GenericFunctions';
import { localResourceMapping } from './methods';
import { generatePairedItemData } from '../../../utils/utilities';
import { getCurrentWorkflowInputData } from '../../../utils/workflowInputsResourceMapping/GenericFunctions';
export class ExecuteWorkflow implements INodeType {
description: INodeTypeDescription = {
@@ -426,6 +427,8 @@ export class ExecuteWorkflow implements INodeType {
const workflowResult = executionResult.data as INodeExecutionData[][];
const fallbackPairedItemData = generatePairedItemData(items.length);
for (const output of workflowResult) {
const sameLength = output.length === items.length;
@@ -434,12 +437,15 @@ export class ExecuteWorkflow implements INodeType {
if (sameLength) {
item.pairedItem = { item: itemIndex };
} else {
item.pairedItem = fallbackPairedItemData;
}
}
}
return workflowResult;
} catch (error) {
const pairedItem = generatePairedItemData(items.length);
if (this.continueOnFail()) {
const metadata = parseErrorMetadata(error);
return [
@@ -447,6 +453,7 @@ export class ExecuteWorkflow implements INodeType {
{
json: { error: error.message },
metadata,
pairedItem,
},
],
];