mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Add Activation Trigger (#1570)
* ✨ n8n start trigger node * first declaration of WorkflowActivationMode * implement first WorkflowActivationMode: 'init', 'create', 'update', 'activate' * fix Server missing id * add activation infos to triggers * remove WorkflowActivationMode from webhook execution function * add some missing activation and add manual activation * clean up and fix some code * fix UnhandledPromiseRejectionWarning: Error: Overwrite NodeExecuteFunctions.getExecuteTriggerFunctions.emit function! * fix spaces * use a better name for the node * fix ident in package.json * Contributions to lublak's PR #1287 * Fixed linting issues and change the way parameters are displayed * ⚡ Fix name and minor improvements Co-authored-by: lublak <lublak.de@gmail.com> Co-authored-by: lublak <44057030+lublak@users.noreply.github.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
IWorkflowExecuteAdditionalData,
|
||||
WebhookHttpMethod,
|
||||
Workflow,
|
||||
WorkflowActivateMode,
|
||||
WorkflowExecuteMode,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -161,7 +162,7 @@ export class TestWebhooks {
|
||||
* @returns {(Promise<IExecutionDb | undefined>)}
|
||||
* @memberof TestWebhooks
|
||||
*/
|
||||
async needsWebhookData(workflowData: IWorkflowDb, workflow: Workflow, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, sessionId?: string, destinationNode?: string): Promise<boolean> {
|
||||
async needsWebhookData(workflowData: IWorkflowDb, workflow: Workflow, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, sessionId?: string, destinationNode?: string): Promise<boolean> {
|
||||
const webhooks = WebhookHelpers.getWorkflowWebhooks(workflow, additionalData, destinationNode);
|
||||
|
||||
if (webhooks.length === 0) {
|
||||
@@ -193,7 +194,7 @@ export class TestWebhooks {
|
||||
};
|
||||
|
||||
try {
|
||||
await this.activeWebhooks!.add(workflow, webhookData, mode);
|
||||
await this.activeWebhooks!.add(workflow, webhookData, mode, activation);
|
||||
} catch (error) {
|
||||
activatedKey.forEach(deleteKey => delete this.testWebhookData[deleteKey] );
|
||||
await this.activeWebhooks!.removeWorkflow(workflow);
|
||||
|
||||
Reference in New Issue
Block a user