Documentation
HomeAPISign In
  • Getting Started
    • Overview
      • Core Concepts
      • Building your First Workflow
    • API Reference
  • Your Data
    • Brand Kits
    • Knowledge Bases
      • Add Data
        • Upload Files
        • Web Scrape
        • Import from Google Drive
        • Import from SQL Database
        • Import from Shopify
      • Knowledge Base Search
      • Knowledge Base Metadata
      • Knowledge Base API
  • Building Workflows
    • Workflow Concepts
      • Workflow Inputs
        • Input Types
      • Workflow Outputs
      • Variable Referencing
      • Liquid Templating
    • Workflow Steps
      • AI
        • Prompt LLM
          • Model Selection Guide
          • Prompting Guide
        • Transcribe Audio File
      • Web Research
        • Google Search
        • Perplexity Deep Research
        • Web Page Scrape
      • Code
        • Run Code
        • Call API
        • Format JSON
        • Run SQL Query
        • Write Liquid Text
      • Flow
        • Condition
        • Iteration
        • Human Review
        • Content Comparison
        • Error
      • Data
        • Read from Grid
        • Add Rows in Grid
        • Search Knowledge Base
        • Write to Knowledge Base
        • Get Knowledge Base File
      • AirOps
        • Workflow
        • Agent
      • Image & Video
        • Generate Image with API
        • Search Stock Images
        • Fetch Stock Image with ID
        • Resize Image
        • Screenshot from URL
        • Create OpenGraph Image
        • Create Video Avatar
      • SEO Research
        • Semrush
        • Data4SEO
      • Content Quality
        • Detect AI Content
        • Scan Content for Plagiarism
      • Content Processing
        • Convert Markdown to HTML
        • Convert PDF URL to Text
        • Group Keywords into Clusters
      • B2B Enrichment
        • Hunter.io
        • People Data Labs
      • CMS Integrations
        • Webflow
        • WordPress
        • Shopify
        • Contentful
        • Sanity
        • Strapi
      • Analytics Integrations
        • Google Search Console
      • Collaboration Integrations
        • Gmail
        • Google Docs
        • Google Sheets
        • Notion
        • Slack
    • Power Steps
    • Testing and Iteration
    • Publishing and Versioning
    • Logs
    • Studio Toolbar
  • Running Workflows
    • Run Once
    • Run in Bulk (Grid)
    • Run via API
    • Run via Trigger
      • Incoming Webhook Trigger
      • Zapier
    • Run on a Schedule
    • Error Handling
  • Grids
    • Create a Grid
      • Import from Webflow
      • Import from Wordpress
      • Import from Semrush
      • Import from Google Search Console
    • Add Columns in the Grid
    • Run Workflows in the Grid
      • Add Workflow Column
      • Run Workflow Column
      • Schedule Workflow Column
      • Map Workflow Outputs
      • Review Workflow Run Metadata
    • Review Content in the Grid
      • Review Markdown Content
      • Review HTML Content
      • Compare Content Difference
    • Publish to CMS from Grid
    • Pull Analytics in the Grid
    • Searching and Filtering
    • Export as CSV
  • Copilot
    • Chat with Copilot
    • Edit Workflows with Copilot
    • Fix Errors with Copilot
  • Monitoring
    • Task Usage
    • Analytics
    • Alerts
    • Execution History
  • Your Workspace
    • Create a Workspace
    • Folders
    • Settings
    • Billing
    • Use your own LLM API Keys
    • Secrets
    • Team and Permissions
  • Chat Agents (Legacy)
    • Agent Quick Start
    • Chat Agents
    • Integrate Agents
      • Widget
      • Client Web SDK
  • About
    • Ethical AI and IP Production
    • Principles
    • Security and Compliance
Powered by GitBook
On this page
  • Condition Step
  • What is a Condition Step?
  • How to Configure a Condition Step
  • Condition Expression Syntax
  • Common Use Cases
  • Example
  • Best Practices

Was this helpful?

  1. Building Workflows
  2. Workflow Steps
  3. Flow

Condition

Branch your workflow logic

Last updated 19 days ago

Was this helpful?

Condition Step

The Condition Step allows you to create branching logic in your workflows, executing different steps based on whether a specified condition evaluates to True or False.

What is a Condition Step?

A Condition Step acts as a decision point in your workflow, directing the flow based on a JavaScript expression that you define. It consists of:

  1. The Condition: A JavaScript expression that evaluates to either True or False

  2. True Path: Steps that execute when the condition evaluates to True (left branch)

  3. False Path: Steps that execute when the condition evaluates to False (right branch)

How to Configure a Condition Step

  1. Click the "+" button to add a new step in your workflow

  2. Select "Flow" from the categories, then choose "Condition"

  3. In the configuration panel, enter your JavaScript condition

  4. Add steps to both the True and False paths as needed

Condition Expression Syntax

Conditions are written as JavaScript expressions that evaluate to a boolean value. You can:

  • Use comparison operators: >, <, >=, <=, ===, !==

  • Apply logical operators: && (AND), || (OR), ! (NOT)

  • Use conditional (ternary) operators: condition ? trueValue : falseValue

  • Access nested properties: step_2.output.results[0].score > 80

Common Use Cases

  • Content branching: Generate different content types based on user input

  • Error handling: Take alternative actions when a step fails

  • Quality control: Route content through additional steps if it doesn't meet quality thresholds

Example

// If the keyword has high search volume, use a more detailed research approach
step_2.output.search_volume > 5000

This condition will route the workflow through the True path for high-volume keywords and the False path for lower-volume keywords, allowing you to optimize your research process for each scenario.

Best Practices

  • Keep conditions simple: Complex logic is harder to debug and maintain

  • Provide default paths: Ensure both True and False paths are configured

  • Use descriptive names: Rename your condition steps to describe their purpose (e.g., "Check Search Volume")

  • Test thoroughly: Verify both paths work as expected with different inputs

Condition Steps are powerful tools for creating adaptable workflows that respond intelligently to different scenarios and data conditions.