Using SWITCH node

Guys I need a help to use switch node with expression mode, someone pls could show me an example with 4 outputs?

I already use in rule mode, i would like to explore more options with expressions.

I read documentation but i didn’t think too much clear.

Hi @Fabio_Valentim,
if you are looking for example workflows using our Switch Node you can go to n8n workflow templates and use the “Integrations” filter.

Hi marcus, there is no relevant example, this template is rule based, i would like to know how to use expression based, since i put any information but nothing appears.

image

In Expression mode you have to write an expression in the “Output” parameter which resolves to the output index you want to route the item to. So it has to resolve to: 0, 1, 2 or 3

Here a basic example which routes each of the 4 items to a different output depending on its id:

I hope that is helpful!

2 Likes

Hi, do you mean that we add to a json a field that control the output ?

Very sorry, I do not understand the quesiton.