mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 23:54:07 -08:00
df5d07bcb8
## Summary Title self explanatory ## Related tickets and issues https://linear.app/n8n/issue/ADO-129/update-copy-execute-test ## Review / Merge checklist - [x] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
46 lines
1,003 B
TypeScript
46 lines
1,003 B
TypeScript
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 "Test Workflow"',
|
||
color: '#909298',
|
||
},
|
||
|
||
inputs: [],
|
||
outputs: ['main'],
|
||
properties: [
|
||
{
|
||
displayName:
|
||
'This node is where a manual workflow execution starts. To make one, go back to the canvas and click test workflow’',
|
||
name: 'notice',
|
||
type: 'notice',
|
||
default: '',
|
||
},
|
||
],
|
||
};
|
||
|
||
async trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {
|
||
const manualTriggerFunction = async () => {
|
||
this.emit([this.helpers.returnJsonArray([{}])]);
|
||
};
|
||
|
||
return {
|
||
manualTriggerFunction,
|
||
};
|
||
}
|
||
}
|