mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Manually reverted PR 11716 Do not assign all paired items (no-changelog) (#13429)
This commit is contained in:
@@ -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,
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user