fix(core): Missing pairing info (#7326)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Michael Kret
2023-10-10 18:36:20 +03:00
committed by GitHub
parent 6479eb180f
commit e2c3c7aceb
52 changed files with 363 additions and 157 deletions

View File

@@ -15,6 +15,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import { generatePairedItemData } from '../../utils/utilities';
export class Kafka implements INodeType {
description: INodeTypeDescription = {
@@ -257,6 +258,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;
@@ -396,10 +398,15 @@ export class Kafka implements INodeType {
await producer.disconnect();
return [this.helpers.returnJsonArray(responseData)];
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
{ itemData },
);
return [executionData];
} catch (error) {
if (this.continueOnFail()) {
return [this.helpers.returnJsonArray({ error: error.message })];
return [[{ json: { error: error.message }, pairedItem: itemData }]];
} else {
throw error;
}