Skip to main content

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​

ParameterDescriptionRequired
LimitMaximum number of items to outputYes
OffsetNumber of items to skipNo
ModeFirst or last itemsYes

Mode Options​

ModeBehavior
FirstTake items from the beginning
LastTake 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:

  1. Mode: First
  2. Limit: 10
  3. Offset: 0 (or leave empty)

Take Last 5​

Get the most recent 5 items:

  1. Mode: Last
  2. 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:

  1. Mode: First
  2. 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