Skip to main content
All CollectionsScade tools
Conditional IF node
Conditional IF node
Updated over 3 weeks ago

Conditional branching node

A Conditional branching node is a special tool in Scade.pro workflows that helps make decisions based on specific rules or conditions. It looks at input data and decides which direction the workflow should take. This makes workflows smarter and more efficient.

Why use a сonditional branching node?

Dynamic workflows

Adjust the workflow automatically based on the input data.

Save time and resources

Skip unnecessary steps, making the workflow faster.

Custom logic

Create workflows that can handle different situations without needing separate setups.

Flexibility

Easily adapt workflows to different user needs or scenarios.


How does it work?

Set a condition

The node checks a condition, like “Is the input image provided?” or “Did the user select a specific model?”.

Example of a condition:

“{{context[‘start’][‘Model’] == ‘Quality’}}”

This checks if the “Model” input is set to “Quality.”

cond_2

Follow the path

If the condition is true, one path is followed.

If the condition is false, another path is used.

Connect to other nodes

You can connect the outputs (true or false) to different parts of your workflow.
Example is based on the FLUX models template.

cond_3


Examples of conditions

Equal (==)

Example: Check if the selected model is “Quality.”

“{{context[‘start’][‘Model’] == ‘Quality’}}”

Not equal (!=)

Example: Check if the user did not provide an image.

“{{context[‘input’][‘image’] != None}}”

If you are an experienced user, please refer to the Jinja2 expressions documentation available at: Jinja2 Expressions

When using a tumbler in the start node, you can connect to the node directly without stating conditions.


In case we have true

true

and false

false


Best practices

Write clear conditions

Keep the logic simple and easy to understand.

Avoid unnecessary steps

Only add branches when they add value to the workflow.

Test all paths

Ensure that both true and false branches work correctly.

By using Conditional branching nodes, you can make workflows smarter, faster, and more tailored to different needs!

Did this answer your question?