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
Given a script you want to set up as a workflow:
from notte_sdk import NotteClient, actions
notte = NotteClient()
def run(url: str):
with notte.Session() as session:
session.execute(actions.Goto(url=url))
return session.scrape()
You can create, update and run workflows:
from notte_sdk import NotteClient
notte = NotteClient()
# Create a new workflow from our local Python file
workflow = notte.Workflow(
workflow_path="my_scraping_workflow.py",
name="My Scraping Workflow",
description="A workflow for scraping the web"
)
print(f"Workflow created with ID: {workflow.response.workflow_id}. You can reference it using `notte.Workflow(<workflow_id>)`")
# Run the workflow, providing variables
response = workflow.run(url="https://shop.notte.cc/")
print(f"Workflow completed with result: {response.result}")
# Update workflow with new version, from our local python file
workflow.update(workflow_path="my_scraping_workflow.py")
# List all workflows
workflows = notte.workflows.list()
Additionally, you can fork a public workflow into your own private workflow.
from notte_sdk import NotteClient
notte = NotteClient()
workflow = notte.Workflow("<any-public-workflow-id>")
# creates a private copy of the workflow (only works for public workflows)
workflow = workflow.fork()
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()
.