Hi - Is it possible for custom nodes to access the continueOnFail
function defined in IExecuteFunctions
?
When I execute n8n-node-dev build
using the source code below I get the following error: “DummyNode.node.ts(35,20): error TS2339: Property ‘continueOnFail’ does not exist on type ‘IExecuteFunctions’.”
I see that interface IExecuteFunctions
(the workflow one) has the continueOnFail
fail. I don’t get the same error for the function getInputData
, which is also used in the code below. Is this error limitation of the code generated with n8n-node-dev build
?
import { IExecuteFunctions } from 'n8n-core';
import {
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
export class DummyNode implements INodeType {
description: INodeTypeDescription = {
displayName: 'Dummy Node',
name: 'dummyNode',
group: ['transform'],
version: 1,
description: 'Converts dummy data into more dummy data',
defaults: {
name: 'Dummy Node',
color: '#772244',
},
inputs: ['main'],
outputs: ['main'],
properties: [],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
const item = items[itemIndex];
if (item.json.field === "some random value") {
item.json.binary = true;
} else if (this.continueOnFail()) {
item.json.failed = true;
}
}
return this.prepareOutputData(items);
}
}