A workspace is a persistent storage container that lives across sessions. Use workspaces to share files between tasks — upload input data before a task starts, or retrieve output files after it completes.
Every project gets a default “My Files” workspace automatically.
Pass workspace_id when running a task. The agent can read and write files in the workspace during execution.
Copy
Ask AI
from browser_use_sdk.v3 import AsyncBrowserUseclient = AsyncBrowserUse()workspace = await client.workspaces.create(name="my-workspace")result = await client.run( 'Create a file called HEARTBEAT.md with the text "say hello"', workspace_id=str(workspace.id),)print(result.output)
After a task completes, list files in the workspace or clean up individual files.
Copy
Ask AI
# List filesfiles = await client.workspaces.files(workspace_id, include_urls=True)for f in files.files: print(f.path, f.size)# Delete a fileawait client.workspaces.delete_file(workspace_id, path="HEARTBEAT.md")
Deleting a workspace permanently removes all its files. This cannot be undone.