Skip to content

Limit

Cap the number of items that flow through the workflow.

Reduces the incoming collection of items to at most a fixed number, keeping either the first or the last items. Everything beyond the limit is dropped.

Use this node to process only a sample of a large dataset, to keep the most recent (or earliest) records, or to protect downstream nodes and external services from running on too many items at once.

SettingNotes
Max itemsMaximum number of items to keep. Integer, minimum 1, defaults to 10.
KeepWhich end of the collection to keep: first (from the start) or last (from the end). Defaults to first.

Returns at most Max items items. If the collection already has fewer items than the limit, it passes through unchanged.

  • No credential or node dependency is required. The node runs entirely in the browser.

Connect a node that produces many items (for example, an HTTP request returning a list, or a “Get All Links” node) into Limit, set Max items to 5 and Keep to first, and only the first five items continue to the next step.

  • Limit operates on the whole collection at once. If it seems to have no effect, make sure the upstream node is actually emitting multiple items rather than a single object.
  • Max items must be at least 1.