From b2ba2d1cf1fb712a9628edf0fe0547c81705eb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 21 Oct 2024 17:00:23 +0200 Subject: [PATCH] Update ExampleNode.node.ts --- nodes/ExampleNode/ExampleNode.node.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nodes/ExampleNode/ExampleNode.node.ts b/nodes/ExampleNode/ExampleNode.node.ts index a11e428..18c82f4 100644 --- a/nodes/ExampleNode/ExampleNode.node.ts +++ b/nodes/ExampleNode/ExampleNode.node.ts @@ -1,10 +1,10 @@ -import { +import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, - NodeOperationError, } from 'n8n-workflow'; +import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; export class ExampleNode implements INodeType { description: INodeTypeDescription = { @@ -16,8 +16,8 @@ export class ExampleNode implements INodeType { defaults: { name: 'Example Node', }, - inputs: ['main'], - outputs: ['main'], + inputs: [NodeConnectionType.Main], + outputs: [NodeConnectionType.Main], properties: [ // Node properties which the user gets displayed and // can change on the node. @@ -50,7 +50,7 @@ export class ExampleNode implements INodeType { myString = this.getNodeParameter('myString', itemIndex, '') as string; item = items[itemIndex]; - item.json['myString'] = myString; + item.json.myString = myString; } catch (error) { // This node should never fail but we want to showcase how // to handle errors. @@ -71,6 +71,6 @@ export class ExampleNode implements INodeType { } } - return this.prepareOutputData(items); + return [items]; } }