From 3195e997bafbc63cc7dd02729190f8df8e521484 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 6 Oct 2021 11:51:58 -0500 Subject: [PATCH] :bug: Fix issue part-workflow execution wait-node being the last --- packages/core/src/WorkflowExecute.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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)) {