Definition
When input parameters are fed into this node, it will first determine if it meets the conditions under the IF section; if so, it executes the corresponding IF workflow branch; otherwise, it executes the corresponding ELSE workflow branch.
Each branch condition supports the addition of multiple judgment conditions (AND/OR) and supports adding ELIF conditional branches.

Why use IF/ELSE?
- Dynamic Responses: Tailor your AI's actions or outputs based on real-time data.
- Error Handling: Reroute the workflow if an expected condition isn't met (e.g., "if data is missing, then notify user").
- Personalization: Create customized experiences for different user segments.
- Efficiency: Avoid unnecessary processing by only executing relevant steps.
Quick Start / How to Use
Node Configuration Details: In GoInsight.AI InsightFlow canvas, tap on "+ 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

Taking the above Medical Inquiry Routing Workflow as an example:
- IF Condition: The input variable result is equal to 1. This value could represent a patient's selection for a specific service, such as a routine vision test.
If the condition evaluates to True (meaning the input result is 1), the workflow follows the IF path. This triggers the "Answer Myopia examination" node, which provides a targeted reply: "Regarding your vision, please start by taking the vision screening chart test."
- ELIF Condition: If the initial IF condition evaluates to False(i.e., the result is not 1), the workflow proceeds to check the next condition in sequence, which is the ELIF condition. The ELIF condition is set to check if the result is equal to 2. This could represent a more general consultation.
If this ELIF condition is True, the workflow follows that path, executing the "Answer ophthalmology" node with the response: "Please consult with the ophthalmology department for your query."
- ELSE Path: If both the IF and the ELIF conditions evaluate to False (meaning the input result is neither 1 nor 2), the workflow defaults to executing the final ELSE path.
This path triggers the "Answer General" node, which acts as a catch-all for any other inquiries, providing a standard response: "For all other inquiries, please consult the reception desk."
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. |
Leave a Reply.