Overview
Control flow nodes determine the execution path of your workflow. Loop through data, branch based on conditions, and handle errors gracefully.
Available control flow nodes
Loop node
Process arrays of data by repeating a sequence of nodes for each item.
When to use
- Processing a list of URLs
- Iterating through spreadsheet rows
- Batch processing API responses
Basic usage
Configuration
| Setting | Description |
|---|
| Items | Array to iterate over |
| Max iterations | Limit to prevent runaway loops |
| Delay | Wait between iterations |
Accessing loop data
Inside a loop, access:
| Variable | Description |
|---|
{{Loop_0.currentItem}} | Current item being processed |
{{Loop_0.index}} | Current index (0, 1, 2…) |
{{Loop_0.totalItems}} | Total number of items |
Example
Process a list of URLs:
Input: ["url1.com", "url2.com", "url3.com"]
Loop:
For each URL:
→ Web Scraper (URL: {{Loop_0.currentItem}})
→ LLM Analysis
→ Save to Sheets
Conditional node
Execute different branches based on conditions.
When to use
- Routing based on data values
- Error handling paths
- A/B testing logic
Basic usage
Available operators
| Operator | Description | Example |
|---|
equals | Equal to | status equals "active" |
not_equals | Not equal to | type not_equals "test" |
greater_than | Greater than | score > 80 |
less_than | Less than | count < 10 |
contains | String contains | email contains "@gmail" |
starts_with | String starts with | url starts_with "https" |
is_empty | Value is empty | data is_empty |
is_not_empty | Value exists | result is_not_empty |
Multiple conditions
Combine conditions with AND/OR logic:
Condition 1: score > 50
AND
Condition 2: status equals "active"
Example
Route leads by score:
Fail node
Stop workflow execution with a custom error message.
When to use
- Validating required data
- Enforcing business rules
- Graceful error handling
Basic usage
Configuration
| Setting | Description |
|---|
| Error message | Custom message to display |
| Error code | Optional error code |
Example
Validate before processing:
Conditional:
If {{data}} is_empty
→ Fail: "No data provided. Please check input."
Else
→ Continue processing
Common patterns
Process and filter
Loop with conditional filtering:
Error handling with retry
Parallel branches
Process data in different ways:
Data validation pipeline
Best practices
Loop safety
- Always set max iterations to prevent infinite loops
- Add delays for API calls (rate limiting)
- Handle errors inside loops gracefully
- Log progress for long-running loops
Conditional clarity
- Use descriptive conditions that are easy to understand
- Handle all cases (don’t leave paths undefined)
- Test edge cases (empty data, null values)
Error handling
- Fail early with clear messages
- Provide context in error messages
- Consider retry logic for transient failures
- Log failures for debugging
Nested control flow
Combine loops and conditions:
Loop through URLs:
→ Scrape page
→ Conditional: Has content?
→ Yes:
→ Loop through paragraphs
→ Analyze each
→ No:
→ Log empty page
Deeply nested control flow can be hard to debug. Consider breaking into sub-workflows.
Next steps