diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index df84915d7..82418016d 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -918,6 +918,19 @@ export class WorkflowExecute { this.runExecutionData.resultData.runData[executionNode.name].push(taskData); + if (this.runExecutionData.waitTill!) { + await this.executeHook('nodeExecuteAfter', [ + executionNode.name, + taskData, + this.runExecutionData, + ]); + + // Add the node back to the stack that the workflow can start to execute again from that node + this.runExecutionData.executionData!.nodeExecutionStack.unshift(executionData); + + break; + } + if ( this.runExecutionData.startData && this.runExecutionData.startData.destinationNode && @@ -935,19 +948,6 @@ export class WorkflowExecute { continue; } - if (this.runExecutionData.waitTill!) { - await this.executeHook('nodeExecuteAfter', [ - executionNode.name, - taskData, - this.runExecutionData, - ]); - - // Add the node back to the stack that the workflow can start to execute again from that node - this.runExecutionData.executionData!.nodeExecutionStack.unshift(executionData); - - break; - } - // Add the nodes to which the current node has an output connection to that they can // be executed next if (workflow.connectionsBySourceNode.hasOwnProperty(executionNode.name)) {