From 90f3d28bb5aef7df793db4280e80fb16839d2467 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 5 Jan 2023 10:52:50 +0000 Subject: [PATCH] fix for looping issue wher output was incorrect --- packages/server/src/threads/automation.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 315a508da2..e53155970f 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -419,7 +419,7 @@ class Orchestrator { // Delete the step after the loop step as it's irrelevant, since information is included // in the loop step - if (wasLoopStep) { + if (wasLoopStep && !loopStep) { this._context.steps.splice(loopStepNumber + 1, 1) wasLoopStep = false } @@ -438,8 +438,7 @@ class Orchestrator { }) this._context.steps[loopStepNumber] = tempOutput - loopSteps = undefined - wasLoopStep = true + loopSteps = [] } }