Slice List
Extract a range of items from a list using start and end indices
What does this node do?
The Slice List node extracts a range of items from a list using start and end indices. It returns a new list containing only the items within the specified range.
Common uses:
- Get the top N results from a list
- Paginate large lists into smaller chunks
- Skip header rows in imported data
Quick setup
Add the Slice List node
Drag it onto the canvas from the Tools panel.
Connect a list input
Connect the output of any node that produces a list (e.g., Create List, Google Sheets) to the list input.
Set the range
Configure the start_index and end_index to define which portion of the list to extract.
Use the output
Connect the sliced_list output to the next node in your workflow.
Configuration
Input
list json required The list to slice. Accepts any valid JSON array.
Parameters
start_index number default: 0 The zero-based index where the slice begins (inclusive). Minimum: 0.
end_index number default: 100 The zero-based index where the slice ends (exclusive). Minimum: 0.
Output
A sliced_list containing the items within the specified range.
{
"sliced_list": ["banana", "cherry", "date"]
}
Examples
Get the top 5 results
graph LR
A[API Connector] --> B[Slice List]
B --> C[LLM: Summarize top results]
Configuration:
start_index:0end_index:5
The API returns 50 results. Slice List extracts only the first 5 so the LLM can produce a focused summary without processing the entire list.
Skip the header row from a spreadsheet
graph LR
A[Google Sheets] --> B[Slice List]
B --> C[Loop]
C --> D[Process row]
Configuration:
start_index:1end_index:100
The spreadsheet data includes a header row at index 0. Slice List skips it by starting at index 1, passing only the data rows to the Loop node.
Best practices
- Use for pagination. Combine Slice List with a counter or Loop to process large lists in pages (e.g., items 0-9, then 10-19, etc.).
- Set a reasonable end_index. The default value of 100 works for most cases, but adjust it if you know the exact number of items you need.
Common issues
Empty result when expecting items
Check that start_index is less than the length of the list. If start_index is greater than or equal to the list size, the result will be an empty array. Also verify that start_index is less than end_index.
Input is not recognized as a list
The list input must be a valid JSON array (e.g., ["a", "b", "c"]). If you pass a plain string or an object, the node will not work correctly. Make sure the upstream node outputs a proper list format.