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

# createRun

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

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

Create a cloud run record without starting execution, like
`function.create_run()` in Python. Use this only when you need the ID
before execution, then pass it to `run(variables, { functionRunId })`.
`run()` otherwise creates a new run on its own.

```typescript theme={null}
NotteFunction.createRun(options?: FunctionRunCreateOptions): Promise<FunctionRunCreateResult>;
```

## Parameters

<ParamField body="options" type={"FunctionRunCreateOptions"}>
  Run-record settings; `local` defaults to false. Node execution remains cloud-only.

  Default:

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

## Returns

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

A created run record and its ID. No function code has executed yet.

## Raises

* NotteAPIError if run creation is rejected.

## Example

```typescript theme={null}
const created = await fn.createRun();
const result = await fn.run({ url: 'https://example.com' }, { functionRunId: created.function_run_id });
```

## Related types

* [FunctionRunCreateOptions](/typescript-sdk-reference/types/functionruncreateoptions)
* [FunctionRunCreateResult](/typescript-sdk-reference/types/functionruncreateresult)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.