Skip to main content
Functions enable hybrid automation by combining the precision of scripting with the adaptability of AI agents. They allow you to script the predictable parts of your automation while leveraging agents only when needed, resulting in more reliable and cost-effective automations. Given a script you want to set up as a function:
my_scraping_function.py
from notte_sdk import NotteClient
client = NotteClient()

def run(url: str):
    with client.Session() as session:
        session.execute(type="goto", url=url)
        return session.scrape()
You can create, update and run functions:
play_with_function.py
from notte_sdk import NotteClient

client = NotteClient()

# Create a new function from our local Python file
function = notte.Function(
    workflow_path="my_scraping_function.py",
    name="My Scraping Function",
    description="A function for scraping the web"
)
print(f"Function created with ID: {function.function_id}. You can reference it using `notte.Function(<function_id>)`")

# Run the function, providing variables
response = function.run(url="https://shop.notte.cc/")
print(f"Function completed with result: {response.result}")

# Update function with new version, from our local python file
function.update(workflow_path="my_scraping_function.py")

# List all functions
functions = notte.functions.list()

Parameters

function_id
str | None
default:"None"
decryption_key
str | None
default:"None"
workflow_path
str | None
default:"None"
path
str
required
The path to the function to upload.
name
str | None
description
str | None
shared
bool