Skip to main content
All CollectionsBuild AutomationsOperators
Switch Operator: Simplify Your Torq Workflows
Switch Operator: Simplify Your Torq Workflows

Learn how to use Torq's Switch operator to efficiently manage diverse workflow conditions in a neat, organized manner.

Updated over a month ago

The Switch operator in Torq lets you create branches to handle different scenarios, keeping your workflow organized and adaptable to various security conditions.

How It Works

  • Branch Out Based on Conditions: Set up multiple branches within the Switch operator, each with its own set of conditions and actions. This setup allows for precise responses to different situations.

  • Order of Evaluation: Branches are checked from left to right, and the first branch's steps that meet the conditions are executed. If none do, the default branch runs instead.

Managing Branches

  • Add a Branch: Easily add up to 26 branches by clicking the Add Branch button on the branch display's right side.

  • Track Execution: See which branch was executed by checking the execution log.

Customizing Branches

  • Rename for Clarity: Double-click on a branch name to edit it, making it more descriptive. Names are auto-capitalized and can be up to 40 characters long, but shorter is better.

  • Prioritize Branches: You can rearrange branches by moving higher-priority ones to the left. The order matters because the first branch to meet its conditions is the one that gets executed.

Don't Forget the Default Branch

Always set conditions for the default branch. It acts as a fallback; the default branch's steps are executed if no other branch conditions are met. If empty, no action will be taken when conditions aren't met.

Did this answer your question?