n8n/packages/nodes-base/nodes/ManualTrigger/ManualTrigger.node.ts
कारतोफ्फेलस्क्रिप्ट™ 7a4e9ef5fa
refactor: Remove n8n-core dependency in nodes-base (no-changelog) (#5649)
2023-03-09 18:13:15 +01:00

46 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type {
ITriggerFunctions,
INodeType,
INodeTypeDescription,
ITriggerResponse,
} from 'n8n-workflow';
export class ManualTrigger implements INodeType {
description: INodeTypeDescription = {
displayName: 'Manual Trigger',
name: 'manualTrigger',
icon: 'fa:mouse-pointer',
group: ['trigger'],
version: 1,
description: 'Runs the flow on clicking a button in n8n',
eventTriggerDescription: '',
maxNodes: 1,
defaults: {
name: 'When clicking "Execute Workflow"',
color: '#909298',
},
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
inputs: [],
outputs: ['main'],
properties: [
{
displayName:
'This node is where a manual workflow execution starts. To make one, go back to the canvas and click execute workflow',
name: 'notice',
type: 'notice',
default: '',
},
],
};
async trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {
const manualTriggerFunction = async () => {
this.emit([this.helpers.returnJsonArray([{}])]);
};
return {
manualTriggerFunction,
};
}
}