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

> Create, manage, and execute Notte functions

> [!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.

Functions are serverless deployments of your browser automations that can be invoked via API, scheduled to run automatically, or triggered by events.

Write a Python file that exposes a `run` handler. Its parameters become the function's variables:

```python handler_function.py theme={null}
def run(param1: str, param2: int = 10):
    """
    Function docstring explains what it does.

    Args:
        param1: Description of param1
        param2: Description of param2 (optional)

    Returns:
        Description of return value
    """
    # Your automation code
    result = perform_automation(param1, param2)
    return result
```

Deploy the file to get a function ID:

```python deploy_function.py theme={null}
from notte_sdk import NotteClient

client = NotteClient()

# Deploy function
function = client.Function(
    path="my_automation.py", name="Search Automation", description="Searches a website and extracts results"
)

print(f"Function deployed: {function.function_id}")
print(f"Version: {function.response.latest_version}")
```

```typescript deploy_function.ts theme={null}
import { NotteClient } from 'notte-sdk';

const client = new NotteClient();

// Deploy function
const fn = client.NotteFunction({
  path: 'my_automation.py',
  name: 'Search Automation',
  description: 'Searches a website and extracts results',
});

const response = await fn.get();
console.log(`Function deployed: ${response.function_id}`);
console.log(`Version: ${response.latest_version}`);
```

Invoke the deployed function from the SDK. Runs always execute on Notte's cloud:

```python invoke_sdk.py theme={null}
import os

from notte_sdk import NotteClient

client = NotteClient()
function = client.Function(function_id=os.environ["NOTTE_FUNCTION_ID"])

# Via SDK
result = function.run(url="https://example.com", search_query="laptop")

print(result.result)
```

```typescript invoke_sdk.ts theme={null}
import { NotteClient } from 'notte-sdk';

const client = new NotteClient();
const fn = client.NotteFunction({ function_id: process.env.NOTTE_FUNCTION_ID! });

const result = await fn.run({ url: 'https://example.com', search_query: 'laptop' });

console.log(result.result);
```

## Create or load a Function

To deploy code, pass `path` to your Python file. To load an existing Function, pass its `function_id` and omit `path`. See [Creating Functions](https://docs.notte.cc/features/functions/creating.md) and [Function Invocations](https://docs.notte.cc/features/functions/invocations.md) for complete examples.

## Parameters

**function\_id** `str | None` (default: None)

**decryption\_key** `str | None` (default: None)

**path** `str`

The path to the function to upload.

**name** `str | None`

**description** `str | None`

**shared** `bool`


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