Skip to main content

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

SettingDescription
ItemsArray to iterate over
Max iterationsLimit to prevent runaway loops
DelayWait between iterations

Accessing loop data

Inside a loop, access:
VariableDescription
{{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

OperatorDescriptionExample
equalsEqual tostatus equals "active"
not_equalsNot equal totype not_equals "test"
greater_thanGreater thanscore > 80
less_thanLess thancount < 10
containsString containsemail contains "@gmail"
starts_withString starts withurl starts_with "https"
is_emptyValue is emptydata is_empty
is_not_emptyValue existsresult 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

SettingDescription
Error messageCustom message to display
Error codeOptional 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