# Create Conditional Paths with If/Else

# Create Conditional Paths with If/Else

Use an If/Else component to introduce decision points in your workflow. Based on the values available during execution, the flow can continue down different branches.

  • Step 1: Add and Link the Component

    • Drag the If/Else component from the "Flow Control" section of the Component Panel onto the canvas and link it to a preceding node.
  • Step 2: Build the Condition

    • In the Configuration Panel, build your logical condition by defining the operands and operator:
      • First Operand: Select an output variable from a previous step (e.g., the status code from an API call, a classification result from an AI Agent).

      • Logical Operator: Choose an operator from the dropdown (e.g., equals, contains, is greater than).

      • Second Operand: Enter a static value (e.g., the string "Success") or map a dynamic value from another component's output.

You can expand your conditional logic by clicking the + Else If or + Add Condition buttons to create additional evaluation criteria:

  • + Else If: This adds a new, mutually exclusive condition to the sequence. The workflow evaluates each condition in order (If, then Else If 1, then Else If 2, etc.) and executes the action for the first condition that is met. This is ideal for defining a hierarchy of rules.

  • + Add Condition: This button adds an extra check to the current If or Else If statement. You can combine multiple criteria using AND or OR operators. The action for that branch will only execute if all combined conditions within that single statement are true (for an AND operator) or if at least one condition is true (for an OR operator).

  • Step 3: Build the Conditional Paths
    • Add subsequent components to the separate True and False branches that extend from the If/Else component. This defines the unique sequence of actions the workflow will take depending on whether the condition is met.