> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/build/switch.md).

# 在 Duaer 里用 Switch 按规则分多路

在 Duaer 里，Switch 默认 Mode 是 Rules。在 Routing Rules 里为每条规则写 Conditions；未匹配且 Fallback Output 为 None 时条目被忽略。
## 按规则开多条出口

1. 搜索 Switch，接到上一个节点后面。
2. Mode 保持 Rules。
3. 在 Routing Rules 里点 Add Routing Rule，写 Conditions。
4. 需要时打开 Rename Output，填 Output Name。
5. 把后续节点接到对应出口。点执行此步骤。

Mode 还可选 Expression，用表达式返回出口序号；再设 Number of Outputs。

Options 里 Fallback Output 默认 None (default)。要收兜底，改成额外出口，并可填 Rename Fallback Output。

概念见 [在 Duaer 里用 If 和 Switch 分叉](/zh/flow-logic/splitting.md)。
## Questions

### Duaer 的 Switch 一条条目能同时进多个出口吗？

默认只进第一个匹配的出口。Options 里打开 Send data to all matching outputs 后，所有匹配出口都会收到。

