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

What are Functions?

Functions turn your automation scripts into:
  • API endpoints you can call with HTTP requests
  • Scheduled jobs that run on a cron schedule
  • Reusable workflows accessible from anywhere
  • Shareable automations for your team
Unlike running scripts locally, Functions:
  • ✅ Run on Notte’s infrastructure (no servers to manage)
  • ✅ Scale automatically based on demand
  • ✅ Provide built-in logging and monitoring
  • ✅ Can be invoked from any platform (Python, JavaScript, cURL, etc.)
  • ✅ Support scheduling and automation

How Functions Work

1. Write Your Script

Create a Python file with a run() function:
basic_function.py

2. Deploy to Notte

Upload your script to create a Function:
deploy_function.py

3. Invoke the Function

Call your Function as an API:
invoke_sdk.py

Function Structure

The Handler Function

Functions must have a run() function that serves as the entry point:
handler_function.py
Key points:
  • Named run() - this is the entry point
  • Can accept parameters (passed as variables when invoked)
  • Should have type hints for clarity
  • Should include docstring documentation
  • Returns a value (any JSON-serializable type)

Parameters

Define parameters as arguments to the run function:
parameters_example.py
Pass values when invoking the function:
pass_values.py

Return Values

Functions can return any JSON-serializable data:
return_values.py

Use Cases

1. Scheduled Scraping

Extract data on a schedule:
price_monitor.py
Schedule: 0 9 * * * (Every day at 9 AM)

2. API Endpoints

Expose automation as an API:
contact_extractor.py

3. Webhooks

Trigger automations from external events:
order_processor.py

4. Batch Processing

Process multiple items in parallel:
bulk_data_extract.py

How Functions Fit In

Functions are a deployment layer - they turn any automation into a reusable API.
  • Session - The cloud browser that runs everything
  • Scripted Automation vs Agent - How you control the session
  • Function - Deploys your automation as an API with scheduling, versioning, and sharing
Use Functions when:
  • You need to run automation repeatedly
  • You want to expose automation as an API
  • You need scheduling capabilities
  • You want to share automation with team or customers
Functions can contain either scripted automation or agents - they’re not mutually exclusive.

Function Lifecycle

  1. Write - Create Python script with run() function
  2. Deploy - Upload to Notte (creates function ID)
  3. Version - Notte tracks versions automatically
  4. Invoke - Call via API, schedule, or webhook
  5. Execute - Runs on Notte infrastructure
  6. Monitor - View logs, replays, and results

Best Practices

1. Use Clear Parameters

Define parameters with type hints and descriptions:
bp_clear_parameters.py

2. Return Structured Data

Always return JSON-serializable data:
bp_return_structured.py

3. Handle Errors Gracefully

Catch exceptions and return meaningful errors:
bp_handle_errors.py

4. Add Logging

Log important steps for debugging:
bp_add_logging.py

Next Steps

Creating Functions

Learn how to write and deploy Functions

Invocations

Call Functions via API, SDK, or cURL

Schedules

Schedule Functions with cron

Management

Update, version, and monitor Functions