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

# setSchedule

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

Schedule the function to run on a cron expression.

```typescript theme={null}
NotteFunction.setSchedule(options: FunctionScheduleOptions): Promise<ScheduleResponse>;
```

## Parameters

<ParamField body="options" type={"FunctionScheduleOptions"} required>
  Cron expression and optional variables passed to each scheduled execution.
</ParamField>

## Returns

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

The saved schedule configuration.

## Raises

* NotteAPIError if the schedule cannot be saved.

## Example

```typescript theme={null}
await fn.setSchedule({ cron: '0 9 * * *', variables: { url: 'https://example.com' } });
```

## Related types

* [FunctionScheduleOptions](/typescript-sdk-reference/types/functionscheduleoptions)
* [ScheduleResponse](/typescript-sdk-reference/types/scheduleresponse)


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