# Router

> Send a workflow down one or more named routes. Choose the route yourself, turn several on at once, or let conditions on the incoming data decide.

Source: https://nodaro.ai/docs/nodes/automate/router

The **Router** node sends a workflow down one or more named routes. Its input passes unchanged to every active route, and the nodes on inactive routes are skipped. You choose the active route yourself in **Radio** mode, activate several routes at once in **Checkbox** mode, or let conditions on the incoming data decide in **Conditional** mode. The node is free.

- Found in: Automate › Logic & Data
- Output: data
- API type: `router`

## When to use it
- Switch between two pipelines, such as a 9:16 reel and a 1:1 post made with [Resize Video](https://nodaro.ai/docs/nodes/video/resize-video), without disconnecting anything.
- Make a video and a thumbnail from the same image in one run, with two active routes.
- Run a step only when the data needs it, for example skip the dubbing branch when `language` is `en`.
- Try A/B variations by activating several routes at once.

## Quick start
### Add the node

Press Tab on the canvas and choose **Automate › Logic & Data › Router**.

### Connect the input

Wire the value you want to pass on into the **In** input, for example the result of [Generate Video](https://nodaro.ai/docs/nodes/video/generate-video). It accepts text, JSON, images, videos and audio.

### Configure the routes

Open the settings panel and choose a **Mode**. Rename the routes, and click **Add Route** for more. Every route has its own output on the right of the node.

### Connect the branches

Connect each route's output to the first node of its branch.

### Choose the active routes and run

In **Radio** and **Checkbox** mode, click a route on the node, or in the settings panel, to activate or deactivate it. Click **Run**. Only the branches on active routes run.

Workflow: A Router in Radio mode sends the video to the reel branch; the post branch is skipped until you switch the route.

- Generate Video → Router (in)
- Router → Resize Video (Reel)
- Router → Resize Video (Post)

## Inputs and outputs
| Input or output | Accepts or sends | What it does |
| --- | --- | --- |
| **In** | Text, JSON, images, videos or audio | The value to route. |
| One output per route | The same value | Each active route passes the input on unchanged. An inactive route sends nothing. |

## Settings
| Setting | What it does |
| --- | --- |
| **Mode** | **Radio (one active)**, the default, keeps exactly one route active. **Checkbox (any combination)** lets any number of routes be active. **Conditional (rule-based)** decides at run time from the incoming data. |
| **Routes** | The named routes. A new Router has **Route A** and **Route B**. Rename a route to label its output on the canvas; the name is only a label. **Add Route** adds more, up to 10. Radio and Checkbox mode need at least 2 routes; Conditional mode works with 1. |

When you switch from **Checkbox** to **Radio** with several routes active, only the first active route stays active. When no route is active, the node shows a **NONE** badge.

## Conditional mode

In **Conditional (rule-based)** mode, the data decides. The panel shows the first incoming item under **Upstream sample (first item)**, so you can see its fields.

1. Under **Condition groups**, each group holds one or more conditions: a field, an operator and a value. Click **Add condition** for more, and choose **AND** or **OR** to combine them.
2. Under **Activates**, tick the routes the group activates when its conditions pass.
3. Click **Add group** for another rule. When you first switch to Conditional mode, the panel starts you with one group that activates the first route.

The conditions work like those of [Filter List](https://nodaro.ai/docs/nodes/automate/filter-list), with the same operators and the same date shortcuts, such as **Since last run**.

How groups combine:

- A route runs when at least one matching group activates it. Routes activated by several groups run once.
- When no group matches, every route stays inactive and the nodes after the Router are skipped.
- A Router with no groups activates no route.

The input must be JSON, or text that reads as JSON. To route on a field of scraped data, connect [Web Scrape](https://nodaro.ai/docs/nodes/automate/web-scrape) directly. To route on part of the data, pass it through [Extract Field](https://nodaro.ai/docs/nodes/automate/extract-field) with its **Output Type** set to **JSON**.

## Credits
Router is free. Skipped branches cost nothing, because their nodes do not run.

## Tips
- **Switch without rewiring.** Keep both branches connected and switch the route in Radio mode. The workflow stays ready for both versions.
- **Name the routes.** A route called "Reel" or "Dub" is easier to follow on the canvas than "Route A".
- **Use an empty route as an off switch.** A route with no nodes after it does nothing, so a Radio route called "Off" pauses the whole branch.

## Frequently asked questions

### How do I switch between two versions of a workflow without rewiring it?

Add a Router in Radio mode with one route per version, and connect each route to its branch. Choose the route before you run. Only that branch runs, and the nodes on the other routes are skipped.

### Can a Router run several branches at once?

Yes. In Checkbox mode, any combination of routes can be active, and every active route runs in the same run.

### How does Conditional mode decide which route runs?

Condition groups test fields of the incoming JSON. When a group's conditions pass, it activates the routes ticked under Activates. The results of all matching groups are combined, and when no group matches, no route runs.

### What happens to the nodes on an inactive route?

They are skipped, and so are the nodes that come after them. A route that has no nodes after it simply does nothing.

### Does the Router node cost credits?

No. Router is free. It only decides which branches run.
