If Else
Enhanced
Direct integration with Langfuse tracing
Flowise allows you to split your chatflow into different branches depending on If/Else condition.
 (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png)
Input Variables
 (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png)
As noticed from the image above, it takes in any nodes that has json output. Some examples are: Custom Function, LLM Chain Output Prediction, Get/Set Variables.
 (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png)
You can then give a variable name:
 (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png)
This variable can then be used in the If Function and Else Function with the prefix $. For example:
$outputIf Else Name
You can name the node for easier visualization of what it does.
If Function
This is a piece of JS code that is ran on Node sandbox. It must:
- Contains the
ifstatement - Returns a value within
ifstatement
 (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png)
This gives much more flexibility for users to do complex comparison like regex, date comparsion and many more.
Else Function
Similar to If Function, it must returns a value. This function will only be ran if the If Function does not return a value.
 (1) (1) (1) (1) (1) (1) (2) (1) (1).png)
Output
 (1) (1) (1) (1) (1) (1) (2) (1).png)
When the If Function successfully returns a value, it will be passed to the True output dot as shown above. This allow users to pass the value to the next node.
Otherwise, the returned value from Else Function will be passed to the False output dot.
User can also take a look at the If Else template in the marketplace:
 (1) (1) (1) (1) (2) (1) (1).png)