> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browser-use.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces & files

> Persist files across V4 runs and conversations.

A **workspace** is a persistent filesystem shared by runs—even runs in
different sessions. Use it for inputs, scripts, and generated files.

<img src="https://mintcdn.com/browseruse-0aece648/BCDzEtKfFmujvTtJ/cloud/images/v4-workspaces-light.svg?fit=max&auto=format&n=BCDzEtKfFmujvTtJ&q=85&s=3fae6fde0b7d2962b3fddeef34e7e29c" alt="Two independent sessions reading and writing people.csv, script.py, and output.json in one persistent workspace" noZoom className="block dark:hidden" width="1200" height="480" data-path="cloud/images/v4-workspaces-light.svg" />

<img src="https://mintcdn.com/browseruse-0aece648/BCDzEtKfFmujvTtJ/cloud/images/v4-workspaces-dark.svg?fit=max&auto=format&n=BCDzEtKfFmujvTtJ&q=85&s=d8f7380564247c9138a587d0935d7c43" alt="Two independent sessions reading and writing people.csv, script.py, and output.json in one persistent workspace" noZoom className="hidden dark:block" width="1200" height="480" data-path="cloud/images/v4-workspaces-dark.svg" />

## Upload and attach a file

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk.v4 import BrowserUse

  client = BrowserUse()
  workspace = client.workspaces.create(name="research")
  uploaded = client.workspaces.upload(workspace.id, "people.csv")

  run = client.runs.create(
      "Find everyone in the CSV who works at Google",
      workspace_id=workspace.id,
      attached_file_ids=[uploaded[0].id],
  )
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v4";

  const client = new BrowserUse();
  const workspace = await client.workspaces.create({
    name: "research",
  });
  const uploaded = await client.workspaces.upload(
    workspace.id,
    "people.csv",
  );

  const run = await client.runs.create({
    task: "Find everyone in the CSV who works at Google",
    model: "grok-4.5",
    workspaceId: workspace.id,
    attachedFileIds: [uploaded[0].id],
  });
  ```
</CodeGroup>

Attachments are run-scoped. Reusing a workspace does not reattach every upload.

## Retrieve created files

Ask the agent to save its output, then list the workspace:

<CodeGroup>
  ```python Python theme={null}
  files = client.workspaces.files(
      workspace.id,
      include_urls=True,
  )
  for file in files.files:
      print(file.path, file.url)
  ```

  ```typescript TypeScript theme={null}
  const files = await client.workspaces.files(
    workspace.id,
    { includeUrls: true },
  );
  for (const file of files.files) {
    console.log(file.path, file.url);
  }
  ```
</CodeGroup>

Download URLs expire after 60 seconds. See the [workspace API
reference](/cloud/api-v4/workspaces/list-workspace-files) for pagination and
limits.
