diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index b37ec8dc73..d13be8d410 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -400,7 +400,7 @@ class Orchestrator { ) } catch (err) { this.updateContextAndOutput( - pathStepIdx, + pathStepIdx + 1, steps[stepToLoopIndex], {}, { @@ -420,7 +420,7 @@ class Orchestrator { (loopStep.inputs.iterations && loopStepIndex === maxIterations) ) { this.updateContextAndOutput( - pathStepIdx, + pathStepIdx + 1, steps[stepToLoopIndex], { items: this.loopStepOutputs, @@ -447,7 +447,7 @@ class Orchestrator { if (isFailure) { this.updateContextAndOutput( - pathStepIdx, + pathStepIdx + 1, steps[stepToLoopIndex], { items: this.loopStepOutputs,