For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • Add a conditional step
  • Writing conditions
  • Examples
  • Check AI confidence
  • User tier routing
  • Error detection
  • Multiple conditions
  • String comparisons
  • Checking for existence
  • Nested conditionals
  • Early returns
  • Accessing branch outputs
  • Testing conditionals
  • Common patterns
  • Validation
  • Feature flags
  • Fallback logic
  • Next steps
Flows

Using conditional steps

Was this page helpful?
Previous

Using fetch-url and api-call steps

Next
Built with

Conditional steps branch Flow execution based on conditions, letting you build if/else logic and route data through different paths.

Add a conditional step

  1. In the Flow editor, click Add Step
  2. Select Conditional
  3. Configure:
    • Name: Descriptive label (e.g., “Check sentiment”)
    • Condition: Define when the “if” branch executes
    • If branch: Steps to run when condition is true
    • Else branch: Steps to run when condition is false (optional)
  4. Click Save Step

Writing conditions

Conditions use JavaScript expressions. Reference variables with {{variable}} syntax:

{{sentiment.score}} > 0.5

Supported operators:

  • ==, !=, <, >, <=, >= — Comparison
  • &&, || — Logical AND/OR
  • ! — Negation

Examples

Check AI confidence

{{analysis_result.confidence}} > 0.8

If true: Use AI response. Else: Route to human review.

User tier routing

{{customer_data.tier}} == "premium"

If true: Priority support Flow. Else: Standard support Flow.

Error detection

{{api_result.status}} != 200

If true: Error handling. Else: Process response.

Multiple conditions

{{order_total}} > 1000 && {{customer_data.tier}} == "standard"

If true: Require approval. Else: Auto-approve.

String comparisons

Use quotes for string values:

{{sentiment_result.label}} == "negative"
{{process_status}} != "completed"

Checking for existence

Test if a value exists:

{{customer_data.email}} != null
{{order_history.length}} > 0

Nested conditionals

Add conditional steps inside if/else branches for complex logic:

Main conditional: Is tier premium?
If true:
Nested conditional: Is order > $5000?
If true: VIP processing
Else: Premium processing
Else: Standard processing

Early returns

Use a Return step in a conditional branch to exit the Flow early:

Conditional: Is request invalid?
If true: Return error message
Else: Continue processing

Keep conditions simple. If you need complex logic, use a transform-data step to calculate a boolean, then reference that in the conditional.

Accessing branch outputs

Steps inside conditional branches set their outputVariable in the same Flow-level scope. Reference them by their outputVariable name in later steps:

{{branch_result}}

Testing conditionals

Run your Flow with inputs that trigger both branches:

  1. Test with condition = true input
  2. Verify “if” branch executes
  3. Test with condition = false input
  4. Verify “else” branch executes

Common patterns

Validation

Conditional: Input is valid?
If false: Return validation error
Else: Continue processing

Feature flags

Conditional: New feature enabled?
If true: New implementation
Else: Legacy implementation

Fallback logic

Conditional: Primary API succeeded?
If false: Try backup API
Else: Use primary response

Next steps

  • Flow variables and templates for variable reference
  • Using transform-data steps to prepare data for conditionals
  • Debugging flows to trace conditional execution