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

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:

<CodeGroup>
  ```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}`);
  ```
</CodeGroup>

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

<CodeGroup>
  ```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);
  ```
</CodeGroup>

## 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](/features/functions/creating) and [Function Invocations](/features/functions/invocations) for complete examples.

## Parameters

<ParamField path="function_id" type="str | None" default="None" />

<ParamField path="decryption_key" type="str | None" default="None" />

<ParamField path="path" type="str">
  The path to the function to upload.
</ParamField>

<ParamField path="name" type="str | None" />

<ParamField path="description" type="str | None" />

<ParamField path="shared" type="bool" />


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