> ## 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.

# Get started

<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#L77)

Function class for managing function runs

## Create NotteFunction

Use [NotteClient.NotteFunction](/typescript-sdk-reference/client/nottefunction) to create this object from your configured client.

```typescript theme={null}
client.NotteFunction(options: FunctionConstructor): NotteFunction;
```

<ParamField body="options" type={"FunctionConstructor"} required />

## Related types

* [FunctionConstructor](/typescript-sdk-reference/types/functionconstructor)

## Usage

* [createRun](/typescript-sdk-reference/function/createrun): Create a cloud run record without starting execution. Optional: use this only when you need the ID before execution, then pass it to run(variables, \{ functionRunId }). run() otherwise creates a new run.
* [run](/typescript-sdk-reference/function/run): Stream logs and wait for the final result by default. Pass \{ stream: false } to receive the backend's JSON response without live logs. Disabling streaming does not make standard-runtime execution non-blocking. Pass functionRunId to execute a record returned by createRun().
* [getRun](/typescript-sdk-reference/function/getrun): Get metadata for a specific function run
* [download](/typescript-sdk-reference/function/download): Download the function code as a python file. Returns the code, and writes it to `path` when one is provided.
* [getUrl](/typescript-sdk-reference/function/geturl): Get the download URL of the function code, decrypting it when the API returns an encrypted one (Notte managed functions).
* [runs](/typescript-sdk-reference/function/runs): List the runs of this function.

<Accordion title="Direct constructor reference">
  ```typescript theme={null}
  new NotteFunction(client: NotteClient, options: FunctionConstructor): NotteFunction;
  ```

  <ParamField body="client" type={"NotteClient"} required />

  <ParamField body="options" type={"FunctionConstructor"} required />

  ## Related types

  * [FunctionConstructor](/typescript-sdk-reference/types/functionconstructor)
</Accordion>

<Accordion title="Properties">
  ### functionId

  ```typescript theme={null}
  functionId: string
  ```

  ### decryptionKey

  ```typescript theme={null}
  decryptionKey?: string | undefined
  ```
</Accordion>
