Definition
Allows you to split the workflow into two branches based on if/else conditions. A conditional branching node has three parts:- IF Condition: Select a variable, set the condition, and specify the value that satisfies the condition.
- IF condition evaluates to
True, execute the IF path. - IF condition evaluates to
False, execute the ELSE path. - If the ELIF condition evaluates to
True, execute the ELIF path; - If the ELIF condition evaluates to
False, continue to evaluate the next ELIF path or execute the final ELSE path.
- Contains
- Not contains
- Starts with
- Ends with
- Is
- Is not
- Is empty
- Is not empty
Scenario
Taking the above Text Summary Workflow as an example:
- IF Condition: Select the
summarystylevariable from the start node, with the condition Containstechnical. - IF condition evaluates to
True, follow the IF path by querying technology-related knowledge through the knowledge retrieval node, then respond via the LLM node (as shown in the upper half of the diagram); - IF condition evaluates to
False, but anELIFcondition is added, where the input for thesummarystylevariable does not includetechnology, yet theELIFcondition includesscience, check if the condition inELIFisTrue, then execute the steps defined within that path; - If the condition within
ELIFisFalse, meaning the input variable contains neithertechnologynorscience, continue to evaluate the nextELIFcondition or execute the finalELSEpath; - IF condition evaluates to
False, i.e., thesummarystylevariable input does not containtechnical, execute the ELSE path, responding via the LLM2 node (lower part of the diagram).
