Definition
The 'IF/ELSE' node branches the process flow based on conditions such as IF, ELIF, ELSE, etc. When the flow reaches this node, it evaluates the predefined conditions and determines the subsequent execution path based on the evaluation results. This allows for flexible control and tailored execution of the flow, enabling it to respond specifically to different situations. The main functionalities include:
- Branch Logic Control:Execute different branch operations (such as approval processes or error handling) based on the variable values.
- Dynamic Path Selection:Implement complex business rule evaluations through condition combinations (AND/OR).
- Flow Optimization:Reduce redundant nodes by merging similar process paths through logical judgments.

Quick Start / How to Use
Node Configuration Details: In ChatInsight, right-click and select "Add Node" to add an IF/ELSE node to the workflow.

1. Configure the IF Parameters of the IF/ELSE Node

- Set variable value (x)
- In the "If" section's "(x) Set Variable Value" input box, enter the variable for condition evaluation. This variable can be a result produced by earlier steps in the flow, such as order amount, user level, etc.
- Select operator
- From the "Operator" dropdown menu, choose the appropriate operator. Common operators include "Equal to," "Not Equal to," "Greater than," "Less than," "Contains," "Does not contain," etc., based on business needs.
- Input Condition Value
- In the "Value" input box, enter the value to compare with the variable. For example, if the operator is "Equals" and the variable is the order amount, then input a specific monetary value here.
The IF/ELSE node supports a variety of operator types to meet the data evaluation needs of different business scenarios. Below is an explanation of the usage of different operators:
Operator | Explanation | For example |
---|---|---|
Contains | Determines whether the specified text contains a specific string. | checking if a user-inputted text includes the keyword 'discount’. |
Does Not Contain | it checks that the specified text does not contain a specific string. | The opposite of "Contains" |
Starts With | Checks if the text begins with a specific string. | verifying whether a filename starts with "Report" |
Ends With | Determines if the text ends with a specific string. Commonly used for file format validation | checking whether a file ends with ".txt" |
Is Empty | Used to check whether a variable or data is empty. Applicable in scenarios. | verifying if user input is empty or if a database query result is empty. |
Is Not Empty | it checks if a variable or data has a specific value. | The opposite of "Is Empty" |
Equals | Checks that two values are equal. Applicable for comparisons across various data types. | numerical values, text, and dates–for example, checking whether an order status equals completed. |
Does Not Equal | Checks that two values are not equal. | serving as the reverse check of "Equals" |
In | Checks whether a value exists within a specified collection. | verifying whether a specific product ID is in a list of popular product IDs. |
Is True | Checks whether the evaluation result of the input condition is logically true. | truthy |
Is False | Checks whether the evaluation result of the input condition is logically false. | falsy |
2. Configure ELIF Parameters for the IF/ELSE Node
ELIF is used to evaluate other conditions when the IF condition is not met. You can click the "+ Add ELIF” button and configure it by setting the variable value (x), selecting the operator, and entering the condition value.

- Add Conditions or ELIF(Optional)If multiple conditions need to be satisfied simultaneously (AND logic) or if at least one of the conditions needs to be satisfied (OR logic), you can click the "+ Add Condition or ELIF” button to add multiple conditions. In the newly appeared condition setting area, repeat the steps for setting the variable value, selecting the operator, and entering the condition value. Based on the logical relationship between the conditions, choose the "AND” or "OR” button to connect them.
3. Configure ELSE Parameters for the IF/ELSE Node
ELSE is used to define the logic to be executed when the IF condition and all ELIF conditions are not met. Typically, you will input or configure the actions that should occur in this case in the area below "ELSE," such as returning a default value or executing a specific process branch.

Typical Use Cases
- Enterprise Applications:Conditional branching nodes are widely used across various business processes within enterprises to determine the flow based on different business conditions. For example, in the procurement process, the cost amount of a purchase may determine whether it needs to go through a higher level of approval; in project management processes, the completion status of project progress and quality indicators may decide whether additional reviews or adjustments are necessary.
- Automated Testing:In automated testing scripts, conditional branching nodes decide the next testing operation based on test results or specific conditions. For instance, when executing a set of software functionality test cases, if a particular test case fails and the failure type is "critical functionality defect," the testing should be paused, and immediate error handling should be performed, including logging the error and notifying developers. If the failure type is "minor interface display issue," the next test case should continue to be executed, and after all test cases are completed, the minor issues should be summarized for processing.
Practical Case Scenario

Steps for Designing a Workflow Based on Classification Results:
The core is a conditional judgment node (IF), which performs branching operations based on the results of "LLM Information Classification":
- If the condition is met (ELIF):
- When "Text contains new product release," execute the "New Product Release Handling" operation.
- If the condition is not met (ELSE):
- Execute the "Other Handling" operation.
In workflows involving multiple operation nodes and judgment conditions, different processing flows can be determined based on specific text classification results.
Notes
- Reduce Nesting Levels: It is recommended to split sub-processes if there are more than 3 levels of nesting, as a flatter structure is easier to maintain.
Program | Use cases | Advantages and Disadvantages |
---|---|---|
Nesting Conditions | There is a hierarchical dependency between conditions. | Logical and intuitive, but has high maintenance costs. |
Flattening | Conditions are independent and have no priority requirements. | Better performance, but may lead to redundant judgment logic. |