ZBrain Documentation
  • ZBrain Documentation
    • Components of ZBrain
    • Getting started with ZBrain
    • 📚Knowledge base
      • How to create a knowledge base?
      • Knowledge source
      • Information schema
      • File summary
      • Automated reasoning
      • Retrieval testing
      • Knowledge base settings
    • 📱APP
      • How to create a new app?
      • How to set up and customize your app?
      • How to access the app reporting dashboard?
    • 🤖ZBrain AI agents
      • Get started with agents on ZBrain
      • Deploying pre-built agents
      • Creating custom AI agents
        • Agent setup
        • Define input sources
        • Define Flow
          • Key elements of a Flow
          • Flow Components
            • Activepieces Platform
            • AITable
            • Airtable
            • Amazon S3
            • Amazon SNS
            • Amazon SQS
            • Amazon Textract
            • Apify
            • Apollo
            • Approval
            • Asana
            • Azure Communication Services
            • Azure Cosmos DB
            • Azure Document Intelligence
            • Azure OpenAI
            • Azure Translation
            • Bannerbear
            • Baserow
            • Beamer
            • Bedrock Claude
            • Bettermode
            • Binance
            • Bing Search
            • Blackbaud
            • Bonjoro
            • Box
            • Brevo
            • Brilliant Directories
            • Bubble
            • CSV
            • Calendly
            • Certopus
            • Clearout
            • Clockodo
            • Code
            • Confluence
            • Connections
            • Constant Contact
            • Contiguity
            • Contentful
            • Customer.io
            • Crypto
            • Databricks
            • Data Mapper
            • Date Helper
            • DeepL
            • Delay
            • Discord
            • Discourse
            • Drip
            • Dropbox
            • Dust
            • Facebook Pages
            • Figma
            • Files Helper
            • Flowise
            • Flowlu
            • Formbricks
            • Frame
            • Freshdesk
            • Freshsales
            • GCloud Pub/Sub
            • GenerateBanners
            • GhostCMS
            • GitHub
            • GitLab
            • Gmail
            • Google Calendar
            • Google Contacts
            • Google Docs
            • Google Drive
            • Google Forms
            • Google Gemini
            • Google My Business
            • Google Search
            • Google Search Console
            • Google Sheets
            • Google Tasks
            • Groq
            • Hacker News
            • Heartbeat
            • HubSpot
            • HTTP
            • Image Helper
            • Inputs
            • Instagram for Business
            • Intercom
            • Invoice Ninja
            • Jira Cloud
            • Jotform
            • Kimai
            • Kizeo Forms
            • LeadConnector
            • Line Bot
            • Linear
            • LinkedIn
            • LinkedIn Actions
            • LLMRails
            • Lusha
            • MailerLite
            • Mailchimp
            • Mautic
            • Microsoft Dynamics 365 Business Central
            • Microsoft Dynamics CRM
            • Microsoft Excel 365
            • Microsoft OneDrive
            • Microsoft Outlook Calendar
            • Microsoft Teams
            • Mixpanel
            • MongoDB
            • Notion
            • Odoo
            • OpenAI
            • OpenRouter
            • Pastebin
            • PDF
            • Postgres
            • PostHog
            • Pushover
            • Qdrant
            • Queue
            • Razorpay
            • Router
            • Salesforce
            • SendGrid
            • ServiceNow
            • SFTP
            • SharePoint
            • Slack
            • SMTP
            • Snowflake
            • SOAP
            • Spotify
            • Stability AI
            • Stable Diffusion Web UI
            • Storage
            • Stripe
            • SurrealDB
            • SurveyMonkey
            • Taskade
            • Telegram Bot
            • Text Helper
            • Trello
            • Twilio
            • Twitter
            • Utilities
            • WhatsApp Business
            • WordPress
            • XML
            • YouTube
            • ZBrain
            • Zendesk
            • ZeroBounce
            • Zoho Books
            • Zoho CRM
            • Zoho Invoice
            • Zoom
          • How to Define a Flow?
          • How to Test Each Step in the Flow?
        • Configure Additional Settings
        • Test and Deploy Agents
        • How to access, monitor, and manage agent performance and tasks?
    • Settings
    • 📖API Tutorials
      • 📚Knowledge base
        • Automated Reasoning
      • 📱APP
      • 🤖Agents
Powered by GitBook
On this page
  1. ZBrain Documentation
  2. ZBrain AI agents
  3. Creating custom AI agents
  4. Define Flow
  5. Flow Components

Router

The Router piece allows you to create conditional branches in your workflow, directing the flow based on specific conditions.

How to Use the Router Piece in ZBrain Flow?

Step 1: Select Router as Your Connection

  • Click on the '+' button in the Flow and search for Router.

  • Select Router.

Step 2: Configure Execution Behavior

After adding the Router piece to your workflow, you'll see it creates two default paths: "Branch 1" and "Otherwise." The Router will evaluate conditions and direct your flow accordingly.

Under the ‘Execute’ dropdown, choose how you want multiple conditions to be handled:

  • Only the first (left) matching branch: This option creates an exclusive branching pattern. The Router evaluates branches from left to right, and as soon as it finds a branch with conditions that evaluate to true, it executes only that branch and stops checking further branches. This is similar to a switch statement in programming, where the first matching case is executed, and the rest are ignored unless explicitly configured otherwise.

  • All matching paths from left to right: This option allows multiple branches to execute in parallel if their conditions are met. The Router evaluates all branches from left to right, and any branch whose conditions are evaluated to true will be executed. This behavior is more like having multiple independent "if" statements.

Step 3: Set Up Branch Conditions

Click on the ‘Branch’ option to configure its condition:

  1. When configuring a branch, you'll see these condition options:

    1. In the ‘Execute If’ section:

      • First value: Enter the value or variable to evaluate

      • Operator: Select from dropdown options including:

        • Contains

        • (Text) Does not contain

        • (Text) Exactly matches

        • (Text) Does not exactly match

        • And many other comparison options

        • Exists

        • (List) Is empty

        • And many other comparison operators based on data type

      • Second value: Enter the comparison value (if applicable)

    2. For multiple conditions:

      • Use ‘And If’ section to add conditions

      • Each additional condition has its own set of:

        • First value field

        • Operator dropdown (like "(List) Is empty")

        • Second value field (when applicable)

    3. Condition management:

      • Click on ‘Remove’ button to delete a specific condition

      • Press the ‘+ And’ button to add another required condition

      • Use '+ Or' button to add an alternative condition

    This allows you to build complex conditional logic with multiple variables and operators to precisely control your workflow's branching behavior.

Step 4: Add More Branches If Needed

Click the '+' button to create additional conditional paths beyond the default two.

PreviousRazorpayNextSalesforce

Last updated 1 month ago

🤖