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

# runs

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

[Source: node-sdk/src/functions.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/functions.ts#L164)

List the runs of this function.

`only_active` is sent as `false` unless the caller says otherwise, and that
is deliberate rather than redundant. `GET /functions/{function_id}/runs`
now defaults it to `false` server-side as well, but it used to default to
`true`: the request model was a bare subclass of the session one, where
"only active" reads sensibly as "list my running sessions" and, for "list
this function's runs", was a trap. Hitting the endpoint with no query
parameters returned only the runs executing right now - an empty list for
any function that had finished. That cost us a bug in the anything-api
console, where a function with 15 recorded runs displayed "Nothing has run
this endpoint yet".

Sending it explicitly pins this method to the documented behaviour against
whichever API version it is talking to, including deployments that predate
the server-side change. Callers who want only in-flight runs pass
`only_active: true`.

```typescript theme={null}
NotteFunction.runs(options?: FunctionRunListOptions): Promise<PaginatedResponseFunctionRunListItemResponse>;
```

## Parameters

<ParamField body="options" type={"FunctionRunListOptions"}>
  Default:

  ```typescript theme={null}
  {}
  ```
</ParamField>

## Returns

```typescript theme={null}
Promise<PaginatedResponseFunctionRunListItemResponse>
```

## Related types

* [FunctionRunListOptions](/typescript-sdk-reference/types/functionrunlistoptions)
* [PaginatedResponseFunctionRunListItemResponse](/typescript-sdk-reference/types/paginatedresponsefunctionrunlistitemresponse)
