Skip to main content
Build sophisticated automation with conditional logic, loops, and advanced control flow.

Conditional Logic

Basic Conditions

Route flows based on data values: Use Cases:
  • Route by priority (high/medium/low)
  • Filter by criteria
  • Decision trees
  • Error handling
Example:

Multi-Way Branching

Route to multiple paths: Use Cases:
  • Content routing
  • Department assignment
  • Workflow selection
  • Resource allocation

AI-Assisted Conditions

Use AI to make conditional decisions: Use Cases:
  • Sentiment-based routing
  • Intent classification
  • Dynamic prioritization
  • Smart filtering

Loops & Iteration

List Processing

Connect a list output to a step that takes a single value, and the step runs once for each item: Use Cases:
  • Batch processing
  • Data transformation
  • Multi-item operations
  • Aggregation
Example:

Conditional Loops

A flow cannot loop back to an earlier step: a path that forms a cycle is rejected, and the While Loop node is not offered in the editor. To repeat work until it is good enough, do it inside an Agent node, or set retries in a node’s Error Handling: Use Cases:
  • Retry logic
  • Iterative refinement
  • Quality checks
  • Progressive processing
Example:

Advanced Patterns

Parallel Processing

Execute multiple paths simultaneously: Use Cases:
  • Multi-source data gathering
  • Parallel API calls
  • Concurrent processing
  • Performance optimization
Example:

Nested Subflows

Call flows within flows for modularity: Use Cases:
  • Reusable components
  • Complex workflows
  • Separation of concerns
  • Team collaboration
Example:

Error Handling & Retry

Handle failures gracefully: Use Cases:
  • API call failures
  • External service timeouts
  • Transient errors
  • Resilient automation

State Management

Flow Variables

Flow variables hold configuration a flow reads, such as URLs, IDs and defaults. A run cannot change them, so a running count comes from a node’s output, for example List Operations or Math Operations on the iterated results: Use Cases:
  • Counters and accumulators
  • Temporary storage
  • Cross-node data sharing
  • Loop state
Example:

Context Passing

Pass context between flow steps: Use Cases:
  • Maintain conversation context
  • Track processing history
  • Accumulate results
  • Decision tracking

Dynamic Flows

Runtime Path Selection

Choose flow path dynamically: Use Cases:
  • Adaptive workflows
  • Context-dependent processing
  • Optimization strategies
  • A/B testing

Dynamic Tool Selection

Let agents choose which tools to use: Use Cases:
  • Intelligent automation
  • Resource optimization
  • Context-aware processing
  • Cost optimization

Best Practices

Design:
  • Keep flows modular with subflows
  • Use clear naming conventions
  • Document complex logic
  • Plan for error cases
Performance:
  • Minimize sequential dependencies
  • Use parallel processing where possible
  • Cache expensive operations
  • Optimize loop iterations
Maintainability:
  • Use subflows for reusability
  • Add comments and descriptions
  • Version control flow definitions
  • Test edge cases
Debugging:
  • Add logging at key points
  • Use test mode frequently
  • Inspect intermediate outputs
  • Track execution paths

Working with AI

AI nodes and agents

Agents in Flows

Combine agents with flows