Overview

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.
Notte workflows are simple python scripts that can be executed both locally and in the cloud.

Workflow Management

Python SDK

The following snippet shows how to manage your workflows using the Notte Python SDK.
from notte_sdk import NotteClient

notte = NotteClient()

# simple scraping workflow
code = """
from notte_sdk import NotteClient
notte = NotteClient()
def run(url: str):
    with notte.Session() as session:
        session.execute({"type": "goto", "url": url})
        return session.scrape()
"""
with open("my_scraping_workflow.py", "w") as f:
    f.write(code)

# Create a new workflow from a Python file
workflow = notte.Workflow(
    workflow_path="my_scraping_workflow.py",
)
print(f"Workflow created with ID: {workflow.response.workflow_id}. You can reference it using `notte.Workflow(<workflow_id>)`")

# Run the workflow with variables
result = workflow.run(url="https://shop.notte.cc/", local=True)
print(f"Workflow completed with result: {result}")

# Update workflow with new version
workflow.update(workflow_path="updated_workflow.py")

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

Key points

  • You can create workflows from Python files.
  • Workflows support both local and cloud execution modes.
  • Workflows can be executed with custom variables
  • Each workflow can be versioned for better management and rollback capabilities.
  • List all workflows using notte.workflows.list().