Skip to main content
Skip table of contents

Branches - Logical Step and Parallel execution

The Logical Step and Parallel Execution Step are critical components of the workflow builder, enabling dynamic branching and parallel processing within your workflows. Below is a detailed explanation of their functionality, behaviors, and best practices for using them effectively.

Logical Step

The Logical Step allows you to split the workflow into multiple branches based on conditions. Each branch is evaluated independently, and the workflow proceeds along the branch where the condition evaluates to True.

Screenshot 2025-05-15 at 16.41.36.png

Logical Step with two branches

Key Features:

  1. Condition Definition:

    • You can define conditions using Python expressions or Natural Language Prompts.

    • Example Python condition: result > 2 or transfer != 'Yes, I would like to be transferred!'

    • Example Prompt: "Check if the user wants to transfer."

Parallel Execution

The Parallel Execution enables the simultaneous execution of multiple branches. This is useful for workflows where tasks can be performed independently and concurrently. This node is useful for advanced use cases, most of the time you will not need it. Try to rely on linear flows as much as possible.

Screenshot 2025-05-15 at 16.42.22.png

Parallel Execution with two branches that merge into a single Output

Key Features:

  1. Simultaneous Execution:

    • All branches under a Parallel Execution are executed at the same time.

    • This is ideal for tasks that do not depend on each other.

Special Behaviors for Logical Step and Parallel Execution

  1. Deleting a Step:

    • When deleting a Logical or Parallel Execution, you will be prompted to select which branches (subtrees) to delete. This is because floating branches are not allowed in the workflow.

    • Warning: Deleting branches is a destructive action and should only be performed when absolutely necessary.

      Screenshot 2025-05-15 at 16.42.37.png

      Deleting a step with multiple branches

  2. Automatic Branch Creation:

    • Adding a node to a Logical or Parallel Execution Step automatically creates a new branch.

  3. Output Behavior:

    • If branches are not merged, each branch generates its own output, which is returned to the agent.

  4. Merging Branches:

    • Branches can be merged by dragging the connection point of one branch to another branch output. This ensures a single output.

Best Practices

  1. Use Logical Steps for Decision-Making:

    • Logical Steps are ideal for workflows that require conditional branching based on user input, variables, or context values.

  2. Use Parallel Execution for Independent Tasks:

    • Parallel Execution Steps are best suited for workflows where tasks can be performed simultaneously without dependencies.

  3. Avoid Floating Branches:

    • Always ensure that branches are either merged or lead to an Output Step. Floating branches are not allowed and will result in errors.

  4. Carefully Manage Deletions:

    • When deleting Logical or Parallel Execution Steps, review the branches carefully to avoid accidental loss of workflow components.

  5. Test Conditions Thoroughly:

    • For Logical Steps, ensure that conditions are well-defined and tested to avoid unexpected behavior.

By leveraging Logical and Parallel Execution Steps effectively, you can create dynamic, flexible, and efficient workflows tailored to your specific needs.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.