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

# Environments

> The sandbox a workflow runs in: Browser, Linux or Windows, the custom environments that configure it, and live environments for building and testing.

Every workflow runs inside an isolated sandbox. The **environment** decides what that sandbox is, how it is configured, and how the workflow acts on the target system.

## How workflows, environments and profiles connect

Think of a job, a machine and an account.

| Part | Think of it as | Who picks it |
| - | - | - |
| **Workflow** | The job | You, when you trigger it |
| **Environment** | The machine | The workflow version. Each version stores one environment, or none. |
| **[Profile](https://docs.asteroid.ai/concepts/profiles.md)** | The account | The trigger: an execute call, a schedule or a batch |

* The workflow version picks the machine. A trigger cannot pick it.
* The machine lists the accounts it accepts, and refuses any other.
* The trigger picks the account from that list.

The environment holds the list of profiles. It holds no list of the workflows that use it. A [warm pool](#warm-pool) signs in to its accounts before any run exists, so the machine must know its accounts ahead of time.

Several workflows can share one environment. They then share its settings and its profile list. An edit to the environment changes it for all of them.

A version with no environment runs on a **base environment**: a fresh machine of the workflow's own environment type, with default settings and no profile list. Any profile, any profile group, or none may run on it. "Base" is not a saved object or a fallback rule. It only means that no environment was picked.

There are three ways to get an environment.

| Way | What it is | Where you set it |
| - | - | - |
| **Base environment** | Browser, Linux or Windows. A fresh machine per execution. | The environment control in the builder's bottom bar |
| **[Custom environment](#custom-environments)** | A saved environment with its own environment type, networking, stealth, cookies, extensions, allowed profiles and warm pool. | **Environments** page, or the environment control in the builder's bottom bar |
| **[Live environment](#live-environments)** | A sandbox started outside a workflow run. Astro starts one to explore and test while it builds. You can start one to drive yourself. | Astro, while it builds. You: `environment_start` (MCP) or `POST /environments` (API) |

## Environment types

A workflow has one environment type, and it applies to every node. A bound custom environment replaces it with its own environment type.

| Type | Best for | How the workflow acts |
| - | - | - |
| **Browser** | Web apps and websites | Page structure, scripts, and screenshots |
| **Linux** | Linux desktop applications | Screenshots, mouse and keyboard |
| **Windows** | Windows-only software | Screenshots, mouse and keyboard |

The type also decides which capabilities an Agent node can use. See [What a node can do](https://docs.asteroid.ai/concepts/node-capabilities.md).

| Type | `browser_use` | `computer_use` |
| - | - | - |
| Browser | On by default | Off by default |
| Linux or Windows | Always off | Always on |

### Browser

A headless Chromium sandbox. Choose it when the work happens on the web: forms, web apps, pulling content out of pages, and scripted browser steps.

A node in this environment has three ways to act, and one workflow can mix all three:

* **Page structure**: click, type and select by reading the DOM. This is the default.
* **Scripts**: deterministic JavaScript for precise, repeatable steps.
* **Computer use**: screenshot and coordinate actions, for pages the DOM cannot handle.

Browser downloads land in `downloads/`. See [Workflow filesystem](https://docs.asteroid.ai/concepts/filesystem.md).

### Linux

A full Linux desktop session. Choose it for native desktop applications, terminal work, local files through desktop tools, or a mix of browser and desktop steps. The workflow works through **computer use**: the model reads screenshots and issues mouse and keyboard actions.

### Windows

A Windows desktop session. Choose it for enterprise desktop tools, Windows-only vendor clients and internal apps that need a Windows runtime. The workflow works through **computer use**, the same way it does on Linux.

> [!NOTE]
>
> Windows workflows start after a demo with our team. Ask us at [support@asteroid.ai](mailto:support@asteroid.ai).

> [!TIP]
>
> Computer use is slower and costs more than browser use. Pick Browser when the task can be done on the web.

## Custom environments

A **custom environment** is a saved environment definition. It fixes the environment type and its settings, lists the [profiles](https://docs.asteroid.ai/concepts/profiles.md) the workflow may run as, and can keep pre-booted copies ready so executions start in seconds.

### In the platform

Open **Environments** in the sidebar. Click **New environment** and pick **Browser**, **Linux desktop** or **Windows desktop**. The form walks through the sections one at a time.

Click an environment to open its drawer. Click **Edit** in the drawer header to turn every section into its form, then save once.

The **Gateways** tab holds your gateways: a fixed IP, or a route into your own network. See [Networking](https://docs.asteroid.ai/networking/overview.md).

### Set it from the builder

Open the environment control in the builder's bottom bar. It lists the **Built-in** base environments and your **Custom** environments. **New environment** creates one.

The choice is saved on the workflow version, not on the workflow. A run uses the published version unless the trigger asks for another, so publish the version for its environment to take effect. A version under test can point at a different environment from the published one.

A custom environment replaces the workflow's environment type. Every execution of that version boots from it.

### Sections

| Section | What it decides |
| - | - |
| **General** | Name, **Environment type** (Browser, Linux or Windows) and, for Linux and Windows, the **Snapshot** it boots from. |
| **Networking** | How traffic leaves the sandbox. |
| **Browser** | Stealth, page content, cookies and extensions. Browser only. |
| **Profiles** | Which profiles and profile groups may run. |
| **Auth** | How sign-in state carries over: None, Authed cache, [Warm cache](#warm-cache) or [Warm pool](#warm-pool). |
| **Pool members** | The live warm-pool copies. Shown when a warm pool is set. |

### Settings

| Setting | Browser | Linux, Windows |
| - | - | - |
| **Snapshot** | — | The default image, one of your organization's snapshots, or a shared one |
| **Networking** | None, Managed proxy (pick a country), Custom proxy, or Gateway (pick a gateway preset) | None or Gateway |
| **Stealth** | Extra stealth and captcha solving. Both need a managed proxy. A sticky IP always uses extra stealth. | — |
| **Page content** | Ad, popup and media blocking, popups as tabs, PDF viewer | — |
| **Cookies** | Injected into every session | — |
| **Extensions** | Organization extensions loaded into every session. See [Extensions](#extensions). | — |

### Extensions

An extension is a Chrome extension your organization uploads once. Any Browser environment in the organization can then load it.

Manage them in the **Extensions** group of the **Browser** section:

* **Add existing** picks extensions the organization already has.
* **New extension** uploads a ZIP and adds it to this environment. `manifest.json` must sit at the root of the ZIP. The version shown comes from the manifest. Names are unique within the organization.

Each row has a menu:

| Action | Effect |
| - | - |
| **Replace version** | Uploads a new ZIP. Every environment that uses the extension gets the new version. |
| **Remove from environment** | Takes it off this environment only. Saved when you save the environment. |
| **Delete extension** | Deletes it from the organization. Every environment that uses it loses it. |

Adding or removing an extension takes effect when you save the environment. Uploading, replacing and deleting take effect at once.

### Profile rows

The profile list is a whitelist. Each row is one profile or one profile group.

* **No rows**: any profile or profile group may run, or none.
* **One row**: only that row may run. A trigger that names nothing runs on it.
* **Several rows**: every trigger must name one of them. A trigger that names nothing is refused.

> [!WARNING]
>
> Adding a second row changes every trigger that names no profile. Those triggers worked with one row. With two, they get a 400. This applies to every workflow that shares the environment.

A profile group row is named by its ID (`profileGroupId`). A profile inside a group row cannot be named on its own, unless it is also a row itself. The group hands out the rest.

A trigger outside the whitelist is refused with a 400 before anything runs. Runs, scheduled executions, batches and recurring schedules are checked when they are created or saved. A recurring schedule is checked again each time it fires.

On the platform, the run, batch and schedule forms list only the rows. They link to the environment to add a missing profile.

The list belongs to the environment. Every workflow on it shares the list. To give one workflow its own list, create a separate environment for it.

### Warm pool

Keep-warm boots copies of the environment ahead of time. An execution claims a ready copy and skips the boot.

A warm pool is a capacity limit, not only a speed-up. When no copy is ready for the run's profile, the trigger is refused with a 429. It does not fall back to a cold boot. The error names the profiles that do have a ready copy. Retry the call, and size the ready count for peak load, not average load.

The **ready count** applies per profile row. An environment with two rows and a ready count of one keeps two copies, one on each profile. A profile group row without concurrent use keeps a distinct profile on each of its copies, so it needs at least as many profiles as the ready count. A group row with concurrent use spreads its copies evenly over its profiles, so any group size works. An environment with no rows keeps the ready count in total.

A claimed copy always holds the profile the execution resolved. Cookies and proxy were set at boot, so a copy on another profile is never handed out.

| Setting | Meaning |
| - | - |
| **Usage** | Single use retires a copy after one execution. Reusable copies serve several, up to a concurrency you set. |
| **Schedule** | Windows of the week with their own ready count per row, for example more during office hours and none overnight. |
| **Lifetime** | Copies retire and are replaced past this age. |
| **Preparation** | An agent that runs on every fresh copy before it becomes claimable, for example to sign in. |
| **Success outcomes** | The outcomes of the preparation agent that mean it worked. See [Success outcomes](#success-outcomes). |

Removing a row retires the copies it held. Lowering the ready count retires the oldest idle copies first. An organization can keep a limited number of warm copies across all of its environments.

### Warm cache

Some portals end a session that stays idle. A warm cache keeps the session alive without holding a copy open. On a timer, it boots a browser on each profile, runs your login agent, and stops the browser. The profile keeps the fresh cookies, so the next execution starts signed in and cold boots as usual.

A warm cache needs a Browser environment with cache persistence on, at least one profile row, and no warm pool. Every profile in the rows logs in, including each member of a profile group row.

| Setting | Meaning |
| - | - |
| **Login interval** | Minutes between logins of the same profile. Keep it shorter than the portal's idle timeout. |
| **Login agent** | The agent that signs in, with fixed inputs. |
| **Active hours** | Windows of the week during which logins run, for example office hours. Outside them nothing runs. |
| **Success outcomes** | The outcomes of the login agent that mean it signed in. See [Success outcomes](#success-outcomes). |
| **Executions save browser state (e.g. cookies)** | Off by default. Executions and workflow-bound [live environments](#live-environments) on the environment load the profile but do not save it, so only the login agent writes the session. A run that ends logged out cannot sign out the runs after it. Turn it on to let executions save too. The first run that uses a profile's [sticky IP](https://docs.asteroid.ai/concepts/profiles.md#sticky-ip) saves anyway, which ties the IP to the profile. Later runs follow this setting. |

The environment's **Logins** tab shows each profile's last login, the execution that did it, and any login that is running or failed. A failed login retries after a short backoff and keeps the last successful login on record. A login that hangs is stopped after 30 minutes. At most three logins run at once per environment.

### Success outcomes

An agent that cannot sign in can still complete, for example on a `login_failed` outcome. By default any completed run counts as a success. Pick **success outcomes** to count only the runs that end on one of them.

A run that completes on any other outcome is treated as a failed run. A warm pool stops that copy and boots a replacement, so an execution never claims a copy that is not signed in. A warm cache records a failed login and retries after the backoff.

The choices are the outcomes of the agent's published version. Saving rejects an outcome that version does not return. If you later publish a version without a chosen outcome, no run can succeed until you update the environment.

## How a run is routed

Every execute call, schedule, scheduled execution and batch item takes these steps in order.

| Step | Case | Result |
| - | - | - |
| 1. Which version runs | The trigger names no version | The published version |
| | The trigger names a version | That version |
| 2. Which environment | The version has no environment | A base environment. Step 3 is skipped, and any profile passes. |
| | The version points at an environment | That environment |
| | That environment was deleted | 400: the custom environment does not exist |
| 3. Which profile | The environment has no rows | Any profile or profile group, or none |
| | One row, the trigger names nothing | That row |
| | Several rows, the trigger names nothing | 400: choose a profile or profile group |
| | The trigger names a row | That row |
| | The trigger names a profile or group outside the list | 400: the environment does not allow it |
| | The trigger names a profile that is only inside a group row | 400: use the group row instead |
| 4. Which group member | A member is free | Picked by the group's [selection strategy](https://docs.asteroid.ai/concepts/profiles.md#selection-strategies) |
| | Every member is busy, shared use off | 429, or queued with `"onCapacityLimit": "queue"` |
| | The group has no members | 400 |
| 5. Warm or cold | No warm pool | Cold boot |
| | A warm copy holds the profile | The run claims it |
| | No warm copy is ready for the profile | 429. No cold boot. |

The environment then supplies the machine type, snapshot, networking, stealth, extensions and cookies. The profile supplies secrets, the email inbox, the sticky IP and saved browser state.

## Best practices

* Create one environment per portal and network path, not one per workflow.
* Share an environment only between workflows that sign in with the same profiles. They share its profile list.
* Keep one profile row when you can. Triggers then need not name a profile. To rotate accounts, put them in one profile group row, not in several rows.
* Put a profile in one place: its own row, or a group row. Not both.
* Add a warm pool only when boot or sign-in time matters. Callers must retry on 429.
* Do not delete an environment or a profile group while a workflow version, schedule or batch uses it. A deleted environment makes every run of the versions that point at it fail with a 400.
* Remember that the environment is picked per version. A test of an unpublished version can run on a different environment from the published one.

## Live environments

A **live environment** is a sandbox started outside a workflow run, instead of one an execution starts for you. Nothing runs inside it unless someone drives it.

A live environment bound to a workflow boots from the workflow's custom environment, if it has one. It takes the environment type, snapshot and settings. Under a [warm cache](#warm-cache) with **Executions save browser state (e.g. cookies)** off, it loads the profile but does not save it. A live environment with no workflow uses no custom environment.

### Started by Astro

Astro starts one while it builds a workflow. It boots from the workflow's environment type and the profile Astro picks. Astro uses it to explore the site and try steps before writing them. You can watch it in the builder.

### Started by you

Start one to test a page or an app by hand, or to drive a browser from your own code.

Start it with `environment_start` (MCP) or `POST /environments` (API). Pass your `organizationId`, and optionally a `workflowId` to bind it to a workflow.

The response carries a `connection.cdpUrl`, a websocket URL at `wss://cdp.asteroid.ai`. Point any Chrome DevTools Protocol (CDP) client at it, such as Playwright's `connectOverCDP`.

Read it with `environment_get`. Stop it with `environment_stop` when you are done. One you do not stop ends on its own at its session timeout.

See the [API reference](https://docs.asteroid.ai/api-reference/overview.md) for the full request and response shape.

## What every environment shares

The sandbox layout is identical in all of them. Each execution mounts `/home/agent` with the same four directories: `shared/`, `workspace/`, `downloads/` and `uploads/`. See [Workflow filesystem](https://docs.asteroid.ai/concepts/filesystem.md).

The [profile](https://docs.asteroid.ai/concepts/profiles.md) supplies secrets, whatever the environment.

> [card] [What a node can do](https://docs.asteroid.ai/concepts/node-capabilities.md)
>
> Capabilities and the tools they unlock

> [card] [Workflow settings](https://docs.asteroid.ai/concepts/workflow-settings.md)
>
> Timeout and global rules

> [card] [Profiles](https://docs.asteroid.ai/concepts/profiles.md)
>
> The identity an environment runs as

> [card] [Browser vs computer use](https://docs.asteroid.ai/concepts/browser-vs-computer-use.md)
>
> How the workflow acts in each type


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.