# Flow in VS Code

> Install and configure the UiPath for Visual Studio Code extension to build, debug, and deploy flows from your local workspace.

## What it is

The **UiPath for Visual Studio Code** extension lets you build, debug, and deploy flows from VS Code. It ships a visual editor for `.flow` files, signs you in to UiPath, and packages and publishes your work to Orchestrator.

The canvas, nodes, variables, and debugging work the same way they do in Studio Web. This page covers what's specific to VS Code: installing the extension, signing in, and packaging from your local workspace. For how to build flows, refer to the rest of this guide, starting with [Your first Flow](quickstart.md).

## Before you start

You need the following:

- VS Code **1.110.0** or higher.
- A UiPath account.
- **Node.js and npm** available on your `PATH`. On first sign-in, the extension installs the UiPath CLI (`uip`) with npm (`npm install -g @uipath/cli@1.0.0`).
- Network access to your UiPath environment.

:::note
In remote workspaces (Windows Subsystem for Linux (WSL), SSH, Codespaces, or dev containers), the extension runs on the remote host. The UiPath CLI must be installed there, not on your local machine.
:::

## Install the extension

1. Install **UiPath Maestro** from the [VS Code Marketplace](https://marketplace.visualstudio.com/vscode) or [Open VSX Registry](https://open-vsx.org/).
2. Reload VS Code when prompted.
3. Select the **UiPath** icon in the Activity Bar to open the UiPath view.

![Maestro Flow file open in VS Code showing a multi-node flow canvas with the flow metadata panel on the right.](https://dev-assets.cms.uipath.com/assets/images/maestro/flow-vs-code-34b162b7.webp)

The UiPath view has three sections:

- **Connect** shows your sign-in status, environment, and tenant.
- **Solution Explorer** lists the solutions, projects, and flows in your workspace.
- **Resources** lists folders and Orchestrator resources for the selected tenant once you sign in.

## Sign in

The extension signs you in in-process, using the bundled UiPath auth library to run an OAuth/Proof Key for Code Exchange (PKCE) browser flow. The extension never stores your tokens.

1. In the **Connect** section, select **Sign In**.
2. If the CLI isn't installed yet, accept the prompt to install it. The extension runs `npm install -g @uipath/cli@1.0.0`.
3. Your browser opens to complete sign-in. The auth library receives the callback on `localhost` port `8104`.
4. After you authorize, return to VS Code. Your session refreshes automatically from then on.

To sign out, select **Sign Out** in the **Connect** section. This signs you out in-process and clears the cached session.

:::note
Sign-in uses port `8104` on `localhost` for the OAuth callback. If sign-in fails, a stale process may be holding the port. Free it and try again. On macOS or Linux, run `lsof -ti :8104 | xargs kill -9`. On Windows, run `netstat -ano | findstr :8104` to find the process ID, then `taskkill /F /PID <id>`.
:::

## Select your environment and tenant

After you sign in, choose where you're working.

1. Run **UiPath: Select Environment** to confirm your environment. The default is Cloud.
2. Run **UiPath: Select Tenant** to pick your tenant or organization.

The **Resources** section then lets you browse folders and resources for the selected tenant.

**Result:** The Resources section populates with folders and Orchestrator resources for your selected tenant.

## Create or open a flow

- Run **Flow: New Flow** (`Ctrl/Cmd+Alt+N`) to create a new `.flow` file.
- Open an existing `.flow` file from the Explorer, or run **Flow: Open Flow** (`Ctrl/Cmd+Alt+O`).
- With a solution open, select **Add Flow** in the **Solution Explorer** title bar to add a flow to the active project.

The file opens in the visual flow editor. Build, connect nodes, and configure them exactly as you would in Studio Web.

## Package and deploy

You publish from VS Code by packaging your workspace as a UiPath solution and deploying it to Orchestrator. Refer to [Deploying a flow](deploying-a-flow.md) for what deployment does.

- **UiPath: Package** builds a `.uipx` solution from the current workspace.
- **UiPath: Deploy** uploads a packaged solution to Orchestrator.
- **UiPath: Package & Deploy** runs both steps together.
- **UiPath: Switch Deploy Target** changes the destination folder.

By default, the extension activates the deployment after a successful deploy. To deploy without activating, turn off the `uipath.autoActivateDeployment` setting.

To run the same package from the UiPath CLI, run **UiPath: Generate .env File**. This writes a `.env` file compatible with `uip`.

## Debug

Debugging in VS Code routes through your selected Cloud tenant. Run a flow from the editor and watch execution in the live debug view, which renders a Mermaid execution flowchart that updates as the run progresses. Refer to [Debugging effectively](debugging-effectively.md) for how to read a run and resolve failures.

## Commands and keyboard shortcuts

Run any command from the Command Palette (`Ctrl/Cmd+Shift+P`). The flow editor shortcuts apply only when a `.flow` file is the active editor.

### Flow editor

| Command | Default keybinding |
|---|---|
| **Flow: New Flow** | `Ctrl/Cmd+Alt+N` |
| **Flow: Open Flow** | `Ctrl/Cmd+Alt+O` |
| **Flow: Save Flow** | `Ctrl/Cmd+S` |
| **Flow: Save Flow As** | `Ctrl/Cmd+Shift+S` |
| **Flow: Undo** | `Ctrl/Cmd+Z` |
| **Flow: Redo** | `Ctrl+Y` / `Cmd+Shift+Z` |
| **Flow: Zoom In** | `Ctrl/Cmd+=` |
| **Flow: Zoom Out** | `Ctrl/Cmd+-` |
| **Flow: Reset Zoom** | `Ctrl/Cmd+0` |
| **Flow: Fit to Screen** | `Ctrl/Cmd+Shift+F` |
| **Flow: Validate Flow** | `Ctrl/Cmd+Shift+V` |
| **Flow: Export Flow** | None |

### UiPath platform

| Command | Description |
|---|---|
| **UiPath: Sign In** | Sign in to UiPath. |
| **UiPath: Sign Out** | Sign out and clear the cached session. |
| **UiPath: Select Environment** | Choose the UiPath environment. |
| **UiPath: Select Tenant** | Choose the tenant or organization. |
| **UiPath: Package** | Build a `.uipx` solution from the workspace. |
| **UiPath: Deploy** | Upload a packaged solution to Orchestrator. |
| **UiPath: Package & Deploy** | Package and deploy in one step. |
| **UiPath: Switch Deploy Target** | Change the destination folder. |
| **UiPath: Generate .env File** | Write a CLI-compatible `.env` file. |
| **UiPath: Refresh** | Refresh the Connect tree. |
| **UiPath: Show Output Log** | Open the UiPath output channel. |
| **UiPath: Getting Started** | Open the Getting Started walkthrough. |

For the full set of canvas shortcuts, refer to [Keyboard shortcuts](keyboard-shortcuts-for-maestro.md).

## Settings

Configure the extension in VS Code settings.

### `uipath.environment`

The UiPath environment used when signing in. Default is `cloud`. An existing CLI session takes precedence if it points elsewhere.

### `uipath.autoActivateDeployment`

Activates a solution deployment after a successful deploy. Default is `true`.

### `uipath.cli.path`

An absolute path to the UiPath CLI binary (`uip`). Leave it empty to find `uip` on your `PATH`. Set this when the CLI is installed in a location that isn't on your `PATH`.

### `uipath.telemetry.enabled`

Sends anonymized usage telemetry. Default is `true`. The extension also honors VS Code's global `telemetry.telemetryLevel`. Turning off either setting disables telemetry.

## Troubleshooting

### Sign-in fails

Sign-in fails when the OAuth callback port is busy or the CLI lost its session.

- **Port in use.** The CLI uses port `8104` on `localhost` for the callback. If a stale process holds it, free the port and sign in again. On macOS or Linux, run `lsof -ti :8104 | xargs kill -9`. On Windows, run `netstat -ano | findstr :8104`, then `taskkill /F /PID <id>`.
- **Stale session.** Run **UiPath: Sign Out**, then **UiPath: Sign In** again to force a fresh sign-in.
- **Read the log.** Run **UiPath: Show Output Log** and check the **UiPath** output channel for sign-in errors.

### The CLI isn't found

The extension shells out to `uip`. If it can't find the binary, sign-in and packaging fail.

1. Confirm the CLI is installed by running `uip --version` in a terminal.
2. If `uip` isn't on your `PATH`, set `uipath.cli.path` to the absolute path of the binary.
3. If the CLI isn't installed at all, run **UiPath: Sign In** and accept the install prompt, or install it manually with `npm install -g @uipath/cli@1.0.0`. This requires Node.js and npm on your `PATH`.

### Remote workspaces don't see the CLI

In WSL, SSH, Codespaces, and dev container workspaces, the extension runs on the remote host, not your local machine. The `uip` binary must be installed on that host. A CLI installed on your local Windows or macOS machine isn't visible to the extension. Install the CLI in the remote workspace, then sign in again.

### Deployment doesn't activate

By default, the extension activates a deployment after a successful deploy. If a deployment uploads but doesn't activate, confirm that `uipath.autoActivateDeployment` is turned on.

## Related pages

- [Your first Flow](quickstart.md)
- [Deploying a flow](deploying-a-flow.md)
- [Debugging effectively](debugging-effectively.md)
