diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index 65361586fe..4593f90664 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -74,8 +74,11 @@ export class WorkflowExecute { * @returns {(Promise)} * @memberof WorkflowExecute */ - // @ts-ignore - async run(workflow: Workflow, startNode?: INode, destinationNode?: string): PCancelable { + // IMPORTANT: Do not add "async" to this function, it will then convert the + // PCancelable to a regular Promise and does so not allow canceling + // active executions anymore + // eslint-disable-next-line @typescript-eslint/promise-function-async + run(workflow: Workflow, startNode?: INode, destinationNode?: string): PCancelable { // Get the nodes to start workflow execution from startNode = startNode || workflow.getStartNode(destinationNode); @@ -134,8 +137,11 @@ export class WorkflowExecute { * @returns {(Promise)} * @memberof WorkflowExecute */ - // @ts-ignore - async runPartialWorkflow( + // IMPORTANT: Do not add "async" to this function, it will then convert the + // PCancelable to a regular Promise and does so not allow canceling + // active executions anymore + // eslint-disable-next-line @typescript-eslint/promise-function-async + runPartialWorkflow( workflow: Workflow, runData: IRunData, startNodes: string[], @@ -576,8 +582,11 @@ export class WorkflowExecute { * @returns {Promise} * @memberof WorkflowExecute */ - // @ts-ignore - async processRunExecutionData(workflow: Workflow): PCancelable { + // IMPORTANT: Do not add "async" to this function, it will then convert the + // PCancelable to a regular Promise and does so not allow canceling + // active executions anymore + // eslint-disable-next-line @typescript-eslint/promise-function-async + processRunExecutionData(workflow: Workflow): PCancelable { Logger.verbose('Workflow execution started', { workflowId: workflow.id }); const startedAt = new Date(); @@ -1063,8 +1072,7 @@ export class WorkflowExecute { startedAt: Date, workflow: Workflow, executionError?: ExecutionError, - // @ts-ignore - ): PCancelable { + ): Promise { const fullRunData = this.getFullRunData(startedAt); if (executionError !== undefined) {