If youāre familiar with using paths in Zapier or routers in Make but havenāt mastered switches for directing data in workflows, this < 3 minute video will guide you on how to use them effectively.
Thanks to @bartv for alerting me to this part of the forum!
Great video, if you are going to do a whole series of these they will attract much attention I think.
One tiny note, the switch node as was shown in the video is fairly new, so would be great to note this for people looking at it on old versions of n8n and getting confused.
Great vid! Switches are awesome. I love how you can use them for menus in Telegram bots for example, where the /command can be checked using āString starts withā and then the /command as value. Also, if there is no /command, you could have a āfallbackā route that handles any other behaviour.
I am using Switch in a scenario that can fire up to four routes at once, but they never fire at the same time. Are there any configurations that I should change, or should I use something else, or is it as it is?
Not sure I understand the question ā I do notice in my workflows that each item going through travels at a different rate. Not sure if thatās what you are seeing or not.
If you are then needing to combine data again elsewhere in the flow, you can look at the merge node.
Youāre welcome! Glad that solves the issue. There are a few settings with merge ā I found playing around with it helped me. I often set merge to āCombineā and āCombine by Position.ā
Great video! Iāve been using switches in my workflows, but wonder what to do if there are too many. Think a never ending case statement. would you switch to a code node instead? I actually have a workflow that is going to continue growing and might need to adjust at some point
@rbreen - Iād maybe take a step back and see if your workflow is trying to do too much. Or if the logic can be broken down in some other way. Code node may also be the right decision.
Other thoughts: Would an AI node make sense? Depending on how you set things up, you can get structured data back for use later in flows or possibly get at whatever you are trying to achieve with your switch set-up.