mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-10-28 14:12:24 -05:00
Update ExampleNode.node.ts
This commit is contained in:
parent
7eb8838df5
commit
b2ba2d1cf1
1 changed files with 6 additions and 6 deletions
|
|
@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue