> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ingestly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter

> Keep or drop document pages by content or page number.

<Note>This node is in **beta**. Its behavior may change in future releases.</Note>

The **Filter** node narrows a document to the pages you care about. It reads the page text produced by an upstream [parse](/nodes/parse) step, keeps or drops pages by keyword or page range, and passes the surviving pages on as a single document.

Filter never fans a run out. One document goes in, one (smaller) document comes out. To cut one document into several sub-documents, use [split](/nodes/split).

## When to use Filter

* You want to **drop boilerplate** before extraction: cover sheets, terms and conditions, blank trailing pages.
* You want to **keep only the pages that matter**, so the model sees less noise and extraction is more accurate.
* You know the pages by **number or range** (`1-3`, `2,5`, `4-end`) or by a **keyword** that appears on them.
* Use [split](/nodes/split) instead when one upload holds several documents and each needs its own run.
* Use [classify](/nodes/classify) instead when the decision needs to read the document's content semantically (rules text or AI similarity). Filter is deterministic matching on text you already have.

## Configuration

| Field           | Type   | Required                    | Description                                                                  |
| --------------- | ------ | --------------------------- | ---------------------------------------------------------------------------- |
| **Mode**        | select | Yes                         | `Keep` passes only matching pages, `Drop` discards them. Default: `Keep`     |
| **Filter type** | select | Yes                         | `Keyword` matches pages containing the text, `Range` selects pages by number |
| **Keyword**     | text   | When filter type is Keyword | Case-insensitive substring matched against each page's text                  |
| **Range**       | text   | When filter type is Range   | Comma-separated page numbers and ranges, for example `1-3,7,9-end`           |

### Modes

<Note>To classify documents by content type or AI similarity, use the dedicated [Classify action](/nodes/classify) node.</Note>

#### Keep

Passes only the pages that match the filter. Every other page is removed from the document for the rest of the run.

#### Drop

The inverse of Keep. Removes the pages that match the filter and passes everything else through.

The step fails when no pages survive the filter, so a filter that matches nothing is reported rather than silently producing an empty document.

## Output

A single page group containing the surviving pages. Downstream nodes see only those pages: [extract](/nodes/extract) reads just the pages you kept, and page numbers stay the ones from the original document.

<Warning>Filtering does not reduce credits. Per-page cost is charged against the document's full page count, and that count narrows only inside a child run, which Filter never creates. Filter buys accuracy, not cost.</Warning>

## Inputs and outputs

**Allowed inputs:** parse, review, split, and another filter node.

Trigger nodes are deliberately not allowed. Filtering needs page text, which only a parse step produces: a scanned document arrives at the trigger with no text at all.

**Output:** the filtered document, passed to the next node.

## Credits

| Configuration                      | Cost per page |
| ---------------------------------- | ------------- |
| Keep or Drop with a range filter   | 0 credits     |
| Keep or Drop with a keyword filter | 0.5 credits   |

The 0.5-credit tier applies only when the node has to read text to decide. Page-number filters stay free. See [credits](/admin/credits) for the full per-node pricing breakdown.

## Related

<CardGroup cols={2}>
  <Card title="Split action" icon="scissors" href="/nodes/split">
    Cut one upload into several sub-documents
  </Card>

  <Card title="Parse action" icon="file-lines" href="/nodes/parse">
    Produce the page text Filter matches on
  </Card>

  <Card title="Extract action" icon="sparkles" href="/nodes/extract">
    Extract data from the pages you kept
  </Card>

  <Card title="Conditional routing guide" icon="book" href="/guides/conditional-routing">
    Branch a run with edge conditions
  </Card>
</CardGroup>
