From 4a9ef27c0bb43007a0224e411f8d4a94b12ed66e Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 19 Dec 2024 15:58:16 +0100 Subject: [PATCH] feat: update flows Signed-off-by: Tomas Dvorak --- src/experimental/flows.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/experimental/flows.ts b/src/experimental/flows.ts index f47bd43..526ef63 100644 --- a/src/experimental/flows.ts +++ b/src/experimental/flows.ts @@ -249,12 +249,12 @@ export class Flow< next = run.steps.at(0)?.name!; } else if (response.next === Flow.PREV) { next = run.steps.at(-2)?.name!; - } else if (response.next === Flow.NEXT) { - next = this.findStep(next).next; } else if (response.next === Flow.SELF) { next = run.steps.at(-1)?.name!; + } else if (!response.next || response.next === Flow.NEXT) { + next = this.findStep(next).next || Flow.END; } else { - next = response.next || Flow.END; + next = response.next; } } catch (error) { await runContext.emitter.emit("error", {