Contact Us 1-800-596-4880

Working with Workspaces

logo cloud IDE Cloud IDE

logo desktop IDE Desktop IDE

Open Beta Release: The cloud IDE is in open beta. Any use of Anypoint Code Builder in its beta state is subject to the applicable beta services terms and conditions, available from the IDE.

Organize your Mule projects in workspaces to ensure all Anypoint Code Builder features work correctly. Workspaces help you manage multiple related projects and avoid build-time and design-time issues.

Valid Setups for Anypoint Code Builder

Anypoint Code Builder requires one of the following project configurations to function properly:

  • A single Mule project open at the root of your directory

  • A multi-root workspace pointing directly to one or more Mule projects

If your directory structure doesn’t meet these requirements, Anypoint Code Builder displays a message with steps to resolve the issue, such as opening a Mule project or creating a workspace. See Fix a Nested Project Error.

Create a Project in a Workspace

When you create a new project, add it to a workspace. With this setup you can add more projects later without restructuring your environment.

To create a project in a workspace:

  1. Start the project creation process using one of the following methods:

    • From the Quick Actions menu, select the project type.

      For example, Design an API or Develop an Integration.

    • From the Command Palette, run the appropriate command.

      For example, MuleSoft: Design an API.

    • Ask MuleSoft Vibes to create the project using natural language.

  2. In the project creation form, select Create in workspace.

  3. Complete the remaining project configuration options.

  4. Click Create Project.

    Anypoint Code Builder creates the project and adds it to a workspace. If no workspace is open, a new workspace is created.

Import an Anypoint Studio Workspace

If you have existing projects in Anypoint Studio, you can import your Studio workspace into Anypoint Code Builder.

To import a Studio workspace:

  1. Open the Command Palette.

    Show me how
    • Use the keyboard shortcuts:

      • Mac: Cmd+Shift+p

      • Windows: Ctrl+Shift+p

    • In the desktop IDE, select View > Command Palette.

    • In the cloud IDE, click the (menu) icon, and select View > Command Palette.

  2. Select the following command:

    MuleSoft: Import Studio Workspace
  3. Navigate to the location of your Studio workspace and select it.

  4. Choose a location to save the new workspace file.

    Anypoint Code Builder creates a workspace that references your existing Studio projects. Changes made to the original Studio workspace are automatically reflected in Anypoint Code Builder.

Open and Switch Between Workspaces

You can open or switch between workspaces using the menu, the Command Palette, or MuleSoft Vibes.

Open a Workspace Manually

  1. Open the workspace file using one of these methods:

    • From the menu bar, select File > Open Workspace from File…​.

    • From the Command Palette, run the command File: Open Workspace from File…​.

  2. Navigate to the location where you saved the .code-workspace file (for example, your home directory or a dedicated workspaces folder), and select it.

    The projects open in the Explorer view, and the folder name for the workspace includes (WORKSPACE) to indicate that you’re working in a multi-root workspace:

    A multi-root workspace in Explorer view

Open a Workspace with MuleSoft Vibes

You can ask MuleSoft Vibes to switch workspaces using natural language prompts, such as:

  • "Open my American Flights workspace"

  • "Switch to the <YourWorkspaceName> workspace"

Close a Workspace

To close the current workspace:

  1. Open the Command Palette.

    Show me how
    • Use the keyboard shortcuts:

      • Mac: Cmd+Shift+p

      • Windows: Ctrl+Shift+p

    • In the desktop IDE, select View > Command Palette.

    • In the cloud IDE, click the (menu) icon, and select View > Command Palette.

  2. Select the following command:

    Workspaces: Close Workspace

Actions in Workspaces

Anypoint Code Builder organizes actions based on their scope:

Action Type Location

Global actions

Always available from the Command Palette. These actions don’t depend on a specific project, such as creating a new project, importing assets from Exchange, or opening Anypoint Code Builder settings.

Project-specific actions

Available from the context menu (right-click) in the Explorer view. These actions apply to a specific project, such as running, debugging, deploying, or exporting a project.

When working with multiple projects in a workspace, select the target project before running project-specific actions. For example, when you run or debug, you must select which project in the workspace to execute.

Workspace File Location

VS Code stores workspace configuration in a file with the .code-workspace extension. This file maps the folders for your projects.

The .code-workspace file must not reside within any of your project folders. Save it in a separate directory, such as your home directory or a dedicated workspaces folder.

Fix a Nested Project Error

This error appears when you open a folder that contains your Mule project instead of opening the project directly, and that folder isn’t configured as a multi-root workspace.

To fix this issue, open the project folder at the root level or add it to a multi-root workspace.

Open the Project at the Root

If you’re working with a single project, open it directly so it appears at the top level of the Explorer view.

  1. From the menu bar, select File > Open Folder…​.

  2. Navigate to your Mule project’s root folder (the folder containing the pom.xml file).

  3. Select the folder and click Open.

    The project now appears at the top level of the Explorer view, and Anypoint Code Builder features are available.

Add the Project to a Multi-Root Workspace

If you want to keep your current folder structure or work with multiple projects, create a multi-root workspace that points directly to your Mule project.

  1. From the menu bar, select File > Add Folder to Workspace…​.

  2. Navigate to your Mule project’s root folder and select it.

  3. When prompted, save the workspace file (.code-workspace) to a location outside of your project folders.

    The project appears in the Explorer view with the (WORKSPACE) indicator, and Anypoint Code Builder features are available.

If you frequently work with multiple projects, creating a workspace from the start avoids this issue. See Create a Project in a Workspace.