Limit
Restricts the number of items passing through.
Overview
The Limit node controls how many items continue to downstream nodes. Use it to:
- Take only the first N items
- Take only the last N items
- Skip items with an offset
- Prevent processing too much data
Parameters
| Parameter | Description | Required |
|---|---|---|
| Limit | Maximum number of items to output | Yes |
| Offset | Number of items to skip | No |
| Mode | First or last items | Yes |
Mode Options
| Mode | Behavior |
|---|---|
| First | Take items from the beginning |
| Last | Take items from the end |
Limit
The maximum number of items to output.
Offset
Skip this many items before taking. Useful for pagination.
Output
The specified number of items.
Input: 10 items (indexed 0-9) Mode: First Limit: 3 Offset: 2
Output: Items at index 2, 3, 4 (skipped first 2, took next 3)
Examples
Take First 10
Process only the first 10 items:
- Mode:
First - Limit:
10 - Offset:
0(or leave empty)
Take Last 5
Get the most recent 5 items:
- Mode:
Last - Limit:
5
Pagination
Implement pagination with offset:
Page 1 (items 1-10):
- Mode:
First - Limit:
10 - Offset:
0
Page 2 (items 11-20):
- Mode:
First - Limit:
10 - Offset:
10
Sample Data for Testing
Take a small sample for testing:
- Mode:
First - Limit:
5
Tips
- Use to prevent overwhelming downstream nodes
- Combine with sorting (via SQL in Merge) to get top/bottom N
- Items exceeding the limit are discarded
- Use for testing workflows with large datasets
- Offset works with both First and Last modes