Rabbinatix
Sign inGet started
Store

Chunk a list

FreeLogic
@rabbinatix/chunk-a-list by Rabbinatixupdated Oct 4, 2026

Cuts a list into groups of a given size: batches for an API, rows of a grid.

Sign in to add

The number of chunks is the length divided by the size, rounded up; a For Loop slices each one.

Shows: For Loop from 0, Round Up, Slice, Append to a list of lists.

How to use it

Add it to your logic, then add a Call Function step in any logic and pick Chunk a list. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.

Inputs
items: List
size: Whole number
Outputs
chunks: List of lists
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 3 outputs. step 1 of 13
Chunk a list
items
size
Length, Collection. 1 input, 1 output. step 2 of 13
Length
array
length
Divide, Operators. 2 inputs, 1 output. step 3 of 13
/
A
B
result
Round Up, Math. 1 input, 1 output. step 4 of 13
Round Up
value
result
Subtract, Operators. 2 inputs, 1 output. step 5 of 13
-
A
B
result
For Loop, Flow control. 3 inputs, 3 outputs. step 6 of 13
For Loop
first
last
Loop Body
index
Completed
Multiply, Operators. 2 inputs, 1 output. step 8 of 13
*
A
B
result
Add, Operators. 2 inputs, 1 output. step 9 of 13
+
A
B
result
Slice, Collection. 3 inputs, 1 output. step 10 of 13
Slice
array
start
end
result
Get Variable, Data. 0 inputs, 1 output. step 7 of 13
Get chunks
value
Append, Collection. 2 inputs, 1 output. step 11 of 13
Append
array
item
result
Set Variable, Data. 2 inputs, 2 outputs. step 12 of 13
Set chunks
value
value
Return, Input / output. 2 inputs, 0 outputs. step 13 of 13
Return
chunks

Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.

100%
Examplesrun live against the logic · 2/2 pass
PassedExampleInputOutput
Five in twos{"items":[1,2,3,4,5],"size":2}{"chunks":[[1,2],[3,4],[5]]}
Empty{"items":[],"size":3}{"chunks":[]}
Try it
Versions
In this package
Chunk a list (entry)