Documentation Index
Fetch the complete documentation index at: https://slatehq.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
What is the If/Else Block?
The If/Else block splits your workflow into two paths based on a condition. If the condition is true, the workflow takes one path. If false, it takes the other. After the branch completes, the workflow merges back and continues. Common use cases:- Skip steps when a value is empty or missing
- Route content to different processing based on keyword difficulty
- Handle high-volume vs. low-volume keywords differently
- Check if an API call succeeded before using its output
- Apply different prompts based on content type
How Does the If/Else Block Work?
The If/Else block works in three stages:1. Evaluate Condition
The block checks your condition (e.g., “Is search volume greater than 1000?”) and produces a true or false result.2. Execute Branch
Based on the result:- True → runs the left branch
- False → runs the right branch
3. Merge and Continue
After the branch finishes, the workflow merges back at the end node and continues with the next step. The output of whichever branch ran is available to later steps.Configuring Conditions
Single Condition
Each condition has three parts:- Value (left side) — the value to check. Can be a fixed value or a variable like
{{step_1.output.volume}} - Operator — how to compare
- Compare with (right side) — the value to compare against
Multiple Conditions
You can add more than one condition and combine them with AND or OR:- AND — all conditions must be true for the result to be true
- OR — at least one condition must be true for the result to be true
Available Operators
| Operator | What it checks |
|---|---|
| Equal to | Values are the same |
| Not equal to | Values are different |
| Greater than | Left value is larger than right |
| Less than | Left value is smaller than right |
| Greater than or equal to | Left value is larger or the same |
| Less than or equal to | Left value is smaller or the same |
| Contains | Left value includes the right value as text |
| Not contains | Left value does not include the right value as text |
Values are automatically converted to the appropriate type for comparison. For example,
"100" and 100 are treated as the same number when using numeric operators.Using Variables in Conditions
Both sides of a condition support variables from previous steps using{{variable}} syntax.
Common patterns:
Branch Directions
When you add an If/Else block to your workflow, two branches appear:- Left branch (true) — runs when the condition is true
- Right branch (false) — runs when the condition is false
Output
The If/Else block’s output contains the result of whichever branch executed. Later steps can reference the output using:Common Patterns
Pattern 1: Filter by Keyword Difficulty
Pattern 2: Check for Empty Results
Pattern 3: Route by Content Type
Pattern 4: Conditional Processing Inside a Loop
Troubleshooting
Condition always evaluates to false
Check that your variable references are correct. Add a Text block before the If/Else block to inspect the value with{{step_X.output}} and verify it contains what you expect.
Wrong branch executes
Verify the operator matches your intent. “Greater than” is strict — a value of exactly 1000 is NOT greater than 1000. Use “Greater than or equal to” if you want to include the boundary value.Variable shows as blank
The referenced step might not have run yet or returned empty output. Make sure the step number is correct and that the step produces output before the If/Else block runs.What’s Next
Now that you understand the If/Else block:- Combine with Loop Block for conditional processing inside iterations
- Use Variable Referencing to pass data between branches
- Process results with Code Block
- Generate content with LLM Block