Update ExampleNode.node.ts

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-10-21 17:00:23 +02:00 committed by GitHub
commit b2ba2d1cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,10 @@
import { import type {
IExecuteFunctions, IExecuteFunctions,
INodeExecutionData, INodeExecutionData,
INodeType, INodeType,
INodeTypeDescription, INodeTypeDescription,
NodeOperationError,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
export class ExampleNode implements INodeType { export class ExampleNode implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
@ -16,8 +16,8 @@ export class ExampleNode implements INodeType {
defaults: { defaults: {
name: 'Example Node', name: 'Example Node',
}, },
inputs: ['main'], inputs: [NodeConnectionType.Main],
outputs: ['main'], outputs: [NodeConnectionType.Main],
properties: [ properties: [
// Node properties which the user gets displayed and // Node properties which the user gets displayed and
// can change on the node. // can change on the node.
@ -50,7 +50,7 @@ export class ExampleNode implements INodeType {
myString = this.getNodeParameter('myString', itemIndex, '') as string; myString = this.getNodeParameter('myString', itemIndex, '') as string;
item = items[itemIndex]; item = items[itemIndex];
item.json['myString'] = myString; item.json.myString = myString;
} catch (error) { } catch (error) {
// This node should never fail but we want to showcase how // This node should never fail but we want to showcase how
// to handle errors. // to handle errors.
@ -71,6 +71,6 @@ export class ExampleNode implements INodeType {
} }
} }
return this.prepareOutputData(items); return [items];
} }
} }