mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-11 07:04:06 -08:00
b03e358a12
* 👕 Enable `consistent-type-imports` for nodes-base
* 👕 Apply to nodes-base
* ⏪ Undo unrelated changes
* 🚚 Move to `.eslintrc.js` in nodes-base
* ⏪ Revert "Enable `consistent-type-imports` for nodes-base"
This reverts commit 529ad72b05
.
* 👕 Fix severity
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import type { ITriggerFunctions } from 'n8n-core';
|
||
import type { 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,
|
||
};
|
||
}
|
||
}
|