If

type: if
step:
  name: "Role-based Action"
  condition: "user.role == 'admin'"
  then:
    - type: http
      step:
        name: "Admin Action"
        method: POST
        url: "/admin/action"
  else:
    - type: http
      step:
        name: "User Action"
        method: POST
        url: "/user/action"
FieldTypeRequiredDescription
typestringYesMust be "if"
namestringYesDescriptive name for the condition
conditionexprYesExpression that evaluates to true or false
thenlist<step>YesSteps to execute if condition is true
elselist<step>NoSteps to execute if condition is false

Description
Conditional steps allow branching logic based on evaluated expressions. The condition field is an expr expression that must return a boolean value. If it evaluates to true, the steps in then execute; otherwise, the steps in else execute (if present).

Note

The else block is optional.