Skip to main content
This guide will help you set up Amazon Nova Act and run your first browser automation workflow.

Prerequisites

Before you begin, make sure you have:
  • Python 3.10 or above
  • macOS Sierra+, Ubuntu 22.04+, WSL2, or Windows 10+
  • An internet connection

Step 1: Install Nova Act

Install the SDK using pip:
pip install nova-act
The first time you run Nova Act, it may take 1-2 minutes to start while Playwright modules are installed. Subsequent runs will be much faster.

Step 2: Get your API key

1

Visit the Nova Act playground

Navigate to nova.amazon.com/act and sign in
2

Generate an API key

Generate a new API key from your account settings
3

Set the environment variable

Save your API key as an environment variable:
export NOVA_ACT_API_KEY="your_api_key"
For production deployments, use IAM-based authentication. See the authentication guide for details.

Step 3: Run your first workflow

Create a file called first_workflow.py:
from nova_act import NovaAct

with NovaAct(starting_page="https://nova.amazon.com/act/gym/next-dot/search") as nova:
    nova.act("Find flights from Boston to Wolf on Feb 22nd")
Run the script:
python first_workflow.py
Nova Act will:
  1. Open a Chrome browser
  2. Navigate to the starting page
  3. Execute your task using AI-powered automation
  4. Close the browser when complete
Don’t interact with the browser while act() is running, as the model won’t know about your manual changes.

Step 4: Extract structured data

Now let’s extract information from a web page using Pydantic schemas:
from nova_act import NovaAct
from pydantic import BaseModel

class FlightInfo(BaseModel):
    price: float
    departure_time: str
    arrival_time: str

with NovaAct(starting_page="https://nova.amazon.com/act/gym/next-dot/search") as nova:
    # Search for flights
    nova.act("Find flights from Boston to Wolf on Feb 22nd")
    
    # Extract the cheapest flight details
    result = nova.act_get(
        "Find the cheapest flight and return its price, departure time, and arrival time",
        schema=FlightInfo.model_json_schema()
    )
    
    # Parse the response
    flight = FlightInfo.model_validate(result.parsed_response)
    
    print(f"Cheapest flight found:")
    print(f"  Price: ${flight.price}")
    print(f"  Departs: {flight.departure_time}")
    print(f"  Arrives: {flight.arrival_time}")
The act_get() method returns structured data that matches your Pydantic schema.

Step 5: Interactive mode

You can also use Nova Act interactively in the Python shell:
python
>>> from nova_act import NovaAct
>>> nova = NovaAct(starting_page="https://nova.amazon.com/act/gym/next-dot")
>>> nova.start()
>>> nova.act("Navigate to the search page")
>>> nova.act("Search for apartments in Boston")
>>> nova.stop()
In interactive mode, use ctrl+x to exit the agent action while keeping the browser open. Using ctrl+c will exit the browser and require a restart.

Common patterns

Search and filter

with NovaAct(starting_page="https://example.com") as nova:
    nova.act("Search for laptops")
    nova.act("Filter by price under $1000")
    nova.act("Sort by customer rating")

Form filling

with NovaAct(starting_page="https://example.com/form") as nova:
    nova.act(
        "Fill in the form with name 'John Doe', "
        "email '[email protected]', and phone '555-0123'"
    )
    nova.act("Submit the form")

Multi-step workflow

from nova_act import NovaAct

with NovaAct(starting_page="https://example.com") as nova:
    # Step 1: Search
    nova.act("Search for red running shoes")
    
    # Step 2: Filter
    nova.act("Select size 10")
    nova.act("Filter by brands: Nike, Adidas")
    
    # Step 3: Extract data
    result = nova.act_get(
        "Return the price of the first product",
        schema={"type": "number"}
    )
    
    price = result.parsed_response
    print(f"Found product for ${price}")

Tips for better results

\u274c Don’t: "Let's see what products are available"\u2705 Do: "Navigate to the products page"
\u274c Don’t: "Book a hotel"\u2705 Do: "Book a hotel in Houston from March 15-17 for two adults under $150 per night"
\u274c Don’t: "Search for products, add to cart, checkout, and get confirmation number"\u2705 Do: Break into separate act() calls for each major step

Next steps

Core concepts

Learn about workflows, browser automation, and prompting

Data extraction

Master structured data extraction with Pydantic

Deployment

Deploy workflows to AWS for production use

API reference

Explore the complete NovaAct API

Troubleshooting

Make sure Nova Act is installed in your current Python environment:
pip show nova-act
If not installed, run:
pip install nova-act
Verify your API key is set correctly:
echo $NOVA_ACT_API_KEY
Make sure you exported it in the same terminal session where you’re running your script.
Nova Act may need to install Playwright browsers on first run. Wait 1-2 minutes for the initial setup to complete.Optionally, pre-install Chrome:
playwright install chrome
Try these improvements:
  • Make your prompt more specific
  • Break the task into smaller steps
  • Add hints about how to use specific UI elements
  • Reduce the number of steps needed (aim for under 30)

Learn more

Build docs developers (and LLMs) love