Skip to main content
Workflows 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. Define your function handler as a regular python function.
my_scraping_function.py
from notte_sdk import NotteClient

notte = NotteClient()
# define your function variables as arguments
def run(url: str):
    with notte.Session() as session:
        session.execute(type="goto", url=url)
        return session.scrape()
Each handler function must be named run.
You can create, update and run deployed functions:
deploy_function.py
from notte_sdk import NotteClient
from pathlib import Path

code = """
from notte_sdk import NotteClient

notte = NotteClient()
# define your function variables as arguments
def run(url: str):
    with notte.Session() as session:
        session.execute(type="goto", url=url)
        return session.scrape()
"""

# create a local python file with your function code
with Path("my_scraping_function.py").open("w") as f:
    f.write(code)

notte = NotteClient()

# Use your local python file to deploy a new function
function = notte.Function(
    path="my_scraping_function.py",
    name="My Scraping Flow",
    description="A flow for scraping the web"
)
print(f"Function created with ID: {function.response.function_id}. You can reference it using `notte.Function(<function_id>)`")

Parameters

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