Skip to main content

Run a Browser Use agent inside Upstash Box. The agent, the browser, and the files it writes all live in one box, and a schedule runs it again on a cron.

This guide builds an agent that reads Hacker News every morning and saves a report to the box.


1. Set up#


2. Write the agent#

This file runs inside the box. It starts the box’s Chromium, runs the task, and writes the result to reports/.

agent.py

3. Set up the box#

This script runs on your machine. It creates a box with a browser, installs Browser Use, runs the agent once, and schedules it.

setup.py

Example output after the box id. Stories and scores will vary:

The box pauses when idle. Each scheduled run wakes it, and the reports stay on the box.

Note

Run setup.py once. Each run creates a new box with its own daily schedule.


4. Read the reports#

Re-attach with the box id that setup.py printed:

reports.py

Delete the box when you no longer need it:


Next steps#

  • Schedules to pause a schedule or get a webhook when a run finishes.
  • Connect over CDP to drive the box browser with Browser Use from your own machine.
  • Browser for the SDK’s own observe, act, and extract.