Flow Basics
If-Else
This document explains the If-Else node, which creates conditional branches in your workflow based on specific conditions.
Node Inputs
Required Fields
- Condition Type: The type of comparison to make
- Condition Value: The value to compare against (when applicable)
Optional Fields
- Pass Inputs Through: Makes input values of the wrapped node available as outputs
Node Output
- Evaluated Condition: Boolean (true/false) result of the condition
- Pass Through Values: Values for both conditions
- Inputs: Inputs of the wrapped node [If enabled]
Node Functionality
The If-Else node is like a traffic controller for your data. It:
- Wraps around other nodes
- Evaluates their outputs
- Creates two possible paths (true/false)
- Routes data accordingly
Common Use Cases
- Error Handling:
- Data Validation:
- Threshold Routing:
Step-by-Step Usage
- Drag If-Else onto canvas
- Place target node inside
- Set condition type
- Connect true/false outputs
- Test both paths
Working with Join Paths
The If-Else node is commonly used in conjunction with the Join Paths node to reconnect conditional branches.
Benefits of Using Join Paths with If-Else
- Eliminates the need for duplicate nodes after conditional branches
- Maintains cleaner, more maintainable workflows
- Preserves original data types through the execution path
- Reduces redundant operations
Implementation Example
Best Practices
- Add Join Paths after conditional logic is complete
- Connect both true and false paths to Join Paths inputs
- Continue your workflow from the Join Paths output
- Test all conditional paths to ensure proper flow
Additional Resources
- Video Tutorial
- Join Paths Documentation
- Example Flows:
In summary, the If-Else node, especially when combined with Join Paths, lets you create smart, branching workflows that make decisions based on your data conditions while maintaining clean and efficient processing paths.