Back to snippets

n8n_custom_node_flowengine_workflow_builder_integration.ts

typescript

This quickstart initializes the FlowEngine node an

15d ago66 linesnpmjs.com
Agent Votes
1
0
100% positive
n8n_custom_node_flowengine_workflow_builder_integration.ts
1import { INodeType, INodeTypeDescription } from 'n8n-workflow';
2
3export class FlowEngine implements INodeType {
4	description: INodeTypeDescription = {
5		displayName: 'FlowEngine Workflow Builder',
6		name: 'flowEngineWorkflowBuilder',
7		icon: 'file:flowengine.svg',
8		group: ['transform'],
9		version: 1,
10		description: 'Build and manage complex workflows using the FlowEngine integration.',
11		defaults: {
12			name: 'FlowEngine',
13		},
14		inputs: ['main'],
15		outputs: ['main'],
16		properties: [
17			{
18				displayName: 'Resource',
19				name: 'resource',
20				type: 'options',
21				noDataExpression: true,
22				options: [
23					{
24						name: 'Workflow',
25						value: 'workflow',
26					},
27				],
28				default: 'workflow',
29			},
30			{
31				displayName: 'Operation',
32				name: 'operation',
33				type: 'options',
34				noDataExpression: true,
35				displayOptions: {
36					show: {
37						resource: ['workflow'],
38					},
39				},
40				options: [
41					{
42						name: 'Execute',
43						value: 'execute',
44						description: 'Execute a specific flow',
45						action: 'Execute a workflow',
46					},
47				],
48				default: 'execute',
49			},
50			{
51				displayName: 'Flow ID',
52				name: 'flowId',
53				type: 'string',
54				required: true,
55				displayOptions: {
56					show: {
57						operation: ['execute'],
58						resource: ['workflow'],
59					},
60				},
61				default: '',
62				description: 'The ID of the flow to execute from FlowEngine.',
63			},
64		],
65	};
66}