| | import { |
| | IExecuteFunctions, |
| | INodeExecutionData, |
| | INodeType, |
| | INodeTypeDescription, |
| | } from 'n8n-workflow'; |
| |
|
| | export class ClassNameReplace implements INodeType { |
| | description: INodeTypeDescription = { |
| | displayName: 'DisplayNameReplace', |
| | name: 'N8nNameReplace', |
| | group: ['transform'], |
| | version: 1, |
| | description: 'NodeDescriptionReplace', |
| | defaults: { |
| | name: 'DisplayNameReplace', |
| | color: '#772244', |
| | }, |
| | inputs: ['main'], |
| | outputs: ['main'], |
| | properties: [ |
| | |
| | |
| | { |
| | displayName: 'My String', |
| | name: 'myString', |
| | type: 'string', |
| | default: '', |
| | placeholder: 'Placeholder value', |
| | description: 'The description text', |
| | }, |
| | ], |
| | }; |
| |
|
| | async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { |
| | const items = this.getInputData(); |
| |
|
| | let item: INodeExecutionData; |
| | let myString: string; |
| |
|
| | |
| | |
| | |
| | for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { |
| | myString = this.getNodeParameter('myString', itemIndex, '') as string; |
| | item = items[itemIndex]; |
| |
|
| | item.json.myString = myString; |
| | } |
| |
|
| | return [items]; |
| | } |
| | } |
| |
|