You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. sidebar_position: 6
  3. slug: /switch_component
  4. ---
  5. # Switch component
  6. A component that evaluates whether specified conditions are met and directs the follow of execution accordingly.
  7. ---
  8. A **Switch** component evaluates conditions based on the output of specific components, directing the flow of execution accordingly to enable complex branching logic.
  9. ## Scenarios
  10. A **Switch** component is essential for condition-based direction of execution flow. While it shares similarities with the [Categorize](./categorize.mdx) component, which is also used in multi-pronged strategies, the key distinction lies in their approach: the evaluation of the **Switch** component is rule-based, whereas the **Categorize** component involves AI and uses an LLM for decision-making.
  11. ## Configurations
  12. ### Case n
  13. A **Switch** component must have at least one case, each with multiple specified conditions. When multiple conditions are specified for a case, you must set the logical relationship between them to either AND or OR.
  14. Once a new case is added, navigate to the **Switch** component on the canvas, find the **+** button next to the case, and click it to specify the downstream component(s).
  15. #### Condition
  16. Evaluates whether the output of specific components meets certain conditions
  17. :::danger IMPORTANT
  18. When you have added multiple conditions for a specific case, a **Logical operator** field appears, requiring you to set the logical relationship between these conditions as either AND or OR.
  19. :::
  20. - **Operator**: The operator required to form a conditional expression.
  21. - Equals (default)
  22. - Not equal
  23. - Greater than
  24. - Greater equal
  25. - Less than
  26. - Less equal
  27. - Contains
  28. - Not contains
  29. - Starts with
  30. - Ends with
  31. - Is empty
  32. - Not empty
  33. - **Value**: A single value, which can be an integer, float, or string.
  34. - Delimiters, multiple values, or expressions are *not* supported.