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

@@ -14,6 +14,8 @@ import type {
} from 'n8n-workflow';
import { ApplicationError, NodeConnectionType, NodeOperationError } from 'n8n-workflow';
import { generatePairedItemData } from '../../utils/utilities';
export class Kafka implements INodeType {
description: INodeTypeDescription = {
displayName: 'Kafka',
@@ -258,6 +260,7 @@ export class Kafka implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const itemData = generatePairedItemData(items.length);
const length = items.length;
@@ -397,12 +400,15 @@ export class Kafka implements INodeType {
await producer.disconnect();
const executionData = this.helpers.returnJsonArray(responseData);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
{ itemData },
);
return [executionData];
} catch (error) {
if (this.continueOnFail()) {
return [[{ json: { error: error.message } }]];
return [[{ json: { error: error.message }, pairedItem: itemData }]];
} else {
throw error;
}