Fix issue with branching bindings

This commit is contained in:
Peter Clement 2024-11-04 09:42:33 +00:00
parent 81d01bc0cf
commit 09e5bad62e
2 changed files with 12 additions and 2 deletions

View File

@ -39,9 +39,17 @@ export const definition: AutomationStepDefinition = {
branchName: {
type: AutomationIOType.STRING,
},
result: {
status: {
type: AutomationIOType.STRING,
description: "Branch result",
},
branchId: {
type: AutomationIOType.STRING,
description: "Branch ID",
},
success: {
type: AutomationIOType.BOOLEAN,
description: "Whether the condition was met",
description: "Branch success",
},
},
required: ["output"],

View File

@ -516,6 +516,7 @@ class Orchestrator {
const condition = await this.evaluateBranchCondition(branch.condition)
if (condition) {
const branchStatus = {
branchName: branch.name,
status: `${branch.name} branch taken`,
branchId: `${branch.id}`,
success: true,
@ -528,6 +529,7 @@ class Orchestrator {
branchStatus
)
this.context.steps[this.context.steps.length] = branchStatus
this.context.stepsById[branchStep.id] = branchStatus
const branchSteps = children?.[branch.id] || []
// A final +1 to accomodate the branch step itself