AI Switch icon

AI Switch

Automatically routes workflow based on AI analysis

AI Switch

AI-generated

Summary

Routes each incoming item to the default output or to a configured route, using a connected AI language model to choose based on the item’s text and the route descriptions. Add one or more routes with a name and description, then connect a language model; the node creates a main output for Default and each route.

Inputs

  • Routes (required) — Add routes with a required name and description. The descriptions tell the model when to select each route; their order determines route indexes starting at 1. Index 0 is the Default output.
  • Analysis Field — Text to analyze. The implementation uses this setting as a literal string; when it is empty, it does not auto-detect text from the input item, so the item goes to Default.
  • Response Format — Choose Route Index (the default), where the model responds with a route number, or Structured Response, where it responds with JSON containing routeIndex and optional reasoning.
  • System Prompt — Instruction prepended to the routing prompt; defaults to a content-routing instruction.
  • Debug Mode — Enables logging and adds aiRouterAnalysis details to item data in several routing paths.
  • Language Model (required) — Connect one AI language model. It is used to select a route when analysis text is provided, except when a route description directly matches a supported “has word” keyword rule.

Output shape

Multiple main outputs: Default followed by one output per configured route. Each output contains the input items assigned to it.

With no analysis text, items go to Default. A model response of 0, or an out-of-range index, also selects Default. For selected non-default routes, the item is copied and receives aiRouterInfo with routeName, routeIndex, and reasoning; debug mode can add aiRouterAnalysis. Errors may route to Default or use keyword fallback, depending on where they occur and whether Continue On Fail is enabled.

Links

Discussion