---
title: Limit
description: Cap the number of items that flow through the workflow
---

Cap the number of items that flow through the workflow.

## What it does

Limit takes the whole list of incoming items at once and keeps at most **Max Items** of them: either the first ones or the last ones. Everything beyond the limit is dropped.

If the list already has fewer items than the limit, it passes through unchanged. A single object counts as a list of one.

## When to use it

* Try a workflow on a small sample of a large list before running it on everything.
* Keep only the most recent (or earliest) records, for example the last 5 rows after a [Sort](/nodes/builtin/datatransformation/sort/).
* Protect an AI model or an outside service from being called for hundreds of items at once.
* To drop items by a condition rather than by count, use [Filter](/nodes/builtin/flow/filter/) instead.

## Inputs and settings

**Max Items** must be a whole number of at least `1`.

## Outputs

The kept items, unchanged and in their original order. The next node runs once per kept item.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. [Get All Link](/nodes/extension/getalllinks/) collects every link on the current page.
2. **Limit** with **Max Items** `5` and **Keep** *First items*.
3. [Get All Text from Link](/nodes/builtin/core/getalltextfromlink/) reads only those five pages.

## Common issues

* **"No source node is connected to this node."** Limit has no input. Connect the node that produces the list.
* **Limit seems to have no effect.** The node before it sends one object that contains a list, not a list of items. Use [Split Out](/nodes/builtin/datatransformation/splitout/) first to turn that list into items.

## Related nodes

* [Filter](/nodes/builtin/flow/filter/): keep items that match a condition.
* [Sort](/nodes/builtin/datatransformation/sort/): order items before keeping the first or last.
* [Split Out](/nodes/builtin/datatransformation/splitout/): turn a list inside one item into separate items.
* [Remove Duplicates](/nodes/builtin/datatransformation/removeduplicates/): drop repeated items.