Skip to content

AI Switch Node#

The AI Switch node evaluates an input string against a set of predefined cases using an AI model (OpenAI). It routes execution to the matching case’s outgoing edge and logs the AI’s reasoning.

In order to use the AI Switch you need to set up a corresponding OpenAI integration.

Configuration#

Context#

Provide background or instructions for the AI to understand the input. Use this field to give domain-specific guidelines, style rules, or any relevant information the AI needs when evaluating the input string.

context: "Only classify support requests related to user authentication and access issues."

Input#

The string to evaluate. This can be free text, a user prompt, or a dynamic variable.

input: "I need help resetting my password on the portal"

Cases#

Define each possible outcome with a single value. These values tell the AI how to classify the input.

cases:
  - value: "password"
  - value: "billing"
  - value: "default"

Execution Flow#

  1. The AI Switch evaluates the context and input against each case value.
  2. It selects the first matching case.
  3. The flow continues along the edge associated with that value.
  4. If no value matches, it follows the default edge.
  5. The AI’s reasoning is logged for review.

Example#

context: "Classify customer support requests into categories."
input: "I need help resetting my password on the portal"
cases:
  - value: "password"
  - value: "billing"

With these settings:

  • The AI Switch will match password for the given input.
  • The flow follows the password edge.
  • The AI’s reasoning is logged for review.