Skip to content

Condition Node

Condition Nodes allow you to create branches in a workflow, directing actions based on whether certain conditions are met. This helps control the flow’s execution.

The node can handle three types of conditions:

  • If: Directs the flow to a specific path if certain criteria (Node, Context, or Value) are met.
  • Else: Sets the node connection when no condition is met, allowing you to configure the next node to connect to.
  • Else If: Allows you to configure another set of criteria (Node, Context, or Value) to be met when the initial If condition is not satisfied.

Note

Due to security reasons, a condition can be called a maximum of 10 times in an agent flow. Exceeding this limit will result in an error.

Add and Configure a Condition Node

Setting up a Condition node in an Agent Flow involves adding the node at the appropriate location in the flow and configuring various node properties, as explained below.

Steps to add and configure the node:

  1. On the Agents tab, click the name of the agent to which you want to add the node. The Agent Flow page is displayed.

  2. Click the Go to flow button for the in-development version of the flow for editing.

  3. In the flow builder, click the “+” icon on any existing node on the canvas and select Condition from the pop-up menu. (Alternatively, you can drag the Condition node from the Assets panel onto the canvas.)

  4. Click the added node to open its properties dialog box. The General Settings for the node are displayed.
    Condition Node Settings

  5. Enter or select the following information:

    • Custom Name: Enter an appropriate name for the node.
    • If/Else Condition: Define the IF ELSE/ELSE IF conditions using context variables and the AND/OR operator. You can use Node, Context, or Value.

      1. In the IF section, select the context variable you want to use - enter "{{context." and select the node/variable from the list and then close the braces with "}}".
        Using Context Variable

        For example:

        {{context.ambiguous_sub_categories}}
        

      2. Select an appropriate Operator from the drop-down list. For example, Contains.

      3. Enter the value for the condition. If you want to use a context variable, start entering "{{context." and then select the node/variable, and then close the braces with "}}".

        For example:

        {{context.steps.Sub_Category_Detection.output}}   
        

      4. Additionally, you can use an AND/OR logical operator to add more criteria to the condition.

      5. In the Then Go To drop-down list, select the node to connect to if the condition is met.

      6. In the ELSE section, select the node you want to trigger if the IF condition fails.
        Condition Node's Settings

  6. Finally, test the flow and fix any issues found: Click the Run Flow button at the top-right corner of the flow builder.

Standard Error

If a condition is true or false but has no connected node, the following error message is displayed: "Path not defined. Please check the flow."