Split Results

Hello community!

Please, how I can create a routing to split results to 3 destinations?

For example: I get a range value from Google Sheets (30 results), and I need distribute this in 3 different paths (10 on each).

Hi @NereuFajardo, hope you’re well? You could use the Switch node to distribute your items.

A relatively simple way of splitting up any number of items would be dividing their position by 3 and see if the remainder is either 0, 1, or 2. This can be achieved by combining the $position expression with the % remainder operator.

Here’s an example you can copy straight into your n8n canvas splitting up 30 items:

Example Workflow

Hey @MutedJam , I’m good, I hope you’re well too.

Amazing, a simple and effective solution. Thank you a lot!

1 Like