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,
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];
}
}