If
The If node is like a smart traffic controller for your workflow. It looks at your data and decides which path to take next based on conditions you set up. Think of it as asking a yes/no question about your data and then doing different things depending on the answer.
This is perfect for making your workflows intelligent and responsive - like only processing high-quality content, handling different user types differently, or taking special actions when something goes wrong.
How it works
Section titled “How it works”The If node examines your data and evaluates a condition you specify. Based on whether that condition is true or false, it sends your workflow down one of two different paths.
graph TD
Input[Data Input] --> If{If Node}
If -->|Condition is True| PathA[Path A: Do This]
If -->|Condition is False| PathB[Path B: Do That]
style If fill:#6d28d9,stroke:#fff,color:#fff
Setup guide
Section titled “Setup guide”-
Connect your data: Link the If node to receive data from a previous step in your workflow.
-
Set your condition: Define what you want to check. This could be “does this article have a title?” or “is the price less than $100?”
-
Connect the paths: Attach different nodes to the “true” and “false” outputs to handle each scenario.
-
Test both paths: Run your workflow with data that will trigger both true and false conditions to make sure both paths work correctly.
Practical example: Content quality check
Section titled “Practical example: Content quality check”Let’s say you’re collecting articles from websites, but you only want to keep articles that are complete and substantial enough to be useful.
Let’s say you’re collecting articles from websites, but you only want to keep articles that are complete and substantial enough to be useful.
Input Data: You have an article titled “Amazing Discovery” with 450 words by Dr. Sarah Johnson.
The Test: You ask the node to check three things:
- Is there a title?
- Is the content longer than 100 words?
- Is an author listed?
The Result: Since all three answers are “Yes”, the Condition Result is TRUE. The workflow will follow the “True” path, meaning the article passes your quality check and continues to be processed.
Common condition types
Section titled “Common condition types”| Condition Type | Example | When to Use |
|---|---|---|
| Data exists | Title is not empty | Check if required information is present |
| Number comparison | Price is less than $50 | Filter by numeric values |
| Text matching | Status equals “published” | Check for specific text values |
| Length check | Content has at least 100 words | Ensure minimum content quality |
| Multiple conditions | Has title AND has author | Combine several requirements |
Troubleshooting
Section titled “Troubleshooting”- Always goes to false path: Check that your condition is written correctly and that the data field names match exactly what’s in your input data.
- Condition seems backwards: Make sure you understand which path is “true” and which is “false” - it’s easy to mix them up when connecting your workflow.
- Error in condition: If your condition has a syntax error, the node might fail entirely. Keep conditions simple and test them step by step.