> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/sample.md).

# Sample

> Keep n rows, chosen arbitrarily but the same ones each run.

Keeps `n` rows by ordering on a hash of the whole row and taking the first `n`. That is arbitrary rather than random, and it is already repeatable — the same rows come back every run without a `seed`. Setting one only picks a different arbitrary subset.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `Sample`               |
| Category                 | Primitives · Dataframe |
| Default tier             | `reactive`             |
| Runs on                  | `reactive`, `durable`  |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `n`

`number` · required · defaults to `1000`

How many rows to draw.

### `seed`

`number | null` · required · defaults to `null`

Picks which arbitrary subset is taken. Null is not "unseeded" — it hashes as 0, and repeats like any other value.

## Inputs

| Port   | Kind        | Required | Description                                                                                                                           |
| ------ | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on`   | `event`     | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `data` | `dataframe` | yes      | The frame to work on.                                                                                                                 |

## Outputs

| Port     | Kind        | Connects to           | Description                                                          |
| -------- | ----------- | --------------------- | -------------------------------------------------------------------- |
| `output` | `dataframe` | `dataframe`, `signal` | At most `n` rows, the same ones each run for a given frame and seed. |

***

[← All application modules](/more-details/applications/application-modules.md)
