# mulesoft Anypoint Code Builder - Full Documentation --- product: Anypoint Code Builder version: master --- # Add a Condition to Your Flow Logic > For the full documentation index, see: https://docs.mulesoft.com/llms.txt In this section of the tutorial, you learn how to add a condition to your flow to send an email to the regional leader if the Salesforce case is escalated, otherwise your Mule application sends a message to Slack. ## Before You Begin Complete these procedures: 1. [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api). 2. [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc) and configure your Salesforce integration. 3. [Extract Payload Information to Variables](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-extract-payload-information). ## Define the Behavior for When the Case Is Escalated Use a Choice router to define behaviors based on specific conditions. In this case, choose to send an email if the case is escalated. 1. In Anypoint Code Builder, open your `new-case-salesforce.xml` file. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon for the Logger component: ![A flow diagram with the Add Component button icon highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-choice-router-slack-escalation-canvas.png) 3. Type `choice` and select **Choice** under **Flow Control**: 4. Add the `` and `` elements: ![Search result for 'when', with resulting highlighted text reading 'mule:when'](/mulesoft/current/en-us/anypoint-code-builder/_images/sync-api-choice-when.png) ```XML ``` For better readability of your Mule flow, update the name of the ``, ``, and `` elements: ```XML ``` 5. Define the `when` branch to execute if the variable `casestatus` equals `Escalated`: ```XML ``` ## Add an Email Connector To configure the `` element, you must first configure operations from the Anypoint Connector for Email (Email Connector): 1. In Anypoint Code Builder, open your `new-case-salesforce.xml` file, and add a new line under your `` element. 2. Type `smtp` and select **email:smtp-config**: ```XML ``` 3. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after the **Escalated** section: ![A Choice flow with the Escalated Add Component button icon highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-email-operation-slack-integration-canvas.png) 4. Type `send` and select **Send** from the **Email** section: ![A list of components in the search results section, with Send highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/send-email-slack-integration-canvas.png) 5. Configure `send` using the following code sample: ```XML ``` 6. To be able to test the application, temporarily add a `` element inside your `` element: ```XML ``` 7. Examine your full Choice router configuration: ```XML ``` ## Test Your Mule Application 1. To expedite the test, remove the breakpoint for your Logger component. 2. Select **Run** > **Start Debugging (F5)**. 3. After your application deploys successfully, log in to your Salesforce account. 4. From **App Launcher**, select **Service**: ![The Setup menu with Home and Service options highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/salesforce-select-service.png) 5. Select **Cases** > **New Case**: ![The Service navigation bar with the New Case button highlighted in the Cases section](/mulesoft/current/en-us/anypoint-code-builder/_images/salesfroce-create-new-case.png) 6. Ensure that the **Status** of the new case is **Escalated**. 7. After a few seconds, ensure that your configured email account received an email with the information configured in the case: ```none Please handle this case. Case Number: 00001030, Origin: Phone, Case Type: , Priority: Medium, Status: Escalated ``` 8. Proceed to [Configure Slack Integration](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-configure-integration) to learn how to configure the Slack message for any case that was not escalated. [Extract Payload Information to Variables](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-extract-payload-information) [Configure Slack Integration](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-configure-integration) --- product: Anypoint Code Builder version: master --- # Adding a Component to Your Project > For the full documentation index, see: https://docs.mulesoft.com/llms.txt These examples illustrate basic configurations for adding components to your project from the canvas, and the code editor. The examples assume you are beginning with an empty integration project. 1. In the Explorer, open the configuration XML file for your project:, such as `my-project-name.xml`. ![Canvas showing visual representation of Mule flow and the Mule configuration file](/mulesoft/current/en-us/anypoint-code-builder/_images/int-empty-canvas.png)
1The canvas provides space for a visual representation of your Mule flows or subflows.
2The code editor displays the configuration file for your Mule application.
2. Select **Build a Flow** from the canvas to create an empty flow within a Mule integration application. 3. Change the default name of the flow from the canvas or from the code editor. - From the canvas - From the code editor Click **Flow name1** to open the configuration panel for the Flow component, change the flow name, and click the check mark to set the new name. ![Change name of flow through canvas.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-flow-name-ui.png) Replace the default name of the flow (`name1`) with your flow name, such as `getFlights`, for example: ```xml ``` 4. Add a component to your project from the canvas. For example, add the HTTP Listener component: 1. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, search for and select **Listener** from the **HTTP** results: ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png) The configuration XML file now includes the XML for the HTTP Listener within the `` element, for example: ```XML ``` 5. Add another component, this time using the code editor. In the code editor, place your cursor before the opening `` tag. Ensure that the cursor is not inside the `` element. Add the following code: ```xml ``` 1. Notice that the Listener component in the canvas now displays an error: ![Listener error in the canvas](/mulesoft/current/en-us/anypoint-code-builder/_images/int-canvas-error.png) 2. To determine where the error is, select the processor in the canvas. Anypoint Code Builder highlights its location in the code editor, and you can mouse over the issue for more information, for example: ![Selecting configuration reference from configuration panel](/mulesoft/current/en-us/anypoint-code-builder/_images/int-select-listener-config.png) 3. To fix the error, change the value of the `name` attribute in `http:listener-config` to match the name of the `config-ref` value in your `http:listener` configuration: ```xml ``` The HTTP listener within your flow now references the HTTP listener configuration, a global connection configuration that resides outside of the flow. For more information about debugging, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). 6. Add another component to your flow. For example, add a Set Payload component to your HTTP Listener operation: 1. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, search for and select **Set payload** from the **Transformer** results. 3. In the canvas, click **Set payload** to open its configuration panel, and add a string value, DataWeave expression, Mule variable, or configuration property. - To add a string, type a value such as `my value`. For example: ![Adding string to Set Payload](/mulesoft/current/en-us/anypoint-code-builder/_images/int-set-payload-config-string.png) - To add a DataWeave expression or a Mule variable as a value, such as `payload`, click **fx** (located before the field), and provide the value, for example: ![Adding expression to Set Payload](/mulesoft/current/en-us/anypoint-code-builder/_images/int-set-payload-config-fx.png) For more information about configuring DataWeave expressions, see [Using DataWeave Expressions and Transformations in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions). - To add a configuration property as a value, type a value such as `${secure::mysensitiveprop}`. For more information about configuration properties, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). Your configuration XML file now looks similar to the following: ```xml ``` 7. Add another component to your flow. For example, add the **Create** operation from Anypoint Connector for Salesforce to insert an Account record. Use this pattern when your flow receives data through an HTTP Listener and must create Salesforce records. If you completed the earlier steps that add **Set payload** with a fixed string, remove or replace that processor so you can shape the payload before **Create**. For more information about using **Create** with Account records, see [Salesforce Connector 12.0 Examples](https://docs.mulesoft.com/salesforce-connector/latest/salesforce-connector-examples). 1. In the configuration XML, add a global Salesforce connection element above your `` element (not inside the flow). Use configuration properties for credentials instead of literals; for example: ```xml ``` For more information about connection types and authentication fields, see [Salesforce Connector 12.0](https://docs.mulesoft.com/salesforce-connector/latest/). 2. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after **HTTP Listener**. 3. In the **Add Component** panel, search for **Set payload**, and add the component. 4. Configure **Set payload** with a DataWeave expression that builds a JSON object whose fields match your HTTP API (they need not match Salesforce field names yet). For example, use **fx** to enter DataWeave with `output application/json` and sample fields such as `companyName`, `industry`, and `phoneNumber`. Alternatively, add **Transform Message** and use the same DataWeave in ``. For more information about **Transform Message**, see [Transform ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform). 5. From the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after **Set payload** (or **Transform Message**). 6. In the **Add Component** panel, click **Connectors**, select **Salesforce**, and select **Create**. 7. In the configuration panel for **Create**, set: - **Connection config**: The global Salesforce configuration name (for example, `Salesforce_Config`). - **Type**: `Account`. If **Type** stays empty until you establish a working Salesforce connection, set `type="Account"` on `` in the code editor. - **Records**: A DataWeave expression that resolves to the records to create. If the incoming payload uses different property names than Salesforce expects, map those properties in **Records**, as shown in the configuration XML example that follows. If the payload is already an array of Java objects with Salesforce field names (`output application/java`), you can use `#[payload]`. For more information about connector fields for this operation, see [Salesforce Connector 12.0](https://docs.mulesoft.com/salesforce-connector/latest/). > [!NOTE] Picklist fields such as **Industry** must use values that exist in your Salesforce > organization. This configuration listens on `/accounts`, builds a JSON payload, maps it to Account fields inside ``, and calls **Create**. Align `config-ref` on `` with the `name` of your `` (for example, `config-ref` from the earlier steps in this topic). ```xml #[%dw 2.0 output application/java --- [{ Name: payload.companyName, Industry: payload.industry, Phone: payload.phoneNumber }]] ``` If the message payload is already an array of Java objects with Salesforce field names, you can omit `` and set **Records** to `#[payload]`, or use a self-closing `` element with that default. You can achieve the same result by adding **Transform Message** with `output application/java` followed by `` with **Records** set to `#[payload]`. --- product: Anypoint Code Builder version: master --- # Adding Folders to Your Home Directory > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When you create a project, Anypoint Code Builder stores it in your home directory by default. You can create other folders for your projects. Don’t create the project within another project directory. ## Create a Project Folder To create a local folder for your projects: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Select the following command: ```command File: Open Folder... ``` ![Opening a folder from the Command Palette](/mulesoft/current/en-us/anypoint-code-builder/_images/file-open-folder-command.png) 3. Use your local directory to create a new folder. ## Create a Project Folder from the Terminal Use the terminal to create folders. 1. Ensure that no projects are open. 2. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 3. Provide this command to create a folder: ```none mkdir ``` Replace `` with a name of your choice for the directory. ## See Also - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project) --- product: Anypoint Code Builder version: master --- # Allow URLs and Antivirus Exclusions for Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure your firewall, antivirus, and proxy settings to allow Anypoint Code Builder URLs, and exclude the files, folders, and executables that Anypoint Code Builder uses from antivirus scanning. Allowing these URLs ensures Anypoint Code Builder can connect to Anypoint Platform services, download dependencies, and access Maven repositories. Antivirus exclusions prevent real-time scanning from slowing down disk operations. Together, this configuration prevents connection issues and improves performance. ## Allow Anypoint Code Builder URLs and Paths Allow URLs and exclude paths to ensure the best performance in Anypoint Code Builder. ### Security and Antivirus Software If you have security and antivirus software, add Anypoint Code Builder to the allowlist. Running real-time antivirus protection software on your operating system can have a negative impact on Anypoint Code Builder performance, particularly during canvas loading and extension initialization. Continuous disk I/O from real-time scanning causes delays when Mule applications perform intense disk operations. Exclusions reduce file locking, false positives, and I/O latency during builds. Steps to solving these performance issues vary depending on your antivirus software. Your organization’s security policy decides whether exclusions are allowed and how they’re deployed. Use these lists with your security team. #### Antivirus Exclusion Paths Exclude the following directories and executables from real-time antivirus scanning. The paths vary by operating system. - Windows - macOS As a first step, add the following high-I/O directories to your antivirus exclusion list: - Anypoint Code Builder data: `%USERPROFILE%\AnypointCodeBuilder` - Local Maven repository: `%USERPROFILE%\.m2` - Anypoint extensions: `%USERPROFILE%\.vscode\extensions\salesforce.*` If performance issues persist, also exclude the following directories: - VS Code user data: `%APPDATA%\Code` - VS Code extensions and settings: `%USERPROFILE%\.vscode` - Temporary files used by Anypoint Code Builder and build tools: `%USERPROFILE%\AppData\Local\Temp` - `%APPDATA%\Local\Temp` - The directory where you store your Mule projects (your projects directory). Exclude the entire tree, not single files. And the following executables: - `java.exe` or `javaw.exe`: Java runtime used by Mule and tooling - `node.exe`: Node.js used by VS Code extensions and scripts - `Code.exe`: Visual Studio Code Add the following directories to your antivirus exclusion list: - Anypoint Code Builder data: `~/AnypointCodeBuilder` - Local Maven repository: `~/.m2` or `~/.m2/repository` - VS Code user data: `~/Library/Application Support/Code` - VS Code extensions and settings: `~/.vscode` - Temporary files used by Anypoint Code Builder and build tools: `$TMPDIR` (or `/tmp` when that is your temp location) - The directory where you store your Mule projects (your projects directory). Exclude the entire tree, not single files. And these executables: - `java`: Java runtime used by Mule and tooling. Use the resolved path from your JDK installation. - `node`: Node.js used by VS Code extensions and scripts - The Visual Studio Code application bundle, for example, `Visual Studio Code.app` ### Anypoint Code Builder Directories All Anypoint Code Builder users need read and write permissions for the directory where Anypoint Code Builder is installed. If you use a Windows antivirus application, ensure that the `plugins/` and `features/` directories are under the trusted category. #### Allowlist Recommendation Allowlist the Anypoint Code Builder workspace folder in your client OS security settings. In Windows, allowlist the Windows default temp folder where Anypoint Code Builder stores temporary files. ### MuleSoft and Third-Party URLs Allow these URLs so that they aren’t blocked or interrupted by your organization’s firewall or proxy. > [!NOTE] Some entries use a wildcard (\*) to indicate that all subdomains must be allowed. The > parent domain itself (for example, anypoint.code-builder.platform.salesforce.com) may not resolve > directly, as it serves as a base for specific service endpoints. This is expected behavior. #### MuleSoft - MuleSoft Maven repositories and connectors update site - https://repository.mulesoft.org - https://\*.repository.mulesoft.org - Anypoint Code Builder update sites - https://anypoint.code-builder.platform.salesforce.com - https://\*.anypoint.code-builder.platform.salesforce.com - Anypoint Platform services: CloudHub, Exchange, Core Services \[Commcloud / Hyperforce\] - https://anypoint.mulesoft.com - https://\*.anypoint.mulesoft.com - https://platform.mulesoft.com - https://\*.platform.mulesoft.com - Nexus - https://nexus.build.msap.io - https://\*.nexus.build.msap.io - All assets downloaded from Exchange - https://exchange2-asset-manager-kprod.s3.amazonaws.com - https://\*.exchange2-asset-manager-kprod.s3.amazonaws.com - https://exchange2-asset-manager-kprod-eu.s3.eu-central-1.amazonaws.com - https://\*.exchange2-asset-manager-kprod-eu.s3.eu-central-1.amazonaws.com - Resources for API Portals - https://exchange2-file-upload-service-kprod.s3.amazonaws.com - https://\*.exchange2-file-upload-service-kprod.s3.amazonaws.com #### Third-Party - Maven - https://repo.maven.apache.org/maven2 - https://\*.repo.maven.apache.org/maven2 - https://repo1.maven.org/maven2 - https://\*.repo1.maven.org/maven2 - LaunchDarkly - https://clientstream.launchdarkly.com - https://\*.clientstream.launchdarkly.com - https://clientsdk.launchdarkly.com - https://\*.clientsdk.launchdarkly.com - https://app.launchdarkly.com - https://\*.app.launchdarkly.com - https://events.launchdarkly.com - https://\*.events.launchdarkly.com - https://otel.observability.app.launchdarkly.com - https://\*.otel.observability.app.launchdarkly.com - https://pub.observability.app.launchdarkly.com - https://\*.pub.observability.app.launchdarkly.com --- product: Anypoint Code Builder version: master --- # Anypoint Code Builder Components and Commands Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt In Anypoint Code Builder, use components to build your integrations and implementations: - [Built-In Connectors](#builtin-connectors) - [Core Processors](#core-processors) Use MuleSoft commands from the Command Palette: - [Command Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-commands) Configure MuleSoft (**Mule**) settings, such as the EU or US cloud, and default Mule runtime and Java versions: - [MuleSoft Settings](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings) Configure Anypoint Code Builder proxy settings in Visual Studio Code (VS Code) to work with your network settings: - [Using a Proxy in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/ref-proxy-settings) Meet hardware, storage performance, and antivirus exclusion guidance for Anypoint Code Builder: - [Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements) Understand how Maven settings files are identified and updated: - [Maven Settings Files](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-maven) ## Built-In Connectors In Anypoint Code Builder, both integrations and implementations are Mule applications. Anypoint connectors and modules are extensions to Mule runtime engine that process event data within a Mule application. Connectors, unlike modules, also provide ways to connect to external systems or services. Built-in Anypoint connectors are available from the canvas and code editor for integration and implementation projects. These connectors include: - [Anypoint Connector for Agent2Agent (A2A) (Beta) ()](https://docs.mulesoft.com/a2a-connector/latest/) (A2A Connector) - [Anypoint Connector for Agentforce ()](https://docs.mulesoft.com/agentforce-connector/latest/) (Agentforce Connector) - [Anypoint Connector for Database ()](https://docs.mulesoft.com/db-connector/latest/) (Database Connector) - [Anypoint Connector for Einstein AI ()](https://docs.mulesoft.com/einstein-ai-connector/latest/) (Einstein AI Connector) - [Anypoint Connector for Email ()](https://docs.mulesoft.com/email-connector/latest/) (Email Connector) - [Anypoint Connector for File ()](https://docs.mulesoft.com/file-connector/latest/) (File Connector) - [Anypoint Connector for HTTP ()](https://docs.mulesoft.com/http-connector/latest/) (HTTP Connector) - [Java Module ()](https://docs.mulesoft.com/java-module/latest/) - [Anypoint Connector for MCP (MCP Connector) ()](https://docs.mulesoft.com/mcp-connector/latest/) - [Anypoint Connector for Salesforce ()](https://docs.mulesoft.com/salesforce-connector/latest/) (Salesforce Connector) - [Anypoint Connector for Salesforce Data Cloud ()](https://docs.mulesoft.com/salesforce-data-cloud-connector/latest/) (Salesforce Data Cloud Connector) - [Anypoint Connector for Sockets ()](https://docs.mulesoft.com/sockets-connector/latest/) (Sockets Connector) - [Anypoint Connector for Workday ()](https://docs.mulesoft.com/workday-connector/latest/) (Workday Connector) Connector XML tags start with a namespace followed by an operation, following the syntax `namespace:operation`, such as `` for a Select operation in Anypoint Connector for Database (Database Connector). For more information, see [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb). Many other connectors are available from Anypoint Code Builder through Anypoint Exchange: - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) To find information about more connectors, see [Anypoint Connectors Overview](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors), and find documentation on all [Anypoint connectors and modules](https://docs.mulesoft.com/connectors/). ## Core Processors Configure message and event processing in an integration application or API implementation. Core processors (also called Mule components) run on the Mule runtime engine. - [Async ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-async) - [Batch Job ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-batch) - [Cache Scope ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-cache) - [Choice ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-choice) - [Custom Event ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-custom-event) - [Dynamic Evaluate ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-dynamic-evaluate) - [Error Handler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-error-handler) Includes On-Error Continue (``) and On-Error Propagate (``) - [First Successful ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-first-successful) - [Flow ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow) - [Flow Reference ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow-ref) - [For Each ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-for-each) - [Idempotent Message Validator ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-idempotent-message-validator) - [Invalidate Cache ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-cache) - [Invalidate Key ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-key) - [Logger Component ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-logger) - [Parallel For Each ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-parallel-for-each) - [Parse Template ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-parse-template) - [Raise Error ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-raise-error) - [Remove Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-remove-variable) - [Round Robin ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-round-robin) - [Scatter-Gather ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scatter-gather) - [Scheduler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scheduler) - [Set Payload ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-payload) - [Set Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-variable) - [Subflow ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-subflow) - [Transaction ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transaction) - [Transform ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform) - [Try Scope ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-try) - [Until Successful ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-until-successful) ## See Also - [Tutorials](https://docs.mulesoft.com/anypoint-code-builder/tutorials) --- product: Anypoint Code Builder version: master --- # Anypoint Code Builder Overview > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder for your API designs, implementations, and integration development. Work locally with Anypoint Code Builder on Microsoft Visual Studio Code (VS Code). Anypoint Code Builder supports the development lifecycle: - API specification design, a mocking service for testing, source control, and publication to Anypoint Exchange - API implementation features for importing supported API specifications (such as OAS, RAML, AsyncAPI, or GraphQL) and autogenerating interfaces (scaffolding) for flows and error handlers within a Mule application - Integration development to connect systems, transform data to required formats, and provide business logic to manage messages and events programmatically within a Mule application You can share project snapshots with members of your team by using import and export features or by using a [source control management (SCM) system](#scm) of your choice. For an introduction to Anypoint Code Builder, see our Trailhead badge, [Anypoint Code Builder: Quick Look](https://trailhead.salesforce.com/content/learn/modules/mulesoft-anypoint-code-builder-quick-look) (login required). Sign up if you don’t have a Trailhead account. ## Anypoint Extension Pack Get the Anypoint Code Builder experience through the Anypoint Extension Pack for Visual Studio Code. The extensions require installation to VS Code. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). ## Cloud Hosts Anypoint Code Builder is available through Anypoint Platform from US, EU, Canada, Japan, India, Australia, and United Kingdom cloud hosts. To help your organization meet emerging regulatory requirements that differ by region, Anypoint Platform does not share organization information, permissions, account data, or projects between hosts.
Control PlanePlatform URLDescription

US Cloud

anypoint.mulesoft.com

Non-EU region host. MuleSoft hosts this control plane within data centers in the United States.

EU Cloud

eu1.anypoint.mulesoft.com

EU-compliant host. MuleSoft hosts this control plane within EU (Frankfurt) data centers.

Canada Cloud

ca1.platform.mulesoft.com

MuleSoft hosts this control plane within Canada (North America) data centers.

Japan Cloud

jp1.platform.mulesoft.com

MuleSoft hosts this control plane within Japan (APAC) data centers.

India Cloud

in1.platform.mulesoft.com

MuleSoft hosts this control plane within India (APAC) data centers.

Australia Cloud

au1.platform.mulesoft.com

MuleSoft hosts this control plane within Australia (APAC) data centers.

United Kingdom Cloud

gb1.platform.mulesoft.com

MuleSoft hosts this control plane within United Kingdom (Europe) data centers.

Anypoint Platform hosts deployment targets for managed Mule runtime versions and related data, including data and metadata about your Mule implementations. You can also connect Anypoint Code Builder to a Private Cloud Edition (PCE) control plane that your organization hosts. PCE 4.3.0 and later includes Anypoint Code Builder. Set **Mule: Control Plane** to **Private Cloud Edition**, and set **Mule: Control Plane PCE URL** to your PCE control plane URL, such as `[https://pce.example.com](https://pce.example.com)`. Anypoint Code Builder imports custom SSL certificates for that host automatically. To sign in, run **MuleSoft: Login to Anypoint Platform** from the Command Palette. The command opens the PCE sign-in page. Starting with Anypoint Code Builder 1.28.0, bundled Mule runtime versions are available when you connect to Private Cloud Edition. To use a Mule runtime version that Anypoint Code Builder does not include, such as a version for Private Cloud Edition or GIA2H, see [Add a Mule Runtime Version Locally](https://docs.mulesoft.com/anypoint-code-builder/start-acb#add-local-mule-runtime). To change the host from the default (US), or to connect to a Anypoint Platform Private Cloud Edition control plane, see [Set Anypoint Code Builder to a Different Control Plane](https://docs.mulesoft.com/anypoint-code-builder/start-acb#change-clouds). Use of Anypoint Code Builder requires an Anypoint Platform user account. Use of some features requires permissions set by an organization administrator (see [Configuring Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions)). If you do not have an Anypoint Platform account through your organization, you can sign up in the US or EU cloud host for Anypoint Platform. See [Anypoint Platform Hosting Overview](https://docs.mulesoft.com/hosting-home/) for more information. ## Get Familiar with the Basics Some knowledge about designing an API using API specification languages (such as OAS, RAML, AsyncAPI, or gRPC) can be helpful. API implementations and integration development require familiarity with Mule application development, connectors, and the DataWeave transformation language. Anypoint Code Builder [Tutorials](https://docs.mulesoft.com/anypoint-code-builder/tutorials) help you get started with these tasks. It’s also useful to be familiar with these products and features: - Anypoint Connectors provide operations for retrieving, modifying, and sending data to and from systems. Anypoint Code Builder provides [built-in connectors](https://docs.mulesoft.com/anypoint-code-builder/acb-reference#builtin-connectors) and access to many other connectors from Anypoint Exchange. - Core processors (also called Core components or Mule components) are programmatic building blocks that provide the business logic for integration and implementation applications. Examples include For Each (``), Transform Message (``), and Flow (``). See [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference). - DataWeave is the programming language for all expressions and data transformations in your integrations and implementations. The language offers function libraries and mechanisms for creating customizations, including your own functions, libraries, and data types. To learn the basics of DataWeave and experiment with DataWeave scripts, see [DataWeave Tutorial and Playground](https://dataweave.mulesoft.com/). - Scaffolding is an automatic process that uses APIkit to take an API specification as input and autogenerate an XML-based router and endpoints that you implement within a Mule application. - A flow is a block of components, including any connector operations, that Mule runtime engine (Mule) executes sequentially on an event and the message it contains. A flow can also contain an operation that triggers the creation of the event and initiates the execution of the flow. A subflow is similar to a flow but does not support the configuration of triggers (sometimes called message sources), which are exclusive to flows. A flow reference enables you to trigger execution of a flow or subflow from another flow. - A Mule application contains one or more XML-based configuration files for your connectors, components, secure configuration properties, scaffolded API specifications, and other parts of your integrations and implementations. The application runs on Mule and is part of a project that contains the resources needed to configure, build, run, test, and deploy the application. - Business groups organize APIs, Mule applications, and other resources within an Anypoint Platform organization. Organization administrators create and control access to business groups. For details about business groups, organizations, and related management features, see [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups). ## Anypoint Platform Product Integrations Anypoint Code Builder integrates with key Anypoint Platform products and features: - Anypoint Exchange for publishing the API specifications that you create and importing API specifications and development resources (such as connectors, integration project templates and examples) into your projects - CloudHub and CloudHub 2.0 for deploying the implementations and integrations that you build - MuleSoft VCS for importing API specification projects into Anypoint Code Builder and optionally, synchronizing imported projects by using the Anypoint source control management (SCM) system The use of features provided by Anypoint Platform products requires a connection. You establish this connection by logging in to your Anypoint Platform account from Anypoint Code Builder. For more information, see [Sign in to Anypoint Platform from Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#login-ide). ## Source and Version Control Use any supported source control management (SCM) system. VS Code supports Git out-of-the-box in addition to several extensions for popular version control and SCM systems. For guidance with Git setup in Anypoint Code Builder, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). See VS Code documentation on [Git support](https://code.visualstudio.com/docs/sourcecontrol/overview) and [extensions for other SCM providers](https://code.visualstudio.com/docs/sourcecontrol/overview#_scm-providers). For extension authors only, VS Code also provides a [VS Code source control API](https://code.visualstudio.com/api/extension-guides/scm-provider). ## Anypoint Code Builder Startup Anypoint Code Builder optimizes Maven bookkeeping and bundle-loading operations during initialization. This behavior reduces startup overhead so workspaces can become available with less wait time. It also reads extension bundle directories directly from the extension path when loading workspace assets. This initialization path reduces delays before projects are ready for development tasks. ## Feedback To provide feedback about Anypoint Code Builder, complete the [feedback survey](https://www.surveymonkey.com/r/acb_feedback). For questions or general discussion about Anypoint Code Builder, see [Trailblazer Discussion Topic](https://trailhead.salesforce.com/trailblazer-community/topics/mulesoftanypointcodebuilder?sort=LAST_MODIFIED_DATE_DESC). ## See Also - [Access Management Overview](https://docs.mulesoft.com/access-management/) - [Anypoint Exchange Overview](https://docs.mulesoft.com/exchange/) - [Connectors](https://docs.mulesoft.com/connectors/) - [DataWeave Overview](https://docs.mulesoft.com/dataweave/latest/) - [Mule Runtime Engine Overview](https://docs.mulesoft.com/mule-runtime/latest/) --- product: Anypoint Code Builder version: master --- # Anypoint Code Builder Release Notes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in [Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop). Use the Anypoint Code Builder integrated development environment (IDE) for your API designs, implementations, and integration development. Work locally with Anypoint Code Builder for Desktop on Microsoft Visual Studio Code (VS Code) or from your browser with Anypoint Code Builder on Anypoint Platform. The IDEs support the development lifecycle: - API specification design (AsyncAPI, gRPC, OAS, and RAML), a mocking service for testing, source control, and publication to Anypoint Exchange - API implementation features for importing supported API specifications (AsyncAPI, GraphQL, gRPC, OAS, and RAML) and autogenerating interfaces (scaffolding) for flows and error handlers within a Mule application - Integration development to connect systems, transform data to required formats, and provide business logic to manage messages and events programmatically within a Mule application ## October 23, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.28.1 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

Global Elements now shows required external libraries as expected when those libraries are defined on the connector configuration, such as Spring Config.

W-24612980

Anypoint Code Builder updates its OpenJDKs.

W-24630068

## October 21, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.28.0 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Support for Mule Runtime 4.13.0](#support-for-mule-runtime-4-13-october-21-2026) - [Support for Mule Maven Plugin 4.10.3](#support-for-mule-maven-plugin-4-10-3-october-21-2026) - [Support for Scaffolding OAS 3.1 API Specifications](#oas-3-1-scaffolding-october-21-2026) - [Support for Anypoint Platform Private Cloud Edition](#pce-support-october-21-2026) - [Support for Locally Added Mule Runtime Versions](#local-mule-runtime-october-21-2026) - [Support for Hyperforce in the UK Region](#support-for-uk-region-october-21-2026) - [Agent Network Improvements](#agent-network-improvements-october-21-2026) ### Support for Mule Runtime 4.13.0 Anypoint Code Builder now supports Mule runtime version 4.13.0 for developing, running, and deploying Mule applications. Create new projects with Mule runtime 4.13.0 or update existing projects to use this runtime version in project properties. For more information, see [Bundled Mule Runtime Versions](https://docs.mulesoft.com/anypoint-code-builder/int-versions#bundled-runtimes). ### Support for Mule Maven Plugin 4.10.3 Anypoint Code Builder now supports Mule Maven Plugin version 4.10.3 for developing, running, and deploying Mule applications. Create new projects with Mule Maven Plugin 4.10.3 or update existing projects to use this plugin version in the project POM. For more information, see [mule-maven-plugin/mule-maven-plugin-release-notes.adoc](#mule-maven-plugin/mule-maven-plugin-release-notes.adoc). ### Support for Scaffolding OAS 3.1 API Specifications Anypoint Code Builder now scaffolds Mule projects from OpenAPI Specification (OAS) 3.1 API specifications, in addition to the formats already supported. You can scaffold from JSON or YAML specifications and get structured diagnostics when a specification can’t be scaffolded. For more information, see [Implementing OAS, RAML, AsyncAPI, and GraphQL APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs). ### Support for Anypoint Platform Private Cloud Edition Anypoint Code Builder now connects to Anypoint Platform Private Cloud Edition (PCE) instances hosted in your own data center, so you can design, develop, and deploy Mule applications against a private control plane. For more information, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). ### Support for Locally Added Mule Runtime Versions Anypoint Code Builder now lists a Mule runtime version that you copy into `${user.home}/AnypointCodeBuilder/runtimes/user-installed`. The version appears when you create a project and in **Project Properties**, so you can use a runtime version that Anypoint Code Builder does not include, such as a version for Private Cloud Edition. For more information, see [Add a Mule Runtime Version Locally](https://docs.mulesoft.com/anypoint-code-builder/start-acb#add-local-mule-runtime). ### Support for Hyperforce in the UK Region Anypoint Code Builder now supports the [United Kingdom Cloud](https://gb1.platform.mulesoft.com) control plane of Anypoint Platform. For more information about Anypoint Platform availability on control planes, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). ### Agent Network Improvements This release includes improvements for authoring and deploying agent networks for Agent Fabric. For more information, see the [Agent Fabric Release Notes](https://docs.mulesoft.com/release-notes/agent-fabric/agent-fabric-release-notes). ### Fixed Issues
Issue ResolutionID

MUnit tests now resolve BOM-managed dependency versions correctly when run from the Anypoint Code Builder UI.

W-23448108

The Transformation Builder now preserves namespaces when mapping input for services that expect XML.

W-23768550

The Transformation Builder now handles several mapping edge cases correctly.

W-23768451

Anypoint Code Builder no longer retries Mule framework instance creation repeatedly when a security key is invalid.

W-23864352

The debugger now visually indicates a pause after the Publish operation when using VM Pub/Sub.

W-23959396

FIPS configuration now references the generated java.fips.security file in the design service JVM launch command.

W-24176669

FIPS setup now applies the trust store password alongside a custom javax.net.ssl.trustStore path, so MAC verification succeeds on the generated BCFKS cacerts.

W-24176694

Anypoint Code Builder now keeps the Mule module metadata version and javaSpecificationVersions consistent automatically.

W-24192883

AccessDeniedException errors no longer recur in the logs on Windows.

W-24207276

Secure properties connections now resolve reliably instead of intermittently reporting an unknown connection type.

W-24220432

Anypoint Code Builder no longer deletes the shared JDK that the platform JVM is running on.

W-24236209

Canvas component icons now render correctly instead of showing as Unknown when connector types resolve after the first render.

W-24280838

Code search results now open directly in Code View.

W-24278214

The Error Type list is now contextual and no longer shows every error type.

W-24335809

Anypoint Code Builder desktop workspace settings no longer allow arbitrary JVM arguments that could lead to command execution.

W-24408390

Export Project now uses the current project’s name and saves the JAR to the selected folder.

W-24455874

## September 22, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.27.0 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Managing Global Elements](#managing-global-elements-september-22-2026) - [Upgrading All Connectors with One Click](#upgrade-all-connectors-september-22-2026) - [Viewing Project Dependencies](#viewing-project-dependencies-september-22-2026) - [Navigating to Flows That Reference a Subflow](#navigate-to-referencing-flows-september-22-2026) ### Managing Global Elements You can now add, edit, and delete global configurations directly from **Global Elements**, without editing XML. Click **New Configuration** to create connector configurations, TLS contexts, object stores, caching strategies, API Autodiscovery, global error handlers, import project references, and properties files, and encrypt secure property values from the same view. For more information, see [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements). ### Upgrading All Connectors with One Click You can now upgrade every connector in a project to its latest version with a single action in **Project Properties**, so you no longer need to update connectors one at a time. For more information, see [Upgrade All Connectors in a Project](https://docs.mulesoft.com/anypoint-code-builder/int-versions#upgrade-all-connectors). ### Viewing Project Dependencies Anypoint Code Builder now provides a visual way to view the dependencies added to a project, so you no longer need to inspect the project’s POM file to see what a project depends on. For more information, see [Viewing Project Dependencies](https://docs.mulesoft.com/anypoint-code-builder/start-view-project-dependencies). ### Navigating to Flows That Reference a Subflow From the canvas context menu, you can now select a subflow and navigate to every flow that references it, making it easier to trace execution paths and assess the impact of changes across a project. For more information, see [Find Flows That Reference a Subflow](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#find-referencing-flows). ### Fixed Issues
Issue ResolutionID

The Add Component (+) button now appears on hover in the descriptive UI as expected.

W-23437230

Bundled connectors now load reliably on startup and are no longer skipped due to a stale interrupt flag.

W-24014499

The design service now works as expected for projects using JDK 17 with Mule runtime 4.6.x.

W-24079635

The canvas now renders components correctly when the dynamic tooling cache file is truncated, instead of showing every component as Unknown.

W-24154114

FIPS trust store setup now succeeds with BCFKS source keystores when a custom Cacerts path is configured.

W-24152130

Loading the bundled connector cache no longer causes out-of-memory errors on low-resource machines.

W-24117873

## September 4, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.26.2 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Support for Mule Runtime 4.12](#support-for-mule-runtime-4-12-september-4-2026) - [Upgrade Mule Applications with the upgrade-mule-app Skill](#upgrade-mule-app-skill-september-4-2026) ### Support for Mule Runtime 4.12 Anypoint Code Builder now supports Mule runtime version 4.12 for developing, running, and deploying Mule applications. Create new projects with Mule runtime 4.12.0 or update existing projects to use this runtime version in project properties. For more information, see [Bundled Mule Runtime Versions](https://docs.mulesoft.com/anypoint-code-builder/int-versions#bundled-runtimes). ### Upgrade Mule Applications with the upgrade-mule-app Skill MuleSoft Vibes now includes the `upgrade-mule-app` skill, which upgrades a Mule application to a later Mule runtime version and Java version. For more information, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). ### Fixed Issues
Issue ResolutionID

Error handlers scaffolded from an API specification now map the Error Type correctly.

W-19987815

Running a Mule application on Windows no longer requires administrator permission.

W-23172858

The canvas now loads as expected when the project.json file is corrupted.

W-23846800

MCP server network requests now succeed when a proxy is configured.

W-23853401

The debugger’s Step Over action now pauses at the next step when Save & Hot Deploy is used.

W-23959338

## August 24, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.25.0 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Managing API Spec Versions](#managing-api-spec-versions-august-24-2026) - [Navigating to Flows in Reusable Libraries](#navigate-to-flows-in-reusable-libraries-august-24-2026) - [Triggering On-Demand Scheduler from the Canvas](#trigger-on-demand-scheduler-from-canvas-august-24-2026) - [Agent Network Improvements](#agent-network-improvements-august-24-2026) ### Managing API Spec Versions Anypoint Code Builder now lets you view API specification details and change API dependency versions from **Project Properties**. When you update a version, the IDE re-scaffolds your project and notifies you about the result, including errors and incompatibilities. You can also manage API versions with MuleSoft Vibes. For more information, see [Managing API Spec Versions](https://docs.mulesoft.com/anypoint-code-builder/imp-manage-api-spec-versions). ### Navigating to Flows in Reusable Libraries Anypoint Code Builder now supports **Go to Flow** for flows imported from Mule project dependencies (reusable libraries). You can open those flows in a read-only canvas and view their read-only XML to inspect them at design time, and step into them while debugging a Flow Reference. For more information, see [Navigate to the Referenced Flow](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow-ref#navigate-to-the-referenced-flow). ### Triggering On-Demand Scheduler from the Canvas During an active run or debug session, you can now trigger a scheduler flow on demand from a **Play** button on the scheduler source node, without waiting for the next scheduled run. The flow runs exactly as it would on a scheduled trigger, respecting your breakpoints and interceptors. For more information, see [Trigger a Scheduler On Demand](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows#trigger-scheduler-on-demand). ### Agent Network Improvements This release includes improvements for authoring and deploying agent networks for Agent Fabric. For more information, see the [Agent Fabric Release Notes](https://docs.mulesoft.com/release-notes/agent-fabric/agent-fabric-release-notes). ### Fixed Issues
Issue ResolutionID

Canceling the login process no longer displays an unexpected error.

W-20636555

The Problems tab no longer shows incorrect validation warnings for global configuration.

W-21322966

Opening a project no longer overwrites the maven-compiler-plugin source level to 1.8 when the project declares a different Java specification version.

W-23357940

The Re-scaffold this local API command is now available when you set up a multi-root workspace manually as expected.

W-23493499

The FIPS custom cacerts path setting now applies during FIPS conversion as expected.

W-23517641

Implement This Local API no longer fails intermittently on Windows with a Connection is closed error.

W-23546215

The IDE no longer rewrites pom.xml with identical content during DataSense tooling-cache sync.

W-23604327

## August 6, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.24.1 To use this extension pack, see [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements, see [Anypoint Code Builder Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Support for Hyperforce in the Australia Region](#support-for-hyperforce-australia-august-6-2026) - [Agent Network Improvements](#agent-network-improvements-august-6-2026) - [Cloud IDE (Beta) Retirement](#cloud-ide-retirement-august-6-2026) ### Support for Hyperforce in the Australia Region Anypoint Code Builder now supports the [Australia Cloud](https://au1.platform.mulesoft.com) control plane of Anypoint Platform. For more information about Anypoint Platform availability on control planes, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). ### Agent Network Improvements This release includes improvements for authoring and deploying agent networks for Agent Fabric. For more information, see the [Agent Fabric Release Notes](https://docs.mulesoft.com/release-notes/agent-fabric/agent-fabric-release-notes). ### Cloud IDE (Beta) Retirement Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in [Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop). ## July 21, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.24.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the Visual Studio Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [FIPS-Compliant Security Support](#fips-support-in-dependencies-july-21-2026) - [Support for Scaffolding OAS 3.0 APIs That Reference Exchange Fragments](#oas-fragment-scaffolding-july-21-2026) ### FIPS-Compliant Security Support Anypoint Code Builder now provides FIPS 140-2 and FIPS 140-3 compliant support through updated dependencies and UI support in the desktop IDE. This helps teams configure and run secure development workflows more consistently in regulated environments. For more information, see [Configuring FIPS Compliance in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-fips-compliance). ### Support for Scaffolding OAS 3.0 APIs That Reference Exchange Fragments Anypoint Code Builder now scaffolds OAS 3.0 API specifications that use `$ref` to reference Anypoint Exchange fragments. For more information, see [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments). ### Fixed Issues
Issue ResolutionID

Runtime default arguments now parse correctly when you configure application run settings.

W-23122012

The Transformation Builder component now appears with a consistent display name across the UI as expected.

W-22775707

The Add Component button now behaves consistently when you add components to your flow.

W-22293870

Autocomplete now supports partial text matches so you can find items faster while typing.

W-22454656

API spec projects now appear correctly in the Project and Project Dependencies panels.

W-22715444

XML debugger launch configurations now accept the noDebug property in launch.json as expected.

W-23122632

## July 14, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.23.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Guided Determinism in Agent Broker and Agent Network 2.0](#support-mule-soft-agent-broker-july-14-2026) - [Improved Exchange Search Results](#improved-exchange-search-results-july-14-2026) - [Improved Java Detection with the Bundled JDK](#use-bundled-jdk-for-java-detection-july-14-2026) ### Guided Determinism in Agent Broker and Agent Network 2.0 Build agent and brokers and networks with predictable, governed orchestration using [Agent Script](https://developer.salesforce.com/docs/ai/agentforce/guide/agent-script.html)—a graph-based language that gives you explicit control over how brokers coordinate agents, tools, and LLMs. In Agent Network 2.0, agent brokers use guided determinism to separate LLM-powered reasoning from deterministic control flow, giving you intelligent decision-making where you need it and guaranteed execution paths everywhere else. For more information, see [Agent Fabric Release Notes](https://docs.mulesoft.com/release-notes/agent-fabric/agent-fabric-release-notes) and [Building Agent Networks for Agent Fabric](https://docs.mulesoft.com/agent-network/latest/af-agent-networks). ### Improved Exchange Search Results Anypoint Code Builder now uses platform search components for Exchange search experiences, which helps you find and select Exchange assets more consistently. This update improves search behavior across supported Exchange workflows. For more information, see [Importing a Connector from Exchange](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components-import-connector-exchange). ### Improved Java Detection with the Bundled JDK Anypoint Code Builder now uses the JDK in the `AnypointCodeBuilder` folder as the Java instance for supported workflows. This reduces setup issues and helps projects open and run more reliably across environments. For more information, see [Mule Runtime Issues and Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-mule-runtime-errors). ### Fixed Issues
Issue ResolutionID

Mule language server operations now complete reliably without timing out during normal workflows.

W-23049419

MuleSoft Vibes requests now route through the proxy correctly.

W-23056251

The metadata tree now stays expanded when you open Transformation Builder with custom metadata.

W-23061578

Go To Flow now opens the referenced flow as expected.

W-23090107

Debugging now opens dependency flows referenced by flow-ref as expected.

W-23128325

Skill auto-update failures no longer display an error toast in the IDE.

W-23148357

Opening Mule projects on Windows now handles lowercase drive-letter paths correctly during Maven validation.

W-21968540

Uncommenting a component that Studio disabled now preserves valid Mule code.

W-22708555

The canvas now loads as expected when dependency resolution takes longer than usual.

W-23032933

DataWeave scripts now update correctly on Windows for array and nested mapping scenarios.

W-23122433

Anypoint Code Builder now connects reliably on slower computers during startup.

W-23232084

Projects that use CI-friendly ${revision} parent POM versions now load the flow canvas as expected.

W-23293643

## June 26, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.22.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Faster Startup on Windows](#faster-startup-on-windows-june-26-2026) - [Faster Extension Startup with Optimized Bundle Loading](#faster-extension-startup-with-optimized-bundle-loading-june-26-2026) - [Updated MCP Connector Support](#updated-mcp-connector-support-june-26-2026) ### Faster Startup on Windows Anypoint Code Builder now starts faster on Windows by optimizing Maven bookkeeping and bundle-loading operations during initialization. This reduces startup overhead so you can open projects and begin development more quickly. For more information, see [Anypoint Code Builder Startup](https://docs.mulesoft.com/anypoint-code-builder/#acb-startup). ### Faster Extension Startup with Optimized Bundle Loading Anypoint Code Builder now reads bundle directories directly from the extension path, improving how workspaces initialize extension assets. This streamlines startup behavior and reduces delays in project readiness. For more information, see [Anypoint Code Builder Startup](https://docs.mulesoft.com/anypoint-code-builder/#acb-startup) ### Updated MCP Connector Support Anypoint Code Builder now uses an updated MCP connector version to improve compatibility with current MCP integrations. This helps keep tool-driven workflows reliable across supported scenarios. For more information, see [MCP Connector in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started#mcp-connector-in-ACB). ### Fixed Issues
Issue ResolutionID

The configuration panel now loads as expected for connectors that use XML simple-content elements with attributes.

W-23048952

Local JSON-RPC socket connections now initialize more reliably on slower or constrained machines.

W-23156379

MuleSoft Vibes Anypoint Platform tools now fetch user profiles correctly in the India region when listing applications.

W-23008805

Language server requests now continue reliably in slower environments without timing out prematurely during startup.

W-23049419

Platform shutdown now handles failed JSON-RPC initialization without additional NullPointerException errors.

W-23049504

Custom connectors that define union-typed object parameters now load correctly.

W-22863083

## June 18, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.22.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Manage Global Elements from the UI](#global-elements-june-2026) - [Efficient Screen Space Usage in Transformation Builder](#efficient-screen-space-usage-in-transform-builder-june-2026) - [India Cloud Control Plane Region Support](#hyperforce-india-region-support-june-2026) ### Manage Global Elements from the UI Anypoint Code Builder now provides a **Global Elements** panel for viewing and managing the shared configurations your Mule application depends on, including connector configurations, properties files, TLS contexts, and error handlers. Open the panel from the canvas toolbar or **Project Properties**, and add, edit, or remove configurations using the form editor, source editor, or MuleSoft Vibes. For more information, see [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements). ### Efficient Screen Space Usage in Transformation Builder **Transformation Builder** now provides enhanced workspace flexibility with improved screen real estate management. For more information, see [Customize the Transformation Builder Layout](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#customize-transformation-builder-layout). ### India Cloud Control Plane Region Support Anypoint Code Builder is now available on the [India Cloud](https://in1.platform.mulesoft.com) control plane of Anypoint Platform. For more information about Anypoint Platform availability on control planes, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). ### Fixed Issues
Issue ResolutionID

Transformation Builder source metadata now remains visible after mapping operations.

W-22767859

Implicit DataWeave variables, such as correlationId, now work as expected.

W-20610661

Auto-discovery now adds the required namespace information automatically.

W-22158386

Expression Builder now keeps the cursor position stable so functions insert in the expected location.

W-22154279

Namespace additions now apply correctly when editing configurations.

W-22941217

Mule runtime downloads from the CLI now complete successfully.

W-22432886

Mule runtime download authentication now works correctly in non-production environments.

W-22434986

Path handling on Windows now uses consistent separators during URI comparisons.

W-22770705

## June 11, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.21.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

MCP tools now display correctly across supported IDEs. The connectivity MCP server can appear without registered tools in this release, which is the expected behavior.

W-22854860

## May 26, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.20.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

Anypoint Code Builder no longer shows duplicate or triplicate items when selecting a project for testing.

W-22565928

## May 19, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack. - Extension pack version: 1.19.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Compatibility](#compatibility). ### What’s New This release introduces these features. - [Auto-Scroll Canvas During Debugging](#auto-scroll-canvas-debugging-may-2026) - [Enhanced Breakpoint Visualization](#breakpoint-highlighting-may-2026) - [MuleSoft Vibes Updates](#vibes-updates-may-2026) - [Deprecation of the Develop the American Flights App Tutorial](#american-flights-tutorial-deprecated-may-2026) ### Auto-Scroll Canvas During Debugging The canvas now automatically scrolls to and centers the active component when you step through your application during debugging. For more information, see [Canvas Behavior While Debugging](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#canvas-execution-indicators). ### Enhanced Breakpoint Visualization Active breakpoints during debugging now display with a yellow outline on the canvas, making it easy to identify which component execution has paused at. For more information, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). ### MuleSoft Vibes Updates #### Manage Default Skills Default Skills in MuleSoft Vibes give agents preloaded, reusable instructions for common Mule development tasks such as project work, connector setup, and dependency resolution. For more information, see [Manage Default Skills in MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills#manage-default-skills). #### Run Multiple Integration Projects Locally Run multiple integration projects locally in one runtime to validate service-to-service behavior before deployment. Use MuleSoft Vibes to automatically create and run a reusable multi-project run configuration, including run and debug scenarios. You can also run saved configurations from the standard **Run and Debug** panel. For more information, see [Running Multiple Local Integration Projects with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-run-multiple-integration-projects-locally). #### Modernize Development with the New Descriptive UI MuleSoft Vibes now features a vertical canvas that uses AI to generate plain-language descriptions for every component in your flow. Build, modify, and document integrations using natural language commands or direct UI interactions. For more information, see [Descriptive UI in MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started#vibes-descriptive-ui). ### Deprecation of the Develop the American Flights App Tutorial The **Develop the American Flights App** tutorial is deprecated. For an alternative tutorial, see [Tutorial: Build an API from Start to Finish](https://docs.mulesoft.com/general/api-led-overview). ### Fixed Issues
Issue ResolutionID

The debugger now focuses on the correct file as expected when debugging multiple files simultaneously.

W-20493459

Sample data specified in custom metadata examples now loads correctly in the transformation window.

W-21314835

Sample data displayed in Expression Builder now matches the persisted sample data as expected.

W-21319134

Type propagation now resolves correctly without unexpected failure errors.

W-21485471

The debugger now displays Mule Message component values correctly for non-Java data types.

W-21707026

Copying JSON from a Mule event in debug mode now works as expected without errors.

W-21707258

Type propagation no longer fails when component location returns null values.

W-21735935

Variable value updates in the debugger now work as expected during debugging sessions.

W-21936302

Error breakpoint exception messages now provide clearer and more actionable information.

W-21957772

Breakpoint icons on the canvas now correctly display their muted state.

W-21986288

Signing in now works as expected for all users.

W-22000712

Document identifiers now propagate correctly across all batch steps in the Batch Processing connector.

W-22002465

The Go To Flow navigation feature no longer has intermittent failures.

W-22043908

Error objects are now visible in the VARIABLES panel when debugging inside error handler scopes.

W-22099074

Mapping icons now work correctly when variables are present in scripts.

W-22100547

MuleSoft Vibes no longer shows ValidationException errors for large prompts or PII context window connection errors.

W-22107257

MuleSoft Vibes MCP server connections now succeed for servers that don’t support resources or prompts.

W-22116159

The MimeType attributes no longer incorrectly show expression mode as supported.

W-22164971

Project artifact IDs can now be directly inherited in parent POMs.

W-22166146

The undo command now executes on the first invocation instead of requiring two attempts.

W-22170160

The debugger can now introspect ImmutableBatchJobResult objects in the On Complete phase.

W-22177315

Token refresh no longer enters an infinite loop due to setTimeout overflow.

W-22251798

The Apply button in the HTTP Listener Global Element configuration now works as expected.

W-22321659

The debugger now processes files within nested folders when debugging as expected.

W-22349447

## April 27, 2026 Anypoint Code Builder releases these patch versions in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.18.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn more about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). - Cloud IDE version: 1.18.3 This cloud IDE version runs the 1.18.3 extension pack. ### Fixed Issues
Issue ResolutionID

Applying policies with required schema properties that have default values in Agent Networks no longer causes failures.

W-22170170

## April 20, 2026 Anypoint Code Builder releases these versions in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.18.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). To learn about hardware and storage requirements for the desktop IDE, see [Desktop IDE Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/start-acb#hardware-storage-requirements). - Cloud IDE version: 1.18.1 This cloud IDE version runs the 1.18.0 extension pack. ### What’s New This release introduces these features. - [Canvas Actions](#canvas-actions-april-2026) - [Namespaces in DataWeave Scripts](#namespaces-in-dw-scripts) - [MuleSoft Vibes Updates](#mulesoft-vibes-updates-april-20-2026) - [Centralized Errors and Warnings](#acb-logs-centralized-panel-april-2026) ### Canvas Actions You can now refactor flows directly from the canvas, including moving, copying, and extracting components into new flows or subflows. Fore more information, see [Refactor Flows Using Canvas Actions](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#canvas-actions). ### Namespaces in DataWeave Scripts Anypoint Code Builder now supports metadata containing namespace URIs. For more information, see [Namespaces in Generated DataWeave](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#namespaces-in-generated-dataweave). ### MuleSoft Vibes Updates MuleSoft Vibes now supports custom metadata and reusable instructions with skills. #### Custom Metadata Full Support Create, delete, fetch, or edit custom metadata across these metadata types: csv, copybook, excel, fixed width, flat file, json, java, simple type, and xml. For more information, see [Custom metadata in MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#custom-metadata-vibes). #### Reusable Instructions with Skills Create and reuse instructions with MuleSoft Vibes Skills. Save instructions as skills to easily apply them across multiple conversations and projects, ensuring consistency and efficiency in your interactions. For more information, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). ### Centralized Errors and Warnings The new **ACB Logs** tab provides a single, table-based view of warnings and errors from every Anypoint Code Builder extension, so you can scan, filter, and search without switching between channels. You can filter by log level, source extension, date range, and project name. Expand an entry for full details such as stack traces and include Anypoint Code Builder Logs automatically when you export troubleshooting information. For full raw log streams from one channel at a time, keep using the **Output** panel (for example, **Mule DX Server** or **Mule DX Server: Scaffolding**). For more information, see [Viewing Logs and Errors](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel). ### Fixed Issues
Issue ResolutionID

Enum option lists now appear as expected inside arrays in the configuration UI.

W-20031362

Publishing a project to Anypoint Exchange no longer creates an example project unexpectedly.

W-20969183

Opening a project no longer takes more time than expected to load XML.

W-21154541

Opening a project or XML file again on Windows no longer takes an excessive amount of time.

W-21239937

Importing a project without sources no longer produces poor error handling.

W-21284401

Anypoint Code Builder AI no longer suggests an outdated Salesforce connector version.

W-21290906

The Transform Message component now shows the output tree for an inner field as expected.

W-21309692

Drag-and-drop mapping now works as expected for nested objects in flat file formats.

W-21310967

Metadata validation errors now work as expected for JMS and AS2 elements with Mule runtime 4.11.0.

W-21314344

DataWeave data preview works as expected on failure and shows log output.

W-21324741

The editor and workspace no longer show an unsaved file warning after saving all changes.

W-21327302

Importing a new API from Anypoint Exchange from the command palette no longer requires a reload to show changes.

W-21341100

Opening a file in a non-Mule project no longer raises nested project errors.

W-21341353

Field concatenation no longer fails across arrays and different sources in DataWeave.

W-21346401

Breakpoints in a source now stop execution as expected.

W-21352232

Sample generation no longer fails after changing custom metadata for the first time in the transformation window.

W-21421249

Progressive mapping now extends existing mappings as expected instead of replacing them.

W-21462334

The factory now handles the object-store-caching-strategy component as expected.

W-21467904

Large log files no longer slow down error logging.

W-21469432

The Mule::p function reference now resolves as expected.

W-21472817

Incorrect underline placement for DataWeave expressions in set-variable XML is fixed.

W-21473016

Verifying a test connection no longer randomly breaks.

W-21473880

A stack overflow in SimpleReferenceType.metadataConstraints in the DataWeave editor is fixed.

W-21485285

DataWeave editor no longer shows inconsistent counts of errors and warnings on the Problems tab.

W-21530956

The resolution of the p() function in DataWeave now works as expected.

W-21533179

Embedded documents now regenerate in DataWeave as expected.

W-21549247

The message reference now resolves in DataWeave as expected.

W-21550252

A StatusLogger format or conversion error in the design service is fixed.

W-21552602

Missing icons for date fields in DataWeave transforms are fixed.

W-21560510

Tests that affected reliability of the test suite are now stabilized and working as expected.

W-21575885

DataWeave syntax errors are now highlighted in configuration XML as expected.

W-21627864

POM.xml now resolves as expected when using a relative path.

W-21629880

An unexpected child element error in DefaultContainerProcessor in the DataWeave editor is fixed.

W-21631829

MUnit files now resolve in the workspace as expected.

W-21631910

Spacing around the Transform Message workspace in the DataWeave UI is tightened.

W-21638610

Saving files now persists changes as expected.

W-21642439

Clearing search on the Metadata tab now works as expected.

W-21642458

The canvas no longer fails to load.

W-21666326

Null pointer errors in the DataWeave virtual file system are fixed.

W-21667508 / W-21770880

The HTTP port is released as expected after use.

W-21706607

The restarts now pick up your latest changes as expected.

W-21706655

New components are no longer occasionally inserted inside a nested body instead of after it on the canvas.

W-21707238

Error messages now appear in the Mule event view as expected.

W-21707484

Intermittent socket timeout errors from Anypoint Exchange search are fixed.

W-21709965

A stack overflow in SimpleReferenceType.metadataConstraints caused by a self-referencing variable is fixed.

W-21712344

Contained element content now overrides the parent operation’s general content on the canvas as expected.

W-21712983

The first multi-selected canvas node (Shift+click) no longer opens the configuration UI unexpectedly.

W-21780098

The Project Properties header now shows the project name instead of the path.

W-21804043

Mapping editor errors caused by VFS initialization failures are fixed.

W-21809434

Corrupted JDK downloads no longer report success.

W-21841815

Autocompletion now works as expected in customer projects.

W-21850315

The Extract To form now shows the correct project’s file name in the drop-down.

W-21869137

The Extract To form now hides non-extractable nodes when multiple nodes are selected.

W-21869146

The Extract To form no longer appears for nodes that can’t be extracted.

W-21869157

The Extract To form now selects the current file by default as the extraction target.

W-21873522

Transform mapping data is no longer overwritten when variables are declared in the header.

W-21886152

Signing out of Anypoint Code Builder now works as expected.

W-21892267

Creating MUnit tests from a flow now works as expected.

W-21950086

Library configuration changes are now saved as expected when a shared library already exists in the POM.

W-21966352

Log files no longer use an incorrect file extension.

W-21978917

## March 20, 2026 Anypoint Code Builder releases these patch versions in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.17.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.17.3 This cloud IDE version runs the 1.17.3 extension pack. ### Fixed Issues
Issue ResolutionID

Opening multiple projects no longer causes errors during the initialization of the embedded DataWeave language server.

W-21618731

The file picker for DataWeave transformation configurations now opens as expected on Windows.

W-21651056

API governance validations no longer fail and display a "Validation failed: try again later" error message on Windows.

W-21568869

## March 16, 2026 Anypoint Code Builder releases these versions in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.17.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.17.2 This cloud IDE version runs the 1.17.2 extension pack. ### What’s New This release introduces these features. - [Anypoint Code Builder Support for gRPC](#anypoint-code-builder-grpc-support) - [Use More MIME Types in the DataWeave Transformer](#more-mime-types-dataweave-transformer) - [Export Mule Project Enhancements](#export-mule-project-unified) - [MuleSoft Vibes Updates](#mulesoft-vibes-updates-march-16-2026) - [MuleSoft MCP Server Project Updates](#mulesoft-mcp-server-project-updates) - [Expanded MIME Type Support in DataWeave Transform](#dataweave-transform-mime-type) - [Removal of Code Snippets Feature](#code-snippets-removal) ### Anypoint Code Builder Support for gRPC Anypoint Code Builder now supports gRPC for API specification design, scaffolding, and implementation. Create and import gRPC API specifications in Protocol Buffers (proto) format, scaffold Mule projects based on those specifications, and implement the generated flows using the Anypoint Code Builder. For more information, see [Designing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec). ### Use More MIME Types in the DataWeave Transformer Map and transform data using any MIME type supported by the Mule platform. The **DataWeave Transformer** component now supports all Mule runtime MIME types, moving beyond the previous JSON-only limitation. These improvements ensure parity with the Mule runtime and enable you to build diverse integrations without workarounds. ### Export Mule Project Enhancements Export a Mule project as a shareable or deployable JAR using a single action in the context menu and command palette. You can optionally include project sources for deployable JARs so the JAR can be opened in the IDE and used for deployment. For more information, see [Exporting Mule Projects](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project). ### MuleSoft Vibes Updates Build and manage integrations more efficiently with support for adding images to your conversation, using templates, and generating applications that include your private Exchange assets. These updates allow you to use a wider variety of assets for application generation while tracking your resource usage. #### Add Files to Prompts with Multi-modal Support Drag and drop images directly into the prompt window to provide context for your tasks. You can add up to 10 files per conversation to help MuleSoft Vibes understand your specific requirements. For more information, see [Add Files to Messages with Multi-Modal Support](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started#vibes-multimodal-file-prompts). #### Generate Applications from Templates Use local templates from Anypoint Exchange as the foundation for your generated applications. This ensures that new integrations follow your organization’s established patterns and best practices. For more information, see [Generate Applications from Exchange Templates](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations#vibes-generate-apps-from-templates). #### Include Custom Connectors in Generated Applications Generate applications that use custom connectors published to your private Anypoint Exchange. This update allows you to integrate with internal or specialized systems during the automated generation process. For more information, see [Include Custom Connectors in Generated Applications](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations#vibes-custom-connectors-generated-apps). #### Invoke Exchange APIs Using REST Connectors Generate applications that call APIs published to Anypoint Exchange. MuleSoft Vibes now uses REST connectors to invoke these APIs, making it easier to reuse existing assets across your landscape. For more information, see [Invoke Exchange APIs Using REST Connectors](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations#vibes-exchange-apis-rest-connectors). #### Monitor Token Consumption in MuleSoft Vibes Track the number of tokens consumed for each request and task directly within the Vibes window. This visibility helps you manage your usage and understand the resource cost of your generation tasks. For more information, see [Monitor Token Consumption in MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started#vibes-token-consumption-monitoring). ### MuleSoft MCP Server Project Updates MuleSoft MCP Server includes tool updates. For more information, see [MuleSoft MCP Server Release Notes](https://docs.mulesoft.com/release-notes/mulesoft-mcp-server/mulesoft-mcp-server-release-notes#new-features-mcp-server-mar16-26). ### Expanded MIME Type Support in DataWeave Transform DataWeave Transform in Anypoint Code Builder now expands support for MIME types across the Transform mapper. The component automatically adjusts DataWeave script headers based on the selected metadata and improves preview capabilities across additional formats, including Excel (XLSX) and CSV files with custom separators. These improvements help ensure that generated transformations remain consistent with Mule runtime behavior across a wider range of data formats. ### Removal of Code Snippets Feature Anypoint Code Builder deprecates the code snippets feature. ### Fixed Issues
Issue ResolutionID

The Open Project tool no longer closes the current workspace when opening a project folder during application generation.

W-21351774

Core models for the Mule runtime are now correctly cached. This change prevents the design service from starting unnecessarily and improves startup performance.

W-21354463

Workspaces now open correctly when you create an integration project from a template.

W-21414040

Integration projects created from a template now correctly include JavaSpecifications in the mule-artifact.json file.

W-21439730

Project Properties now correctly reflect the JDK version immediately after it is downloaded.

W-21514611

Login now works as expected on VDI machines after a previous logout.

W-21145337

Applications now correctly inherit characteristics from the parent pom file.

W-21368450

Instantiate a Mule framework instance using plugins without encountering NoSuchMethodException.

W-20922748

Project-specific connector operations now display correctly in the canvas without requiring you to reopen the file.

W-21582912

## February 24, 2026 Anypoint Code Builder releases these patch versions in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.16.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.16.2 This cloud IDE version runs the 1.16.2 extension pack. ### Fixed Issues
Issue ResolutionID

The bundled Mule runtime is no longer copied empty in the Web IDE.

W-21314634

Mule projects located outside of the Anypoint Studio workspace folder now import correctly into the Anypoint Code Builder workspace.

W-21294903

Fixed an issue where project deployment to CloudHub 2.0 failed because the system looked for an incorrect JAR file name after a successful package operation.

W-21304545

The custom metadata UI now loads correctly for projects with paths that contain spaces.

W-21308475

## February 17, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.16.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.16.0 This cloud IDE version runs the 1.16.0 extension pack. ### What’s New This release introduces these features. - [External Library Configuration for Mule Projects](#external-libraries-mule-projects-feb17-26) - [Custom Metadata Support](#custom-metadata-support-feb17-26) - [AI-Powered Auto Mapping with Enhanced Error Feedback](#ai-powered-auto-mapping-feb17-26) - [Bundled Runtimes for Instant Project Editing](#bundled-runtimes-feb17-26) - [Workspace Validation for Mule Projects](#workspace-validation-feb17-26) ### External Library Configuration for Mule Projects You can now add and manage external libraries for Mule projects directly from Anypoint Code Builder. This lets you configure project-level dependencies using recommended libraries, Maven dependencies, or local files. Configured libraries are added to the project POM and applied to all components that require them. You can also edit or remove libraries from the same configuration interface. ### Custom Metadata Support You can now define and assign your own custom metadata within the canvas UI to accurately visualize and test your organization’s data structures for your integration projects. By using a dedicated tab in the configuration panel, you can create metadata for inputs and outputs using common formats like CSV, JSON, and XML to make sure your data transformations are accurate. For more information see [Managing Custom Metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata). ### AI-Powered Auto Mapping with Enhanced Error Feedback You can now better debug your transformations with comprehensive error feedback for GenAI actions—including authorization, metadata, and request limits—ensuring a more reliable and guided mapping experience. The **Transformation Builder** now provides categorized error guidance to help you troubleshoot authorization issues, metadata problems, and request limit errors, making it easier to diagnose and resolve issues when using AI-assisted transformations and mapping features. ### Bundled Runtimes for Instant Project Editing You can now open and edit projects instantly without downloading separate Mule runtime versions. Anypoint Code Builder now ships bundled runtimes used for editing and metadata discovery (DataSense). You must download the exact runtime versions if running or debugging your app. ### Workspace Validation for Mule Projects Anypoint Code Builder now validates your project structure and provides guidance when a Mule project isn’t configured correctly. When creating new projects, you can select **Create in workspace** to organize multiple projects in a multi-root workspace. You can also import and validate existing Anypoint Studio workspaces and use MuleSoft Vibes to switch between workspaces using natural language. For more information, see [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). ### MuleSoft MCP Server Project Updates MuleSoft MCP Server includes tool updates. For more information, see [MuleSoft MCP Server Release Notes](https://docs.mulesoft.com/release-notes/mulesoft-mcp-server/mulesoft-mcp-server-release-notes#new-features-mcp-server-feb17-26). ### Fixed Issues
Issue ResolutionID

Duplicate runtime arguments from run and debug commands are removed, and arguments are now passed correctly without redundancy in the execution string.

W-20293482

Standalone DataWeave library projects in Anypoint Code Builder now execute correctly across all workspace configurations.

W-20334373

Error handling logic now works as expected and provides uniform behavior and messaging consistency across the IDE.

W-20364853

Project properties and connection lists now display correctly and are no longer hidden or empty.

W-20531631

Mule Maven plugin dependencies now resolve correctly in clean .m2 repositories without manual intervention.

W-20825706

Processors can now be added as expected to the beginning of existing components within the Process Record section of a Batch Job component.

W-20926265

Components are now placed in the correct location during drag operations on the UI canvas.

W-20926514

The Transform Message component content is now visible without the requirement of CDATA tags.

W-21146025

Database connection configurations in the global configuration page now update the XML source correctly.

W-21147450

Socket timeout exceptions no longer occur when loading connector operators.

W-20201721

## February 6, 2026 Anypoint Code Builder releases this version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.15.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.15.0 This cloud IDE version runs the 1.15.0 extension pack. ### What’s New This release introduces these features. ### Support for Mule Runtime 4.11.0 Anypoint Code Builder now supports Mule runtime 4.11.0 for creating and managing Mule projects. Create new projects with Mule runtime 4.11.0 or update existing projects to use this runtime version in project properties. ### Agent Network Project Updates Agent networks now support these authentication types: - OAuth 2.0 OBO Credential Injection using OAuth 2.0 Token Exchange or Microsoft Entra ID On-Behalf-Of protocols - In-Task Authorization Code For more information about these types, see the [Agent Network YAML File Reference](https://docs.mulesoft.com/agent-network/latest/af-project-files#authentication-types). ### MuleSoft MCP Server Project Updates MuleSoft MCP Server includes tool updates. For more information, see [MuleSoft MCP Server Release Notes](https://docs.mulesoft.com/release-notes/mulesoft-mcp-server/mulesoft-mcp-server-release-notes#new-features-mcp-server-feb6-26). ### Scaffold and Implement APIs with Vibes MuleSoft Vibes can now scaffold and implement API specifications on your local machine or from Anypoint Exchange. This ensures accurate project structures and a seamless transition from scaffolding to adding application logic, reducing manual configuration and preventing project errors. ### Fixed Issues
Issue ResolutionID

The command 'mule-dx-mule-dev.runMuleProject' error no longer occurs when selecting Run Mule Project in the Mule option.

W-20978630

You can now edit nested connections from different XML files as expected.

W-20898437

The Exchange search filter is no longer breaking search results.

W-21018002

## January 15, 2026 Anypoint Code Builder releases this patch version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.14.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.14.1 This cloud IDE version runs the 1.14.1 extension pack. ### What’s New This release introduces these features. ### DataWeave Mapping Enhancements - **Advanced nested array mapping**: **DataWeave Transform** now supports dragging fields within nested objects and arrays more intuitively. When mapping fields into an existing `map` function, the UI automatically resolves the correct scope and variables to generate accurate DataWeave scripts. - **Automated hierarchical array mapping**: **DataWeave Transform** now intelligently handles mapping between different array levels. When dragging a top-level source array to a nested target array, the tool automatically generates the required parent-to-child wrapping and map functions to maintain the correct output structure. - **Intelligent scalar-to-object refactoring**: **DataWeave Transform** now automatically handles the transition from scalar assignments to nested object structures. When you map nested fields within an object node, Anypoint Code Builder refactors the script to ensure a valid hierarchy without requiring manual code cleanup. ### Canvas Loading Status Indicator A loading status indicator now shows while the canvas initializes. This enhancement provides more visible and integrated feedback during project loading and synchronization tasks, improving the overall responsiveness of the design experience. ### Optimized Canvas Connectors The design of flow edges and connectors is improved to increase visual density. This update allows for a more compact representation of integration flows, enabling users to view more content and steps within the canvas. #### Agent Network Project Creation You can now create Agent Network projects directly from the project creation flow. The project creation interface includes Agent Network configurations for setting up advanced project environments within the Anypoint Code Builder workspace. #### Refined API Specification Selection The project creation form is now clearer and more intuitive when starting new Mule projects based on existing API definitions. #### Centralized Dependency Error Reporting The dependency-related errors are now shown in the **PROBLEMS** tab so that you can identify and resolve Maven resolution or library conflicts more efficiently without searching through background logs. #### MuleSoft MCP Server Project Updates MuleSoft MCP Server includes three new tools: - `implement_api_spec` - `generate_munit_test` - `modify_munit_test` For more information about these tools, see [MuleSoft MCP Server Release Notes](https://docs.mulesoft.com/release-notes/mulesoft-mcp-server/mulesoft-mcp-server-release-notes#new-features-mcp-server-jan15-26). #### Agent Network Project Updates - Agent network now supports Gemini models. Specify these parameters in the LLM section of the `agent-network.yml` file. - `thinkingBudget`: Sets a token budget for the reasoning phase. (Applies only to Gemini 2.5 series.) - `thinkingLevel`: Controls the depth of the reasoning process. (Applies only to Gemini 3 series.) - `temperature`: Controls randomness. - `topP`: Nucleus sampling parameter. - `responseLogprobs`: Whether to return log probabilities. - `maxOutputTokens`: Maximum number of tokens that can be generated in the response. For more information about these parameters, see the [Agent Network YAML File Reference](https://docs.mulesoft.com/agent-network/latest/af-project-files#agent-network-yaml). - The agent broker is now aware of which LLM model you select and uses the appropriate API. For example, if you’re using an OpenAI model, the broker now uses function calling rather than sending the system prompt, broker instructions, tools, and history as one prompt. ### Cleaner Project Context Menus Project context menus are now consistent across root and multi-root workspaces for supported Mule project types. Anypoint Code Builder actions are shown only when they apply to the selected project or folder, and related actions are grouped more clearly to improve discoverability. ### Cleaner Command Palette Actions The Command Palette now shows a cleaner and more consistent set of Anypoint Code Builder commands across single-root and multi-root workspaces. Commands are clearly named, consistently prefixed with MuleSoft, and organized using descriptive categories such as API, Mule, and Agent Network. Only actions that initiate complete workflows appear in the Command Palette. Context-specific commands are available only when the required project context is active. ### Fixed Issues
Issue ResolutionID

Fixed an issue where switching between factory configurations in a JMS publish component caused XML corruption.

W-20159060

Fixed an issue in the Java module New operation where the error icon remained visible after the Constructor value is successfully configured. The UI now correctly clears the error state after valid configuration data is provided.

W-20117914

Fixed an issue in DataWeave Transform where mapping fields from a nested source to a nested target sometimes resulted in incorrect script nesting. The UI now accurately maintains the nested structure and context when multiple fields are mapped to the same target path.

W-20208318

Fixed an issue where creating a new API project inside a nested workspace folder prevented the project from opening or being added to the current workspace. Projects now open correctly regardless of their folder depth within the workspace.

W-20212604

Drag actions in Transformation Builder no longer occasionally result in a UI error state.

W-20222649

Anypoint Code Builder now correctly shows an error message when you open a project located outside the root folder or within the current workspace.

W-20249789

The canvas now accurately identifies and displays synthetic routes within connectors.

W-20332947

Anypoint Code Builder now displays an error related to project properties when your project fails to initialize correctly.

W-20481957

The editor now correctly uses UTF-8 encoding across all platforms to ensure that consistent data is displayed in the Transformation Builder input and output windows.

W-20494670

Fixed an issue with MCP tools that took no input arguments.

W-20474172

The DataWeave editor no longer becomes slow or unresponsive when working with large transformations, including freezes triggered by auto-save.

W-19966256

DataWeave scripts no longer lose their formatting or collapse into a single line when you edit connection configurations or make unrelated project changes.

W-20082580

The canvas no longer gets stuck in an infinite loading state.

W-20214677

The HTTP Request component no longer reverts header or body values back to payload when editing them in the canvas UI.

W-20581927

DataWeave mappings no longer drop type casting when concatenating expressions.

W-20582971

## December 18, 2025 Anypoint Code Builder releases this patch version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.13.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.13.1 This cloud IDE version runs the 1.13.1 extension pack. ### Fixed Issues
Issue ResolutionID

CLI for Agent Fabric Plugin is updated to the latest version to address reported security vulnerabilities.

W-20573569

## December 12, 2025 Anypoint Code Builder releases this version in the Cloud IDE. - Cloud IDE version: 1.13.0 This cloud IDE version runs the 1.13.0 extension pack. For a complete list of the features and fixed issues included in this release, see the [December 11, 2025](#Dec11-2025), Anypoint Code Builder release notes. ## December 11, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack. - Extension pack version: 1.13.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). ### What’s New This release introduces these features. #### New Enhancements to the DataWeave Transform Component This update includes several improvements to UI stability and the generative AI experience, such as optimized behavior in the **Transform Message** component UI and more responsive error handling for AI-powered actions. #### Stability Enhancements ##### Improved MCP Config Reference Editing The Inference Connector configuration panel now reliably allows the added client to be edited when configuring an MCP config reference field. ##### Stabilized Audience Settings for MCP Listener Configuration of the audience field within the responses group of the MCP Tool Listener is now reliable and consistent, ensuring that the field appears correctly, even when imported from an XML file. #### Agent Network Project Updates - The [Agent Network YAML File Reference](https://docs.mulesoft.com/agent-network/latest/af-project-files#agent-network-yaml) now includes all available parameters for each section. - The `agent-network.yml` file now exposes new parameters from OpenAI. Specify these parameters in the `llm` section settings for OpenAI. - `reasoningEffort`: Constrains reasoning effort for reasoning models. - `temperature`: Controls randomness in the output. - `topP`: Nucleus sampling parameter. - `topLogprobs`: Number of most likely tokens to return at each position. - `maxOutputTokens`: Maximum number of tokens to generate. For more information about these parameters, see the [Agent Network YAML File Reference](https://docs.mulesoft.com/agent-network/latest/af-project-files#agent-network-yaml) and [OpenAI Platform API Reference](https://platform.openai.com/docs/api-reference/introduction). - These agent network dependencies are updated: - OpenAI SDK version is updated to 4.8.0. - Mule HTTP Connector version is updated to 1.11.0. - A2A Connector version is updated to 0.4.0-BETA. - A2A SDK version is updated to 0.3.3-final. - MCP Connector version is updated to 1.3.0. - Caffeine version is updated to 3.2.3. - JaCoCo version is updated to 0.8.11. - `aspectj` version is updated to 1.9.22.1. - Common text version is updated to 1.14.0. #### Git Installation No Longer Required - You no longer need to install git as part of the Anypoint Code Builder installation process. ### Fixed Issues
Issue ResolutionID

The Autodiscovery element no longer appears in the Add Component panel.

W-16891052

Users now receive a notification after successful deployment to CloudHub as expected.

W-18079627

DataWeave output metadata is now correct in component fields.

W-18553945

The canvas now correctly reflects unsaved changes.

W-18657386

CloudHub redeployment no longer fails intermittently.

W-18727013

The Transformation Builder window for DataWeave no longer shows an error in the input sample on Windows systems.

W-18911593

The flow configuration UI attribute for enabling default events is now correctly written in the XML file.

W-19117758

The configuration UI no longer shows a default value for data types when no default value exists in the metadata.

W-19175333

Errors updating XML no longer occur on the canvas when updating auto closed tags.

W-19211738

Editing metadata in the Transform Message component now works correctly if the source is a DataWeave file.

W-19273485

The M2_REPO variable is now used to populate the repository at startup.

W-19476167

The debugger now correctly pauses in the main flow and sub-flow after using Step into.

W-19547488

Toggling between INLINE or Bean mode to None now works correctly in the configuration panel.

W-19623905

You can now input text for Operations in MuleSoft Vectors Connector as expected.

W-19637694

Validation now shows errors as expected for missing fields in the Database component.

W-19679369

The debugger now shows the breakpoint information as expected if Step into is used on a flow reference pointing to a flow in the configuration of a sub-folder.

W-19679780

Unauthorized errors no longer occur when the token expires.

W-19971283

A2A Connector configurations now appear in version 0.4.0-BETA as expected.

W-20004568

If deployment to CloudHub 2.0 fails, the user now gets an error notification.

W-20030018

Transformation Builder no longer closes unexpectedly on Windows systems when pressing Ctrl+Backspace.

W-20031151

Error messages no longer repeatedly pop up for the same error during dependency resolution.

W-20036183

A path traversal vulnerability in MuleSoft MCP Server tools is now fixed.

W-20039005

Intermittent corruption of the JDK installation no longer occurs.

W-20052935

A server-side template injection vulnerability in MCP flow generation tools is now fixed.

W-20053148

The Dev Agent web fetch tool timeout is increased from 10 to 30 seconds to support slow-loading URLs.

W-20084547

Expression Builder no longer breaks or displays incorrectly if the DataWeave transformation contains a long script.

W-20086693

The configuration UI in the Java module now successfully loads the Method field values.

W-20112957

Misleading stack traces from the Design Service logs that appeared when loading custom connectors are removed.

W-20131222

The HTTP Listener component now secures the password during TLS setup as expected.

W-20135822

The Anypoint Code Builder Integration Extension now uses the correct version of org.mule.weave dependencies instead of using the 2.6.1. version.

W-20159499

The Anypoint Code Builder Platform Extension version 5.9.7 no longer breaks in Windows systems.

W-20192341

The Expression Builder gear icon is now clickable as expected.

W-20203410

The Audience field in the MCP tool listener configuration no longer intermittently fails to display.

W-19127724

The MCP configuration reference field in the Inference Connector can now be edited as expected.

W-20018055

The internal platform jar socket is now restricted to listening on localhost only, mitigating a potential Remote Code Execution (RCE) vulnerability.

W-20194553

Object group element attributes now update correctly in the UI, and inconsistent behavior related to empty element deletion in the Transform script field no longer occurs.

W-20244840

Custom metadata now shows as expected in the Output column of the mapping window for transform components.

W-20062856

SAP Connector test connection no longer fails.

W-19124681

The scaffolding process no longer fails when the project ID used for scaffolding doesn’t match the project ID that was created.

W-20201660

Projects that are inherited from a Parent POM that use Maven’s CI-friendly version properties no longer incorrectly report that the parent POM can’t be found.

W-20272484

The Connectors tab in Project Properties no longer fails to load when an incompatible connector version causes the Mule framework introspection to fail.

W-19284941

The code editor of a component is now resizable and shows line numbers.

W-20060203

The drag and drop action for simple Transform components no longer breaks the canvas view and flow XML on Windows systems.

W-20439430

The MuleSoft Dev Agent stream no longer intermittently throws an incorrect ValidationException error embedded within stream chunks.

W-20068043

MuleSoft Dev Agent no longer fails due to streaming errors or server timeouts during operations.

W-20023190

MuleSoft Dev Agent no longer experiences a five-second delay before making the first API call after being opened.

W-20077965

The Map with AI feature in Transformation Builder now correctly displays user access errors when they occur.

W-20276613

The Edit Sample Data File icon is no longer disabled in the Map with AI feature in Transformation Builder. Also, the default call when opening the Transform UI is removed, and the UI now shows a message instead of a spinning icon when the GenAI API call fails.

W-20276613

Anypoint Code Builder no longer fails to render all configuration parameters, such as the HTTP Requestor parameter, for the RosettaNet Connector in the Configuration UI.

W-20190237

Anypoint Code Builder no longer displays an incorrect compatibility error message when a project dependency is missing in the current Exchange environment.

W-19750194

The Import global element now recognizes flows defined within the imported plugin as expected.

W-19986168

The Visual Designer no longer fails to show and recognize shared configuration components when they’re inherited from a Parent POM.

W-20178132

Keyboard shortcuts, such as Command+C and Command+V, now work as expected when selecting and editing text in the DataWeave Editor.

W-20162326

This release addresses the following issue with agent network projects:
Issue ResolutionID

The distributed trace now correctly includes LLM calls for an agent broker.

W-19825674

## November 12, 2025 Anypoint Code Builder releases this patch version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.12.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.12.2 This cloud IDE version runs the 1.12.2 extension pack. ### Fixed Issues
Issue ResolutionID

Anypoint Code Builder Platform Extension no longer fails on Windows systems.

W-20192341

## November 10, 2025 Anypoint Code Builder releases this patch version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.12.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.12.1 This cloud IDE version runs the 1.12.1 extension pack. ### Fixed Issues
Issue ResolutionID

Some dependencies are updated to address reported vulnerabilities.

W-20115973

## November 4, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack. - Extension pack version: 1.12.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.12.0 This cloud IDE version runs the 1.12.0 extension pack. For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - [Support for Maven Multi-Module Projects and Parent POM Files](#multi-module) - [Map with AI Now Detects and Applies Existing Metadata MIME Types](#dw-metadata-mime-types) - [Agent Network Project Updates](#agent-networks-nov-25) - [Support for Connection Configurations Defined in Dependencies](#dependency-connection-configs) #### Support for Maven Multi-Module Projects and Parent POM Files Anypoint Code Builder now supports Maven multi-module projects and parent POM file functionality. Define properties, dependencies, and versions once and share them across multiple projects, guaranteeing consistency and eliminating version drift. For more information, see [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project). #### Map with AI Now Detects and Applies Existing Metadata MIME Types The **Map with AI** tool is now enhanced to automatically detect and apply the existing metadata MIME types (such as `application/json`, `application/xml`, and `application/java`) defined in your project’s flow. When generating a DataWeave script, **Map with AI** now reads the input and output formats from the surrounding connectors and correctly applies those types to the generated script’s directives. #### Agent Network Project Updates The agent broker now dynamically adapts when any downstream AI asset changes its contract because the MCP and A2A metadata automatically refreshes every hour. #### Support for Connection Configurations Defined in Dependencies Anypoint Code Builder now detects and loads connection configurations that are defined in external project dependencies. The tool scans all import statements in your Mule flows, locates the related files inside dependency JARs, and extracts the connection configurations they define. These configurations appear in both the XML view and the canvas view. ### Fixed Issues
Issue ResolutionID

Anypoint Code Builder now correctly resolves Maven settings and configurations against the settings.xml file and no longer creates a temporary acb_settings.xml file.

W-19128433

The canvas now refreshes automatically after updating the runtime version in project properties.

W-19285759

Pasting a component after a disabled component no longer breaks the canvas UI or prevents the flow from rendering.

W-19719169

The Error Handler configuration now displays all applicable error types based on the components used in the flow as expected.

W-19788055

The Agent Fabric flag is now correctly enabled when switching from the Control Plane to EU Cloud in the desktop IDE.

W-19810833

The context menu no longer appears for nodes in the read-only Agent Fabric Authoring canvas.

W-19840137

The auto approval for tool execution in the Dev Agent chat window now works as expected.

W-19842516

Java processes no longer remain active after closing Anypoint Code Builder.

W-19849557

The local .m2 repository is now populated correctly at startup.

W-19860834

Dev Agent no longer becomes unresponsive.

W-20051611

Validation decorators now appear correctly in the canvas after adding a new connector or updating dependencies in the project pom.xml file.

W-18741926

The Java debug server that started automatically when running Mule apps is now disabled by default to prevent unauthorized access.

W-18968450

Anypoint Code Builder now loads the Maven settings.xml file at startup to correctly generate the acb_settings.xml file with the user’s configuration.

W-19128433

MUnit configurations defined in the parent pom.xml file are now correctly inherited by child projects.

W-19284704

The minMuleVersion value in the mule-artifact.json file is no longer overwritten by Anypoint Code Builder. Runtime feature toggles are now decoupled from this property.

W-19374653

Anypoint Code Builder no longer becomes unresponsive or stuck on the loading screen when adding components to a flow in customer projects.

W-19525162

The canvas now opens the correct configuration panel when selecting components.

W-19687980

Disabled components can now be copied and pasted successfully without triggering errors during node duplication.

W-19760175

DataWeave actions now appear in the correct position within the context menu.

W-19883653

Anypoint Code Builder now defaults to the US production environment when the ANYPOINT_ENV variable is set to an unrecognized value.

W-20003674

Exchange search now correctly returns the Inference connector when using Mule runtime 4.9.10 or later.

W-20054759

The correct message is now displayed when attribute and variable samples are empty in the configuration panel.

W-20057018

Error messages related to connector dependencies now include a clickable pom.xml link.

W-15813306

This release addresses the following issues with agent network projects:
Issue ResolutionID

Agent brokers now maintain conversation context during multi-turn interactions.

W-19825674

Agent brokers now return properly formatted text content in input-required responses instead of empty strings.

W-19880599

## October 24, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack. - Extension pack version: 1.11.6 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.11.5 This cloud IDE version runs the 1.11.6 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

Auto-approval for safe commands is now disabled in MuleSoft Dev Agent. Command execution now always requires explicit user approval, unless Execute all commands is enabled, preventing potential prompt injection exploits.

W-19853225

Editing VS Code configuration files (.vscode/ and *.code-workspace) now requires explicit approval.

W-19853255

Editing the MCP configuration file (a4d_mcp_settings.json) now requires explicit approval in MuleSoft Dev Agent.

W-19853247

## October 14, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack. - Extension pack version: 1.11.5 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

Core capabilities in the Design Service, including Test Connection and Run and Debug, function as expected on slow machines.

W-19864902

Data streaming issues are fixed now and responses from Model API no longer fail.

W-19845839

## October 8, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.11.4 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.11.4 This cloud IDE version runs the 1.11.4 extension pack. For extension versions, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This version contains internal bug fixes and performance improvements. ## October 3, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.11.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.11.0 This cloud IDE version runs the 1.11.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - [Agent Fabric](#agent-fabric) - [MuleSoft Dev Agent](#dev-agent) - [Batch Processing Support](#batch-process-support) - [Duplicate Flows in Canvas](#duplicate-flows) - [Copy and Paste Components in Canvas](#copy-paste-components) - [Stability and Usability enhancements](#stability-usability-enhancements) - [Mule Runtime Support](#mule-runtime-4-10-0-support) - [Einstein Features and Free Trial Orgs](#einstein-and-free-trials) - [More Agentic Integration Development with the Embedded MuleSoft Model Context Protocol (MCP) Server](#mcp-server) #### Agent Fabric Use Anypoint Code Builder to create, publish, and deploy agent networks as part of the Agent Fabric solution. Agent Fabric is a unified solution for governing and monitoring AI agents built anywhere, making it possible to build a collaborative digital workforce across any system or app. For more information, see [Building Agent Networks for Agent Fabric](https://docs.mulesoft.com/agent-network/latest/af-agent-networks). #### MuleSoft Dev Agent The Agentforce panel in Anypoint Code Builder has been updated with MuleSoft Dev Agent. MuleSoft Dev Agent is an integrated assistant that enables developers to use natural language prompts to design, develop, and manage applications directly within Anypoint Code Builder. Dev Agent unifies all generative AI capabilities into a single experience: - Create and edit flows - Generate and refine API specifications - Configure connections and projects - Deploy applications Dev Agent can read and write directly to project files, and supports tools provided by embedded MCP servers. For more information, see: - [Creating API Specs with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-api-ai-create-spec) - [Developing Integrations Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/int-ai-developing-integrations) #### Batch Processing Support Create and configure batch jobs for processing large volumes of records asynchronously, in parallel, and in chunks to optimize performance and resource utilization. For more information, see [Batch Job ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-batch). #### Duplicate Flows in Canvas Duplicate flows in the canvas to create copies of existing flows with their components and configurations. For more information, see [Duplicate a Flow](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#duplicate-a-flow). #### Copy and Paste Components in Canvas You can now copy components in your flow and paste them in the same or a different flow, while retaining their configuration. For more information, see [Copy Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#copy-components). #### Stability and Usability enhancements ##### Object Store in Global Configuration Streamline your development with an improved visual and guided experience for configuring object stores in any component and reduce the need for manual XML coding. ##### Special Characters Support You can now use special characters in flow names, password fields, connection configurations, and global elements. ##### Multiple Versions of a Connector Within a Project You can now use multiple versions of a connector in your projects. ##### Multi level Connection Configurations Easily manage and structure complex connection setups by layering connection configurations within each other directly from the UI. ##### Flow Error Handler Configuration New configuration options for handling errors in your Mule project flow. ##### Go to Flow Keyboard Shortcut You can now quickly open a referenced flow by pressing Ctrl+Alt+g (Windows) or Cmd+Option+g (macOS) while the `Flow ref` component is selected. For more information, see [Navigate to Referenced Flows](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#navigate-to-referenced-flows). ##### Notifications with Project Context Notifications now provide specific context about which projects are causing errors within a workspace. ##### Design Service Connection on Non-English Computers Users can now connect to the design service on a computer with a non-English language setting. ##### Initial pom.xml Template Update The initial **pom.xml** template is updated to use HTTPS for Maven XSD to enhance its security. ##### Projects Open in Current Window Projects created using the **Implement an API** option now open in the current window instead of a new one. ##### Map and Transform with AI Improvements The **Map and Transform with AI** feature now shows specific messaging when there is an error. Input and output metadata is no longer required for this feature. ##### Variable and Attribute Configuration in Transformations You can now edit and configure variables and attributes within transformations from the UI. #### Mule Runtime Support Support for Mule runtime engine version 4.10.0 Edge with Java version 17. See [Compatibility](#compatibility). #### Einstein Features and Free Trial Orgs Einstein features are no longer be available on free trial Salesforce orgs. Users must link to their own Salesforce org to use these features. For more information, see [Managing your Anypoint Platform Account](https://docs.mulesoft.com/access-management/managing-your-account). #### More Agentic Integration Development with the Embedded MuleSoft Model Context Protocol (MCP) Server Use natural language interaction to build Agent Fabric agent networks, manage governance rulesets, and more. Any agent can execute MuleSoft MCP Server tools. MCP provides extensibility for a wide array of agent types. For more information, see [MuleSoft MCP Server Release Notes](https://docs.mulesoft.com/mulesoft-mcp-server/mulesoft-mcp-server-release-notes). ### Fixed Issues
Issue ResolutionID

When setting up HTTP request headers, the IDE no longer incorrectly adds an empty array symbol #[] in the headers expression section of the flow XML code.

W-19152657

The inference connector no longer fails to retrieve and show dynamic data for the value provider field.

W-19084301

The IDE now correctly generates the default XML code snippets for nested fields, including arrays, objects, and unions.

W-19144806

In the Salesforce Connector, the parameters for the "Salesforce - Query" connector no longer disappear after clicking on it from the "Set variable" connector.

W-18836813

The Agent Conductor module now displays correctly.

W-19094498

The paths for certain container route types, such as scatter-gather and first successful, no longer overlap with each other.

W-19094528

The connection test for the Kafka connector is now working as expected.

W-12553536

The XML code is now generated in the correct order in the A2A Connector.

W-19105944

The MIME type parameters are shown as expected in the user interface.

W-18106124

DataWeave data and functions no longer return empty if adding a new project to an existing workspace.

W-18824864

The agent conductor data now loads properly in the user interface.

W-19154866

Setting breakpoints on flow control nodes is now working as expected.

W-18838355

The debugger tool no longer disappears unexpectedly.

W-19145809

The flow name updates as expected if you close the panel right after changing the flow name.

W-19147834

The error message java.lang.NoClassDefFoundError: org/mule.apikit.ApiParser no longer appears when the design service starts.

W-18195261

The output of a DataWeave mapping for non-transform components is no longer incorrect.

W-18566031

The startup error no longer occurs in specific customer project.

W-19337637

The output variable of a DataWeave mapping is now correct.

W-18566025

Dynamic control data is no longer overridden if you switch nodes.

W-19280291

Adding a Raise error component no longer breaks DataSense for the entire flow.

W-19404195

Validation issues in the XML file are fixed when using the batch component.

W-19136911

DataSense resolution errors no longer occur with certain components.

W-19367638

Sample data persistence calls for some nodes no longer fail.

W-19145325

Debug sessions are no longer killed on slower machines.

W-19183938

The Flow Ref component now correctly gets the flow list even if a flow is disabled.

W-19248177

Breakpoints set in one file are no longer incorrectly shown in another file’s canvas.

W-19302452

DataWeave expressions used within a variable of a Transform Message component are no longer lost.

W-19336241

Custom names for flows and error handlers are now correctly updated in the flow canvas.

W-19121648

The error state for connector routes is now displayed correctly.

W-19388454

The Export Shareable Jar command on Windows no longer includes unwanted folders.

W-19461974

NullPointerException no longer occurs if invoking 'getElementName().

W-18727157

The Go to Flow command now correctly finds a sub-flow in a second file.

W-19013755

The Map and Transform with AI feature is now working as expected.

W-19134821

## September 3, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.10.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.10.2 This cloud IDE version runs the 1.10.2 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New - Support for Mule runtime engine version 4.9.9 LTS with Java version 17. See [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

The platform extension pack is updated to version 5.7.2 to fix a compatibility issue with Intel Mac machines.

W-19359467

## August 19, 2025 Anypoint Code Builder releases this patch version in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.10.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.10.1 This cloud IDE version runs the 1.10.1 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## August 11, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.10.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.10.0 This cloud IDE version runs the 1.10.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces this feature: - Agentic Integration Development with the Embedded MuleSoft Model Context Protocol (MCP) Server With agentic integration development, build and manage your integration with natural language interaction, not code. Any agent can execute MuleSoft MCP Server tools to create, test, debug, and deploy Mule applications. MCP provides extensibility for a wide array of agent types. For more information, see [MuleSoft MCP Server Overview](https://docs.mulesoft.com/mulesoft-mcp-server/). ## July 21, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.9.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.9.2 This cloud IDE version runs the 1.9.2 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the Visual Studio Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New - Support for Mule runtime engine version 4.9.7 LTS with Java version 17. See [Compatibility](#compatibility). ## July 4, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.9.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.9.0 This cloud IDE version runs the 1.9.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the Visual Studio Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - [Map Fields in DataWeave Expressions with AI](#dataweave-transform-map) - [Generate DataWeave Transformations with AI](#dataweave-transform-map-transform) - [Design API Specs with AI](#api-design) - [Use A2A Connector (Beta) with Anypoint Code Builder](#a2a-connector) - [Use MCP Connector 1.0 (Generally Available) with Anypoint Code Builder](#mcp-connector) - [Create MUnit Test from Flow](#munit-flow) - [Scope MUnit Tests to Specific Processors from UI](#munit-processor) - [Comment Out Components in Canvas](#comment-out-canvas) - [Navigate to Flows from Connectors](#navigate-to-flows) - [Review Scaffolding Errors in Output Panel](#scaffolding-errors) - [Open Projects in Canvas by Default](#canvas-default) - [Enter Properties as Values in Fields in UI](#properties-in-fields) - [Check Java and Mule Runtime Compatibility for All Connectors in Your Project](#connector-compatibility) - [Use Anypoint Code Builder with Windows 11](#windows-11) - [Agentforce Command Removed](#command-removed) - [Fixed Issues](#july-25-fixed-issues) #### Map Fields in DataWeave Expressions with AI Automatically generate field-to-field mappings based on input and output metadata with the assistance of AI. For more information, see [Map with AI](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#map-with-ai). #### Generate DataWeave Transformations with AI Generate full DataWeave transformations from input and output sample data with the assistance of AI. For more information, see [Map and Transform with AI](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#map-and-transform-with-ai). #### Design API Specs with AI Use Einstein generative AI to generate API specs from a conversation. For more information, see [Designing API Specs with AI](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes). #### Use A2A Connector (Beta) with Anypoint Code Builder This release introduces support for Anypoint Connector for Agent2Agent (A2A Connector) (beta). A2A Connector (beta) facilitates inter-agent communication for Large Language Model (LLM) agents and other applications by implementing the A2A protocol. This enables agents to interact and delegate specialized tasks to other agents. See [Built-In Connectors](https://docs.mulesoft.com/anypoint-code-builder/ref-connectors). _A2A Connector is a beta connector that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/agreements/) or a written Unified Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms in the [Product Terms Directory](https://ptd.salesforce.com/?_ga=2.247987783.1372150065.1709219475-629000709.1639001992). Use of this beta connector with external systems or services consumes Mule messages and is at the Customer’s sole discretion._ #### Use MCP Connector 1.0 (Generally Available) with Anypoint Code Builder This release introduces support for the generally available version of Anypoint Connector for MCP (MCP Connector). Previously, Anypoint Code Builder supported the beta version of MCP Connector. If you used the beta version of MCP Connector, remove `-Dmule.http.service.implementation=NETTY` from Runtime: Default Arguments in MuleSoft Settings. Also, the Design Service: System Properties setting is removed from MuleSoft Settings. MCP Connector helps you expose your Mule application as a tool that any AI client supporting Model Context Protocol (MCP) can use to perform real-world actions. See [Built-In Connectors](https://docs.mulesoft.com/anypoint-code-builder/ref-connectors). #### Create MUnit Test from Flow Create MUnit tests for your Mule project directly from the context menu of a flow. For more information, see [Create a Test from a Flow](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit#create-test-from-flow). #### Scope MUnit Tests to Specific Processors from UI Select the processors and attributes in a Mule flow from the UI for testing to i​ncrease precision, identify issues faster, and create tests more efficiently. For more information, see [Targeting Specific Processors and Attributes in Your Test](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit#targeting-specific-processors-and-attributes-in-your-test). #### Comment Out Components in Canvas Comment out components directly in Anypoint Code Builder canvas. Disabled components can also be deleted in bulk for cleanup purposes. #### Navigate to Flows from Connectors You can now open the target flow referenced by a connector, using the **Go to Flow** option in the context menu for application flows and MUnit test flows to trace and manage application logic across modular flows. #### Review Scaffolding Errors in Output Panel Now it’s even easier to troubleshoot errors when creating a project. In the Output panel, there’s a new **MuleDX Server - Scaffolding** option. Select that option to show the MuleDX Server log content that’s related to scaffolding only. ![Output panel with Mule DX Server: Scaffolding selected](/mulesoft/current/en-us/release-notes/_images/code-builder/scaffolding.png) For more information, see [Viewing Logs and Errors](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel). #### Open Projects in Canvas by Default Anypoint Code Builder now opens projects in the canvas by default. You can save and debug your applications directly from the UI without switching views, streamlining your low-code experience. #### Enter Properties as Values in Fields in UI Property mode `{}` now makes it possible to enter properties in number and boolean fields in the UI. Previously, it was possible only in the code editor. ![Create parent directories field with Property mode enabled](/mulesoft/current/en-us/release-notes/_images/code-builder/bracket.png) #### Check Java and Mule Runtime Compatibility for All Connectors in Your Project Verify that your local and Anypoint Exchange connectors are compatible with your Java and Mule runtime version for your projects. Project Properties now tells you about incompatible versions and lets you fix them right away, accelerating development and reducing blockers, especially when importing projects. Previously, Project Properties verified compatibility of Anypoint Exchange connectors only. For more information, see [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). #### Use Anypoint Code Builder with Windows 11 Anypoint Code Builder Desktop IDE now supports Windows 11. For more information, see [Compatibility](#compatibility). #### Agentforce Command Removed The **MuleSoft: Open Agentforce** command is removed from the Command Palette. You can use the toolbar button to access the Agentforce panel when available. ### Fixed Issues
Issue ResolutionID

When you define a DataWeave multiline expression, code highlighting now works as expected.

W-11492623

## May 27, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.8.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.8.3 This cloud IDE version runs the 1.8.2 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New - Authentication support for Cursor, Trae, and Windsurf. - Support for Mule runtime engine version 4.9.4 LTS with Java version 17. See [Compatibility](#compatibility). ## April 29, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.8.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.8.3 This cloud IDE version runs the 1.8.1 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces support for Anypoint Connector for MCP (MCP Connector) (beta). MCP Connector (beta) helps you expose your Mule application as a tool that any AI client supporting Model Context Protocol (MCP) can use to perform real-world actions. For example, your MCP client can trigger a process, look up data, or transform records. See [Built-In Connectors](https://docs.mulesoft.com/anypoint-code-builder/ref-connectors). _MCP Connector is a beta connector that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/agreements/) or a written Unified Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms in the [Product Terms Directory](https://ptd.salesforce.com/?_ga=2.247987783.1372150065.1709219475-629000709.1639001992). Use of this beta connector with external systems or services consumes Mule messages and is at the Customer’s sole discretion._ ## March 21, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.8.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.8.0 This cloud IDE version runs the 1.8.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - New DataWeave Transformation Builder Tool. Transform your message payload, attributes, and variables to the required output format and data structure with DataWeave Transformation Builder. See [Open Transformation Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#open-transformation-builder). - Refine your flows through natural language interactions. Anypoint Code Builder dynamically updates your flow code based on your latest instructions, ensuring an easy and efficient workflow. Plus, access your chat history to track changes. - Validate and publish your API project to Anypoint Exchange through a new intuitive user interface. See [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). - Build Agentforce integrations using Agentforce Connector 1.0.1 and Einstein AI Connector 1.1.1. See [Built-In Connectors](https://docs.mulesoft.com/anypoint-code-builder/ref-connectors). - Agentforce for Anypoint Code Builder Generative Flows is now available on these Anypoint Platform control plane regions : [Canada Cloud](https://ca1.platform.mulesoft.com) and [Japan Cloud](https://jp1.platform.mulesoft.com). - New documentation to help you migrate your Anypoint Studio Mule projects to Anypoint Code Builder. Learn how to import your Mule projects into Anypoint Code Builder to unlock a modern development experience with faster startup times, streamlined collaboration, and the integration of MuleSoft for Agentforce: Topic Center to enable API projects for topics and agents. See [Migrate Your Mule Project from Anypoint Studio to Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-migrate-studio-to-acb). - The Einstein generative flow feature is now called the Agentforce generative flow feature. ### Fixed Issues
Issue ResolutionID

DataSense now works as expected when a tag spans multiple lines.

W-12482310

DataSense now works as expected when you create a project with Mule runtime version 4.4 and no other runtime versions are downloaded.

W-16117373

## February 6, 2025 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the Cloud IDE. - Extension pack version: 1.7.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.7.1 This cloud IDE version runs the 1.7.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - Support for [MuleSoft for Agentforce: Topic Center](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center). - Use the visual editor when you design an API to enable your API specifications for topics and agents. - Make your topic and action-enabled APIs available in Salesforce using Salesforce API Catalog. - Augment agent functionality by assigning topics to Agentforce agents in Agent Builder. - Use the provided governance rules to validate that your API is ready to generate agent actions and topics in Salesforce. - Run MUnit tests from the canvas. See [Testing Projects with MUnit](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit#run-tests-from-the-canvas). - Configure proxy settings. See [Using a Proxy in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/ref-proxy-settings). - Streamline productivity with performance enhancements for DataSense, flow canvas rendering, and connector configuration testing. - Support for Mule runtime engine version 4.9 LTS with Java version 17. See [Compatibility](#compatibility). ### Fixed Issues
Issue ResolutionID

A notification now appears after you change the region in the settings.json file.

W-13184670

XML formatting is no longer corrupted when you add or update a connection configuration, or when you use the Format Document menu option.

W-16850099

Avro suggestions now appear when you define an Avro schema and declare a record inside a record property.

W-16814386

Correct suggestions now display for inline Avro schema payloads. The issue occurred inside maps that contained arrays.

W-16809972

Correct suggestions now display for values in fields of type map.

W-16814887

Syntax errors in DataWeave expressions in projects imported from Studio no longer occur. Anypoint Code Builder now automatically fetches the required dependencies when the project loads.

W-14037343

When you use a proxy, the Mule runtime options now appear in the UI form for creating a new integration project. You can click Create Project to create the project.

None

## December 9, 2024 Anypoint Code Builder releases a new feature in the Anypoint Extension Pack. - Extension pack version: 1.6.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New - This product is now available on Hyperforce. Anypoint Platform instances on the Hyperforce infrastructure are: - [Canada Cloud](https://ca1.platform.mulesoft.com) - [Japan Cloud](https://jp1.platform.mulesoft.com) Exceptions: - Einstein for Anypoint Code Builder Generative Flows is available only on US and EU cloud hosts. Canada and Japan cloud hosts are currently not supported. - Cloud IDE is available only on US and EU cloud hosts. Canada and Japan cloud hosts are currently not supported. - “Design Center” UI labels are renamed to “MuleSoft VCS”. ### Fixed Issues
Issue ResolutionID

Anypoint Connector for Zoom (Zoom Connector) component configuration view now correctly displays relevant options.

W-17148078

Adding a transform connector no longer incorrectly inserts #[] in script fields.

Previous: <![CDATA[#["test"]]]>

New: <![CDATA["test"]]>

W-17199037

## November 4, 2024 Anypoint Code Builder releases a new feature in the Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.5.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.5.0 This cloud IDE version runs the 1.5.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New The release introduces the following feature: - The Einstein for Anypoint Code Builder Generative Flows feature is now enabled and managed in Anypoint Platform Access Management. For more information, see [Enabling Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). ### Fixed Issues
Issue ResolutionID

JMS Connector connections can now be validated with the Test Connection button.

W-16983063

## October 8, 2024 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.4.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.4.6 This cloud IDE version runs the 1.4.1 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New This release introduces these features: - [Advanced Data Types](#data-types-advanced) - [Connection Configurations from the UI](#connection-configurations) - [Code Coverage Reports](#code-coverage-munit) - [Deploy to CloudHub 2.0](#cloudhub-2-deployments) - [Publish Mule Projects to Anypoint Exchange](#app-publish-exchange) - [AsyncAPI Specification Design and Governance](#asyncapi-design) - [AsyncAPI Support for Avro Schema Fragments](#asyncapi-avro) - [AsyncAPI Implementation Support for Solace PubSub+ and Salesforce Platform Events Connectors](#solace-platform-support) - [Support for Mule Version 4.8](#runtime-version-support) - [Enhanced API Auto-Completion](#api-autocompletion) - [API Autodiscovery](#api-autodiscovery) - [Enhanced Debugging](#visual-debugger) - [Custom Connector Support](#custom-connector-support) #### Advanced Data Types The connection configuration panel in the canvas UI adds support for configuring connections, objects, arrays of non-primitive types, and multi-level dynamic lists. In the previous release, the configuration panel supported unions, arrays of primitive types, file selectors, and password fields. For more information, see [Adding a Component to Your Project](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components-add). #### Connection Configurations from the UI Connection configurations are global configurations that more than one component in a project can use. Anypoint Code Builder improves workflow by enabling you to check for components that use the connection through the UI. For more information, see [Adding a Component to Your Project](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components-add). #### Code Coverage Reports Anypoint Code Builder adds code coverage reports for testing integration and implementation projects with MUnit. For more information, see [Running MUnit Tests with Coverage](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit#run-coverage). Additionally, you can now run MUnit tests in Anypoint Code Builder without setting your credentials in Maven. #### Deploy to CloudHub 2.0 In addition to supporting deployments of your integrations to CloudHub, Anypoint Code Builder adds support for deployments to CloudHub 2.0. For more information, see [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps). #### Publish Mule Projects to Anypoint Exchange Anypoint Code Builder adds functionality for publishing project templates and project examples to Anypoint Exchange. Publishing to Exchange enables your team to reuse your applications. For more information, see [Publishing a Mule Project to Exchange](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project#publishable). #### AsyncAPI Specification Design and Governance Anypoint Code Builder now supports creating, designing, and governing AsyncAPI 2.6 specifications. For more information, see: - [Creating and Importing AsyncAPI API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-asyncapi-api-specs) - [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api) #### AsyncAPI Support for Avro Schema Fragments Anypoint Code Builder adds support for creating and designing Apache Avro schema fragments. Ensure data consistency and interoperability in distributed systems by defining Avro schemas with structured data, including data types and fields. For more information, see [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) #### AsyncAPI Implementation Support for Solace PubSub+ and Salesforce Platform Events Connectors Anypoint Code Builder adds support for Solace PubSub+ and Salesforce platform events connectors. Expand your integration capabilities and streamline event-driven architectures. For more information, see [Supported Message Brokers](https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-module-reference#supported-message-brokers). Implementing AsyncAPI specifications using DataSense for Avro schemas requires Mule 4.8 or later. #### Support for Mule Version 4.8 Anypoint Code Builder adds support for Mule version 4.8 with Java versions 11 and 17. For more information, see [Mule and Java version support](#versions-mule-jdk). #### Enhanced API Auto-Completion Anypoint Code Builder introduces enhanced API auto-completion. Instead of typing Ctrl+Space to activate the auto-completion menu in your API spec, you can place your cursor at the location in your API spec file where you require suggestions. If the line has some content, press Tab, press Space, or start typing after the content on the line to launch the menu. To close the auto-completion menu, press Escape. - [Mule > Editor > Auto-completion: Enablement](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-auto-complete) This setting is disabled by default. - [Mule > Editor > Auto-completion: Trigger Delay](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-auto-complete) For more information on using auto-complete, see [Use Auto-Complete in the Editors](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete). #### API Autodiscovery Anypoint Code Builder supports configuring Mule apps for tracking requests with Autodiscovery. Configure a Mule app to send request data to an API running on a Mule Gateway runtime in API Manager. The API tracks this data in charts in API Manager. For more information, see [Tracking Requests with Autodiscovery](https://docs.mulesoft.com/anypoint-code-builder/int-autodiscovery-config). #### Enhanced Debugging Anypoint Code Builder adds breakpoint indicators in the canvas UI for components that have one or more breakpoints in the configuration XML. Indicators also display when stepping through a flow while debugging. Additionally, you can add and remove breakpoints on components in the canvas UI. For more information, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). #### Custom Connector Support Anypoint Code Builder now supports custom connectors that are locally bundled or published to Exchange. For locally bundled connectors, add the dependency to your integration project by referencing the Maven dependency in your `pom.xml` file. For connectors published to Exchange, add the component from the **Add Component** panel using the **Search in Exchange** toggle. ### Fixed Issues
Issue ResolutionID

The Governance Rulesets and Governance Results panels now update as expected when more than one project folder is open in a VS Code workspace.

W-15677742

After iteratively scaffolding an API spec into an implementation project, the Data and Functions tabs in the expression builder no longer display the "loading" animation.

W-15828343

## August 17, 2024 Anypoint Code Builder releases a new feature in the Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.3.0 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.3.0 This cloud IDE version runs the 1.3.0 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ### What’s New The release introduces the following feature: - You can now use the Einstein for Anypoint Code Builder Generative Flows feature to jumpstart your integration development by generating flows for you. For more information about this feature, see [Developing Integrations Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/int-ai-developing-integrations). ### Fixed Issues
Issue ResolutionID

The Governance Rulesets and Governance Results now update as expected when more than one folder is open in a VS Code workspace.

W-15677742

The Preview tab in the expression builder UI no longer produces an Internal Error message when you configure an attribute of a component’s child element in the XML editor and that attribute accepts DataWeave expressions. This issue affected all components with child attributes that accept expressions. The following example displays a child element with an attribute that contains a DataWeave expression:

Attribute with an expression in nested element of a component

W-15906886

## July 2, 2024 This patch release addresses Anypoint Code Builder issues. ### Fixed Issues
Issue ResolutionID

You no longer have to update the runtime version when deploying a Mule application with Mule runtime version 4.6 or 4.7. This issue occurred when deploying to CloudHub from the IDE.

W-15902597

A tooling client error no longer appears after creating a Java class, adding a New operation from the Java Module to a flow, selecting the class, and then refreshing Constructor.

W-15877062

The XML now reflects changes after configuring the Send operation of Anypoint Connector for Email (Email Connector) from the component configuration panel.

W-15906937

After changing the class setting in the Class field, you no longer have to refresh the Method field before selecting from the list of methods in the class. This issue occurred when updating the Invoke, Invoke Static, or New operations from the Java Module in the configuration panel.

W-15111695

To import DataWeave libraries when using functions outside of the Core library, you no longer have to use the Quick Fix option. The DataWeave libraries are now imported automatically.

W-15673127

The feedback button for the open beta of AsyncAPI support to implement event-driven architecture now consistently appears in the canvas.

W-16084084

Patching the desktop IDE extensions requires a manual update or installation of the Anypoint Extension Pack. The cloud IDE is updated automatically. - Extension pack version: 1.2.2 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.2.4 This cloud IDE version runs the 1.2.2 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## June 24, 2024 AsyncAPI Beta: AsyncAPI 2.6 and 2.0 implementation features are now available for use in Anypoint Code Builder. The minimum Mule runtime engine requirement for this feature is Mule 4.6. Before you can use these features, your Anypoint Platform organization administrator must accept the Beta terms and conditions from the Anypoint Code Builder landing page in Anypoint Platform. For guidance, see [Implementing AsyncAPI Specifications](https://docs.mulesoft.com/anypoint-code-builder/imp-asyncapi). Anypoint Extension Pack has not changed since the [June 4, 2024 release](#jun-2024). If you installed or upgraded your extensions on the desktop IDE in that release, no installation or upgrade is required. The cloud IDE was updated automatically in that release. To learn about the AsyncAPI journey, see [AsyncAPI Support to Implement Event-Driven Architecture](https://docs.mulesoft.com/release-notes/platform/event-driven-api). For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## June 4, 2024 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.2.1 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.2.1 This cloud IDE version runs the 1.2.1 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. ### What’s New The release introduces the following features: - [DataWeave Expression Builder](#dw-expression-builder) - [Component Configuration Enhancements](#component-config-ui) - [Support for Multiple Mule Runtime Versions with Java 17 or 11](#multiruntime) - [Custom Java Classes and Code](#java-custom) - [Maven Settings](#maven) - [MUnit Support](#munit) - [API Governance for REST APIs](#governance) For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). #### DataWeave Expression Builder Use the DataWeave expression builder when configuring your integrations and implementations from the UI. DataWeave is a programming language designed for transforming data. Most components in Mule application flows use DataWeave expressions to select and transform messages (payload and attributes) or Mule variables. The DataWeave expression builder helps you configure fields of components that accept expressions (**fx** fields). For each expression field, the feature provides an extra panel with the following tabs: - **Data** for selecting a value (payload, attributes, or a Mule variables) - **Functions** for selecting DataWeave functions to use in your expressions Function documentation is available from this tab by mousing over a function and getting details, including parameter descriptions and examples. - **Preview** for running the expression on sample data In addition, you can use autocomplete from an expression (**fx**) field for a component to select DataWeave functions from the Core module and other values accepted in this field. For details, see [Using DataWeave Expressions and Transformations in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions). For more information about DataWeave and the Mule event structure, see [DataWeave Overview](https://docs.mulesoft.com/dataweave/latest/) and [Mule Event Structure](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event). #### Component Configuration Enhancements Configure more of your integrations and implementations from the canvas UI. The configuration panel for components adds: - An **Input/Output** tab to existing tabs (**General**, **Advanced**, and **Notes**) for Mule event metadata from the payload, attributes, Mule variables - Support for additional data types in the configuration fields: - File selectors - Passwords - Array (primitive types only) - Union for some configurable data sets For examples, see [Using DataWeave Expressions and Transformations in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions). #### Support for Multiple Mule Runtime Versions with Java 17 or 11 Anypoint Code Builder now supports Mule runtime versions 4.4, 4.6, and 4.7 and compatible Java versions (Java 11 or Java 17) to run Mule apps for your implementation and integration projects (see [supported Mule and Java versions](#versions-mule-jdk)). In addition, when you create an integration project from a template or example project in Anypoint Exchange, the asset search displays assets set to use Mule 4.4 or higher, instead of 4.4 only. Select the versions to run when creating or importing Mule applications in Anypoint Code Builder and when scaffolding an API specification into an implementation project. The following settings are new in this release: - **Mule > Application: Default Mule Runtime And Java Versions**: Sets default Mule and Java versions for all projects. - **Project Properties** tabs for setting and changing Mule runtime, Java, and connector versions in an implementation or integration project. This feature is useful for updating to the latest minor version or when importing projects that use unsupported versions. - **Mule: Home Directory**: Set the home directory for Mule runtime and Java downloads. This setting replaces the runtime settings **Mule > Runtime: Mule Home** and **Mule > Runtime: Mule Runtimes Directory**, which are no longer present in the **Settings** tab. In addition, the IDE no longer uses the directory `${user.home}/muleRuntimes/` to store Mule runtime versions. Anypoint Code Builder - Mule Runtime Extension (`salesforce.mule-dx-mule-runtime`) is removed from Anypoint Extension Pack in this release. Instead of supplying a bundled runtime, the IDE provides an interface for downloading and installing runtime versions to use in your projects. To remove the runtime extension from VS Code, open the **Extensions** panel, click **Anypoint Code Builder - Mule Runtime Extension**, and select **Uninstall**. See [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions) for project and default version settings. #### Custom Java Classes and Code The Java module is now bundled into Anypoint Code Builder. When you create a new Java class in a project, Anypoint Code Builder automatically adds the necessary dependencies to the project’s `pom.xml` and the namespace and schema locations to the configuration XML for the project. New integration and implementation projects now add the directories `src/main/java` and `/src/test/java` for your custom Java work. For documentation, see [Configure the Java Module Using Anypoint Code Builder](https://docs.mulesoft.com/java-module/latest/configure-java-module-acb). To use auto-complete from the application XML to find module configuration options and to display lists of available Java classes and methods in a selected class, install [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) from Microsoft to the IDE. #### Maven Settings To avoid changing any of your preferred Maven settings in `settings.xml`, Anypoint Code Builder now creates a separate settings file, `acb_settings.xml`. The setting **Mule: Home Directory**, in the **Settings** tab, configures the location of this file. By default, the full path to the file is `{user.home}/AnypointCodeBuilder/maven/acb_settings.xml`. For details, see [Maven Settings in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-maven). #### MUnit Support Anypoint Code Builder introduces limited support for testing with MUnit. Run, modify, and create MUnit tests for your implementation and integration projects in Anypoint Code Builder. Import projects that contain MUnit test files. Test configuration is supported through the XML editor only at this time. For more information, see [Testing Projects with MUnit](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit). Some MUnit features supported by Anypoint Studio are not supported by Anypoint Code Builder in this release. #### API Governance for REST APIs Anypoint Code Builder now supports API Governance for REST APIs: - Check conformance status of a project. - Add rulesets to your project. You can also remove rulesets, change ruleset versions, and review ruleset configurations. - Run and re-run validations against your API specifications. For supported specifications, see [Compatibility](#compatibility). - Monitor the progress of a validation. - Fix conformance issues. See [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ## April 19, 2024 Anypoint Code Builder updates the built-in Mule runtime engine to patch version `4.4.0-20240408`. The Mule version is updated automatically in the cloud IDE but requires a manual update or installation of the Anypoint Extension Pack in the desktop IDE. - Extension pack version: 1.0.8 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.1.4 This cloud IDE version runs the 1.0.8 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## February 14, 2024 Anypoint Code Builder releases new features in the Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.0.7 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.1.3 This cloud IDE version runs the 1.0.7 extension pack. For extension versions, see [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog) in the VS Code Marketplace. ### What’s New The release introduces the following features: - [Component Configuration Panel in the UI](#component-ui) - [Integration Project Creation from Templates and Examples](#project-import) - [API Design Project Improvements](#api-design-change) - [Configuration XML File Creation Enhancement](#config-xml-creation) #### Component Configuration Panel in the UI Anypoint Code Builder introduces a configuration panel in the UI for components, such as connector operations, within integration and implementation projects. This feature simplifies component configuration. The component configuration panel provides configuration options that are also available through the configuration XML files for your projects. Some components and fields continue to require configuration through the XML in this release. Continue to use XML for complex fields, identified as read-only fields in the UI, and for global configurations, such as connection configurations. You can open the configuration panel from the canvas or from a configuration XML file within your project. See [Add a Component to Your Project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#add-components) and [Open a Component in the Canvas from the XML Editors](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#open-component-from-xml). #### Integration Project Creation from Templates and Examples Anypoint Code Builder adds the ability to import a template or example from Anypoint Exchange into an integration project within Anypoint Code Builder. After importing, you can continue to develop your integration. For information about templates and examples in Exchange, see [Asset Types](https://docs.mulesoft.com/exchange/asset-types). For guidance with importing from Exchange, click the tab **Start with a Project Template or Example** in the procedure [Create an Integration Project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#anchor-for-rns). #### API Design Project Improvements This release introduces improvements and simplifications to the design process: - Import API design projects from Design Center into Anypoint Code Builder. For details, see [Import an API Specification from Design Center](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#import-spec). - Publish your API specifications and fragments to Anypoint Exchange without first syncing your code changes with the Anypoint source control management (SCM) system. Creating an API design project from scratch in Anypoint Code Builder no longer spawns a corresponding design project in Design Center or creates a connection to the Anypoint SCM. For details, see [Source Control for API Design Projects](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs#anypoint-scm). - Set a business group for your API design project when you publish to Exchange instead of when you create the design project. For example, see the steps in [Publish an API Spec to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange#publish-spec). #### Configuration XML File Creation Enhancement Anypoint Code Builder enables you to create one or more additional configuration XML files from within your integration or implementation projects. This feature is useful for adding an implementation for an interface. The feature also enables you to split complex project code into more manageable pieces. For more information, see [Create an Additional Configuration XML File](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#create-new-config). For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## December 6, 2023 Anypoint Code Builder releases a patch to Anypoint Extension Pack and the cloud IDE. - Extension pack version: 1.0.6 To use this extension pack in the desktop IDE, see [Set up the Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - Cloud IDE version: 1.0.3 This cloud IDE version runs on the 1.0.6 extension pack. The patch addresses the following issues:
DescriptionIssue

When you open the IDE, the exception dw-lang-server-language-0" java.lang.NoClassDefFoundError: org/jboss/shrinkwrap/resolver/api/maven/Maven in the Mule DX Server logs no longer occurs because of an open workspace that contains a non-Mule project, such as an API spec project or other folders or files.

W-14268344

The issue java.io.FileNotFoundException no longer occurs due to attempted parsing of files that do not exist.

W-14254505

After scaffolding an API spec into an interface within an implementation project, the IDE no longer produces the syntax validation issue Configuration type reference is not compatible (INVALID_CONFIG_REFERENCE) within the configuration XML for config-ref attribute-value pairs. Previously affected components include <http:listener/>, <apikit:router/>, and <apikit:console/>.

W-14243529

A test connection no longer fails with the error 'Invalid Connection ElementDeclaration is declaring an extension: 'HTTP' that is not part of the session: '[]' after you copy and paste an HTTP Listener configuration (<http:listener-config/>) into a new project.

W-14252415

For more information, see [Known Issues](#known-issues) and [Compatibility](#compatibility). ## October 19, 2023 Anypoint Code Builder releases a patch to the cloud IDE: - 1.0.2 (Cloud IDE): The cloud IDE removes the proxy for security purposes. URLs that trigger flows in the cloud IDE through the proxy no longer work. To trigger locally hosted flows that use an HTTP listener, see [Triggering Flows in Your Development Environment](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows). There are no changes to the desktop IDE, which remains version 1.0.5. ## October 16, 2023 Anypoint Code Builder releases these versions: - 1.0.5 (Desktop IDE): Anypoint Code Builder for Desktop (desktop IDE) is generally available (GA) in this release. - 1.0.1 (Cloud IDE): The cloud IDE for Anypoint Code Builder remains in open beta: > [!IMPORTANT] Any use of an Anypoint Code Builder IDE in its beta state is subject to the > applicable beta services terms and conditions, available from the cloud IDE. The desktop IDE version 1.0.5 and cloud IDE version 1.0.1 both run on the same versions of the Anypoint Code Builder extensions, described in [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog), and provide the same features. To set up and gain access to the IDEs, see [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). ### What’s New This release introduces: - Anypoint Extension Pack version 1.0.5 for the desktop IDE on [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=salesforce.mule-dx-extension-pack) - API fragment support for JSON Schema See [Supported Specification Languages for API Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs#supported-fragment-languages). ## Open Beta Prior to the Oct 16, 2023 release, MuleSoft released these open beta versions of Anypoint Code Builder: - [September 2023 (Open Beta)](#sept-2023) - [August 2023 (Open Beta)](#aug-2023) - [June 2023 (Open Beta)](#june-2023) - [April 24, 2023 (Open Beta)](#april-24-2023) - [April 2023 (Open Beta)](#april-2023) ### September 2023 (Open Beta) This update to the open beta introduces Anypoint Code Builder for Desktop on Windows and new features for desktop and cloud IDEs. - Windows support on the desktop IDE. See [Compatibility](#compatibility). - Hot deployments are supported for debugging Mule applications. See [Hot Deploy When Debugging](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#hot-deploy). - New export commands for packaging Mule applications within shareable and deployable JAR files. See [Exporting Mule Projects](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project). ### August 2023 (Open Beta) This update to the open beta introduces Anypoint Code Builder for Desktop on MacOS and a new feature for desktop and cloud IDEs. - Anypoint Extension Pack on [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=salesforce.mule-dx-extension-pack) to support API specification design (OAS 3 and RAML), API implementation, and integration development Install the _pre-release\_version. Attempting to install the \_release_ version produces an error. - Support for the Mac operating system running on Intel or ARM processors (see [Compatibility](#compatibility)) - Desktop and cloud IDE support for the following features: - Secure configuration properties in your integrations and API implementations (see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs)) - Improvements to avoid reloading the IDE when unpacking the runtime for the first time ### June 2023 (Open Beta) The update to the open beta for the web-based IDE introduces these features and improvements: - Support for EU Cloud: EU Cloud users of Anypoint Platform can now use Anypoint Code Builder from their management plane. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. - Synchronization between a local API specification and Mule project: You can now work on your API specification and its Mule project implementation simultaneously. Anypoint Code Builder enables you to scaffold your API specification into a Mule project without publishing it to Exchange. You can work on your Mule project, then edit the API specification, and re-scaffold it to reflect your new changes. Both API design and API implementation tasks are now synchronized. You can then publish your API specification and deploy your Mule project from there. See [Iteratively Design and Implement an API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-local-api-specification) for more information. - Updated UI canvas and code snippet support: - Directly import connectors from the canvas instead of using the dedicated command. - Use code snippets. See [Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components) for more information. ### April 24, 2023 (Open Beta) The update to the open beta for the cloud IDE introduces a number of features and improvements: - Anypoint Code Builder migrated to a new underlying architecture. - The URL for your cloud IDE instance changed. You can get the new URL by launching the cloud IDE from the central page or checking the IDE details. - Your session cookie changed, so you must update it when [pinging a locally deployed application](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows) from a REST client. ### April 2023 (Open Beta) The update to the open beta for the cloud IDE introduces these features and improvements: - Business group support enables you to control access to resources when working with assets from Anypoint Exchange. - Search filters enable you to refine your search results when looking for an API asset from Anypoint Exchange. See [Filtering Search Results](https://docs.mulesoft.com/anypoint-code-builder/imp-filter-search-results) for more information. - The canvas UI enables you to add components to flows in your integration. ## Compatibility
Application/ServiceVersion

Anypoint Platform

US Cloud, EU Cloud, and these Anypoint Platform control plane regions: Australia Cloud, Canada Cloud, Japan Cloud, and United Kingdom Cloud. Anypoint Code Builder also connects to Anypoint Platform Private Cloud Edition (PCE). (Not supported by MuleSoft Government Cloud)

API Governance

Validations for REST API and AsyncAPI specs

CloudHub

1.0 and 2.0 (for deployments to the Sandbox environment)

DataWeave

Bundled with Mule runtime engine (built-in)

Java

Multiple versions supported. See supported Mule and Java versions.

Maven

3.9.4 (built-in)

Mule runtime engine

Multiple versions supported. See supported Mule and Java versions.

Operating system

Windows 11, Windows 10, macOS Intel and ARM (M1 or M2)

Visual Studio Code

Minimum version: 1.99.3
Tested versions:

  • 1.99.3 or later (macOS)

  • 1.99.3 or later (Windows)

Web browser

Browser Support for Anypoint Platform

In Anypoint Code Builder, Mule applications for your implementation and integration projects are compatible with the following Mule runtime engine (Mule) and Java versions: Supported Mule and Java versions:
Mule runtime versionJava version

Mule 4.13.x Edge

Java 17

Mule 4.12.x Edge

Java 17

Mule 4.11.x Edge

Java 17

Mule 4.10.x Edge

Java 17

Mule 4.9.x LTS

Java 17

Mule 4.8 Edge

Java 11, Java 17

Mule 4.6.x LTS

Java 11, Java 17

Mule 4.4

Java 11

Minor and major version changes to Mule require a manual update to your projects. Periodic Mule patch updates (such as from Mule 4.8.2 to 4.8.3) to Mule versions already downloaded to your IDE occur automatically when you log in to Anypoint Platform from the IDE. > [!IMPORTANT] Starting May 18, 2026, publishing connectors and Mule plugins to Exchange requires > `mule-extension-plugin` 1.9.0 or later. Update your plugin version before publishing new connector > versions. ## Known Issues For new known issues and workarounds for the February 6, 2025 release and later, see [Salesforce Known Issues](https://help.salesforce.com/s/issues). These known issues and workarounds from the December 9, 2024 release still apply to this release:
LimitationID

When the Anypoint Code Builder launches for the first time, a corrupted dependency (.m2\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.pom) can block the Anypoint Code Builder - Integration Extension when extracting the Mule runtime operation.

Workaround: Delete the dependency from .m2\repository\net\minidev\accessors-smart, and re-launch the IDE.

W-14047707

Previously configured sample data is overridden when selecting a component in the canvas UI.

W-16270847

There is no command to delete dependencies related to assets that you import from Exchange to an API design project.

Workaround: Remove the dependency from the dependencies node in the exchange.json file.

W-13822075

Moving the editors while searching for components from the UI canvas causes your search to be canceled.

Workaround:
Avoid rearranging your editors when using the component palette in the canvas.

W-13172200

Using autocompletion to create a parameter for the value field in the XML adds an extra #[] statement.

W-12444650

Autocompletion does not work properly when more than one connector has the same prefix.

W-10667510

Anypoint Connector for Apache Kafka (Apache Kafka Connector) does not display the Test Connection option.

W-12553536

DataSense doesn’t identify functions provided by a connector.

W-12448776

DataSense doesn’t reflect array structures at the payload’s root level.

W-12263085

DataWeave doesn’t recognize the larger context to which samples belong. So DataWeave requests sample data for all scripts within a single component.

None

DataWeave validations to produce Invalid input errors on some multiline scripts because Anypoint Code Builder does not decode Unicode characters for new lines in XML (&#10;). This limitation does not interrupt the correct execution of your Mule application.

W-11750473

Updates to metadata in one component don’t trigger metadata validation in subsequent components. This issue causes Anypoint Code Builder to display potential issues in the subsequent components.

W-12215165

The Batch Job processor is not supported by the UI canvas or through auto-complete in the configuration XML.

None

When scaffolding a GraphQL or AsyncAPI specification on Windows, an empty Mule configuration file with the name of the project is created in addition to the flows.xml file.

Workaround: Delete the empty file.

W-15757808

When source validation is enabled, AsyncAPI messages are invalid if mediaType doesn’t match the specification.

W-16663560

When source validation is disabled, AsyncAPI messages are sent downstream without transforming mediaType.

W-16663585

Source validation is not working with the Salesforce platform events application/xml content type.

W-16756836

## See Also - [CloudHub](https://docs.mulesoft.com/cloudhub/) - [Salesforce Help](https://help.salesforce.com) - [MuleSoft Services](https://www.mulesoft.com/support-and-services) - [Product Versioning and Back Support Policy](https://www.mulesoft.com/legal/versioning-back-support-policy) - [Troubleshooting](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Async () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Group components in a scope and execute them simultaneously with the main flow in an asynchronous fashion. The main flow of the application continues to execute after it initiates and processes the Async scope. The flow does not have to pause until the last message processor embedded in the asynchronous flow has completed its task. Async is useful for executing time-consuming operations that do not require you to send a response back to the initiating flow (such as printing a file or connecting to a mail server). To facilitate simultaneous branch processing, the Async scope sends one copy of the message it has received to the first embedded message processor in its own processing block. At the same time, it sends another copy of the message to the next message processor in the main flow. Because the Async scope is executed in a "fire and forget" manner, the result of the processing within the scope is not available in the main flow. ## Component XML This component supports the following XML structure: ```xml ``` Async (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Async (default)

doc:name

Editable name that appears in the configuration XML file only.

Name or Display Name

name

Editable name for the component that appears in the canvas.

Max concurrency

maxConcurrency

Sets the maximum number of concurrent messages that the scope can process. By default, the container thread pool determines the maximum number of threads to use to optimize the performance when processing messages. When the scope is processing the maximum number of concurrent messages, it cannot receive additional requests.

Set maxConcurrency to 1 to cause the scope to process requests one at a time.

See Back-Pressure Management for details about Mule behavior after reaching the maximum concurrency value.

## Async Scopes versus Subflows Unlike a subflow, an Async scope: - Does not inherit the exception strategy of the main flow. To handle errors in an Async scope, use the Try scope. - Processes messages asynchronously. - Does not pass data back to the main flow. - Exists inline with the main flow thread. - Is not called by a Flow Reference component. - Is not reusable Even though the Async scope receives a copy of the Mule message, the payload is not copied. The same payload objects are referenced by both Mule messages: One that continues down the original flow, and the one processed by the Async scope. If the payload of your message is a mutable object (for example, a bean with different fields in it) and a message processor in your Async scope changes the value of one of the fields, the message processors outside of the Async scope see the changed values. ## Example Async Scope Configuration The following XML fragment shows an example configuration of an Async scope inside an application flow. The Async scope contains a `file:read` operation that executes asynchronously once triggered, while the application continues processing the next operation in the flow, `http:request`. ```xml ... ``` ## See Also - [How Transactions Affect Scopes and Routers](https://docs.mulesoft.com/mule-runtime/latest/transaction-management#tx_scopes_routers) - [Back-Pressure and MaxConcurrency](https://docs.mulesoft.com/mule-runtime/latest/tuning-backpressure-maxconcurrency) --- product: Anypoint Code Builder version: master --- # Authentication Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Authentication errors sometimes occur when you attempt to perform actions that require a connection to Anypoint Platform or to services that Anypoint Code Builder relies on. ## Failed to Authenticate to Git All commands that involve `git` actions, such as publishing to Exchange and committing changes to an API specification, require authentication with the correct Anypoint Platform host cloud. If authentication fails, the action throws this VS Code error: Failed to authenticate to git remote To address this issue, cancel the error notification, and ensure that Anypoint Code Builder is set to the correct region for your project and that you are logged in to Anypoint Platform. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Batch Job () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Defines the main batch processing scope. A batch job contains two phases: - **Process Records**: Executes the record processing logic defined in nus. - **On Complete**: Executes after all records are processed, for example to log results or perform cleanup. ## Configuration Options
PropertyTypeDefaultDescription

doc:name

String

Auto-generated

Display name for the component in the canvas

doc:id

String

Auto-generated

Unique identifier for the component

batchBlockSize

Integer

50

Number of records per block to process concurrently within the Process Records phase

## Child Elements and Scopes - One or more [Batch Steps](#batch-step) inside the job - One optional **On Complete** scope ## Batch Processing Constraints - Batch jobs can’t be nested. - At least one [Batch Step](#batch-step) must be present. ## Batch Processing Example ## Batch Step (batch:step/) Defines a step inside a batch job. Steps group record-level processors and can optionally include a batch aggregator. ### Batch Processing Configuration Options
PropertyTypeDefaultDescription

doc:name

String

Auto-generated

Display name in the canvas

doc:id

String

Auto-generated

Unique identifier for the component

## Child Elements and Sub-Scopes **Processors**: A sequence of processors (for example, **Transform**, **Logger**) that act on each record. **Batch Aggregator**: Aggregates records into blocks (optional). ## Batch Aggregator Constraints Only one Batch Aggregator is allowed per step. ## Batch Aggregator (batch:aggregator/) Aggregates records into blocks within a [Batch Step](#batch-step) for grouped processing before records are sent back into the flow. ## Batch Aggregator Configuration Options
PropertyTypeDefaultDescription

doc:name

String

Auto-generated

Display name in the UI

doc:id

String

Auto-generated

Unique identifier for the component

aggregatorSize

Integer

100

Number of records to group before applying aggregation logic

## Batch Step Behavior Groups incoming records into blocks of the specified size. After processing, the records are sent back to the Process Records phase of the Batch Job. ## See Also [Core Components Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-components) [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) --- product: Anypoint Code Builder version: master --- # Build an API from Start to Finish with Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Take an end-to-end, API-led journey in MuleSoft: design a REST API specification, implement it as an integration, debug and test your application, deploy it, and then manage and monitor it in production. This tutorial walks you through that full lifecycle using a single-resource API, the American Flights API, that returns flight information from a MySQL database. After you complete the tutorial with this single-resource API, use the same model to plan your own connectivity projects. This tutorial series contains the following parts: 1. [Design and Publish the American Flights API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-design-api) Design the American Flights API specification, test it with the built-in mocking service, and publish it to Anypoint Exchange. 2. [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api) Scaffold the specification into an integration project and connect to a MySQL database. 3. [Validate Input Parameters and Transform Flight Data](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-validate-transform-data) Add business logic validation and transform database records to meet the API contract. 4. [Debug the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-debug-api) Run the application locally and use the debugger to trace request execution and error routing. 5. [Test the American Flights API with MUnit](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-munit-test-api) Create and run MUnit tests to verify your API behaves correctly. 6. [Deploy the American Flights API to CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-deploy-api) Deploy the application to CloudHub 2.0. 7. [Manage, Secure, and Monitor the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-manage-secure-monitor-api) Register the API with API Manager, secure it with a policy, and monitor it with Runtime Manager. ## Before You Begin Before you begin your API journey, verify that you have the required tools and access: - Set up your MuleSoft environment. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. - Set up MuleSoft Vibes. MuleSoft Vibes isn’t enabled by default, so complete the prerequisites in [mulesoft-vibes.adoc#before-you-begin-vibes](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes#before-you-begin-vibes) before you start. - Create an account on Anypoint Platform. Use your username and password for your Anypoint Platform organization. If you don’t have an Anypoint Platform account yet, create a trial organization. - Download a REST client, such as Advanced REST Client or another similar client, to test REST requests. This tutorial uses Advanced REST Client. - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). API specs must belong to a business group to be published to Exchange. > [!TIP] Configure a long timeout in your REST client settings to avoid timeout issues during > debugging. [Design and Publish the American Flights API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-design-api) --- product: Anypoint Code Builder version: master --- # Built-In Connectors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint connectors and modules are extensions to Mule runtime engine that process event data within a Mule application. Connectors, unlike modules, also provide ways to connect to external systems or services. In Anypoint Code Builder, both integrations and implementations are Mule applications. Anypoint connectors and modules are extensions to Mule runtime engine that process event data within a Mule application. Connectors, unlike modules, also provide ways to connect to external systems or services. Built-in Anypoint connectors are available from the canvas and code editor for integration and implementation projects. These connectors include: - [Anypoint Connector for Agent2Agent (A2A) (Beta) ()](https://docs.mulesoft.com/a2a-connector/latest/) (A2A Connector) - [Anypoint Connector for Agentforce ()](https://docs.mulesoft.com/agentforce-connector/latest/) (Agentforce Connector) - [Anypoint Connector for Database ()](https://docs.mulesoft.com/db-connector/latest/) (Database Connector) - [Anypoint Connector for Einstein AI ()](https://docs.mulesoft.com/einstein-ai-connector/latest/) (Einstein AI Connector) - [Anypoint Connector for Email ()](https://docs.mulesoft.com/email-connector/latest/) (Email Connector) - [Anypoint Connector for File ()](https://docs.mulesoft.com/file-connector/latest/) (File Connector) - [Anypoint Connector for HTTP ()](https://docs.mulesoft.com/http-connector/latest/) (HTTP Connector) - [Java Module ()](https://docs.mulesoft.com/java-module/latest/) - [Anypoint Connector for MCP (MCP Connector) ()](https://docs.mulesoft.com/mcp-connector/latest/) - [Anypoint Connector for Salesforce ()](https://docs.mulesoft.com/salesforce-connector/latest/) (Salesforce Connector) - [Anypoint Connector for Salesforce Data Cloud ()](https://docs.mulesoft.com/salesforce-data-cloud-connector/latest/) (Salesforce Data Cloud Connector) - [Anypoint Connector for Sockets ()](https://docs.mulesoft.com/sockets-connector/latest/) (Sockets Connector) - [Anypoint Connector for Workday ()](https://docs.mulesoft.com/workday-connector/latest/) (Workday Connector) Connector XML tags start with a namespace followed by an operation, following the syntax `namespace:operation`, such as `` for a Select operation in Anypoint Connector for Database (Database Connector). For more information, see [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb). Many other connectors are available from Anypoint Code Builder through Anypoint Exchange: - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) To find information about more connectors, see [Anypoint Connectors Overview](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors), and find documentation on all [Anypoint connectors and modules](https://docs.mulesoft.com/connectors/). --- product: Anypoint Code Builder version: master --- # Cache Scope () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Store and reuse frequently called data. Use a Cache scope to reduce the processing load on the Mule instance and to increase the speed of message processing within a flow. The component is particularly effective for these tasks: - Processing repeated requests for the same information. - Processing requests for information that involve large repeatable streams. When a message processor in a Mule app sends a message to the Cache scope, the parent flow expects an output. The Cache scope processes the message payload, delivers the output to the parent flow, and saves the output (that is, caches the response). The next time the Cache scope receives the same kind of message payload, the scope can produce a cached response rather than invoking a potentially time-consuming process again. For instance, you can use a Cache scope to manage customer requests for flight information. Many customers might request the same pricing information about flights from San Francisco to Buenos Aires. Rather than using a lot of processing power to send separate requests to several airline databases with each customer query, you can use a Cache scope to schedule periodic requests to airline databases and present users with the cached prices. When the timeliness of data is not critical, Cache scope can save time and processing power. Put any number of message processors (such as connectors or components) into a Cache scope and configure the caching strategy to store the responses (which contain the payload of the response message) produced by the processing that occurs within the scope. The cache scope also works in clustered environments because the object store configured in the caching strategy is shared across all nodes in the cluster. ## Caching Process The Cache scope caches repeatable streams. It does not cache nonrepeatable streams, which can be read only once before they are lost. By default, all streams are repeatable in Mule unless a component’s streaming strategy is configured to be nonrepeatable. In general, the caching process follows this sequence: 1. A message enters the Cache scope. 2. The Cache scope determines whether the message payload is nonrepeatable. 3. The Cache scope generates a key to identify the message’s payload. By default, Mule uses an SHA256KeyGenerator and a SHA256 digest to generate a unique key for the message payload. However, you can set up your own key through a custom caching strategy. 4. The Cache scope compares the newly generated key to cached responses that it has previously processed and saves it in the object store you set up (recommended) or in the default `InMemoryObjectStore`. - If there is no cached response event (a _cache miss_), the Cache scope processes the new message and produces a response. It also saves the resulting response in the object store (if the response is repeatable). - If there is a cached response event (a _cache hit_), the caching strategy generates a response that combines data from both the new request and the cached response. If the generated response is a nonrepeatable stream, the scope does not cache the response. 5. The Cache scope pushes the response out into the parent flow for continued processing. ## Caching Strategy A caching strategy defines the actions a Cache scope takes when a message enters it. By default, the Cache scope uses a caching strategy that stores data in an in-memory object store. You can create a custom caching strategy that references an existing object store, or you can create a new custom object store to use in this caching strategy. You can configure the cache size, expiration time, and maximum allowed entries by setting these values in the object store that you define or reference from the caching strategy. You can also configure a caching strategy to sync access to the cache, to avoid different message processors from using the cache at the same time. Your caching strategy can also reference these customizations: - Event Key for the object store, which is a DataWeave expression or Java object used to create the key to use for storing the payload in the object store. - Response Generator for your strategy, which is a reference to a Java object that is used to create the responses returned by the caching strategy. - Event Copy Strategy for mutable or immutable data. ### Synchronized Access to a Cache By default, Mule synchronizes access to a cache to avoid unexpected results if multiple message processors (on the same or different Mule instances) use the cache at the same time. Consider a scenario in which two message processors attempt to retrieve a value from a cache but do not find the value in the cache. Each message processor calculates the value independently and inserts it into the cache. If access to the cache is not synchronized, the value inserted by the second message processor overwrites the value inserted by the first message processor. If the values are different, then two different results are obtained for the same input, with only the last one stored in the cache. In some scenarios this outcome is valid, but this outcome is an issue if the application requires cache coherence. Synchronizing the caching strategy ensures coherence. A synchronized cache is locked when it undergoes modifications by a message processor. In this scenario, a locked cache forces the second message processor to wait until the first message processor has calculated the value, and then it retrieves the value from the cache. You can disable cache synchronization by defining the `synchronized` property in the `` element and setting it to `false`. > [!IMPORTANT] Synchronization affects performance, and the impact is most severe in cluster mode. ## Component XML This component supports the following XML structure: ```xml ``` Cache (``) attributes are configurable through the UI and XML:
Attribute NameAttribute XMLDescription

Cache (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Cachingstrategy ref

cachingStrategy-ref

Name of a caching strategy to reference.

Filter expression

filterExpression

DataWeave expression for excluding specific payloads from the Cache scope flow.

The global configuration element `` provides the following attributes:
Attribute NameAttribute XMLDescription

N/A

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

N/A

keyGenerationExpression

Optional. A DataWeave expression to generate the key, for example, keyGenerationExpression="#[vars.requestId]".

N/A

synchronized

Indicates whether Mule syncs access to a cache. Accepted values are true or false. Defaults to true.

## Examples The following examples show how to configure a Cache scope and a Caching Strategy. ### Example: Cache Scope Configuration The following example shows the configuration of a Caching Strategy, which is then referenced by a Cache Scope that contains a Database Select operation and a Transform component: ```xml ``` ### Example: Caching Strategy The following XML example shows the configuration of a caching strategy that synchronizes access to the cache, and defines a persistent object store to store the cached responses. The caching strategy is then referenced by a Cache scope: ```xml ``` ## See Also - [Streaming in Mule Applications](https://docs.mulesoft.com/mule-runtime/latest/streaming-about) - [Object Store Configuration](https://docs.mulesoft.com/mule-runtime/latest/mule-object-stores) --- product: Anypoint Code Builder version: master --- # Choice () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Route messages dynamically through a flow according to a set of DataWeave expressions that evaluate message content. Each expression is associated with a different routing option. The effect is to add conditional processing to a flow, similar to an `if`/`then`/`else` code block in most programming languages. Only one of the routes in the Choice router executes, meaning that the first expression that evaluates to `true` triggers that route’s execution and the others are not checked. If none of the expressions are `true`, then the default route executes. To configure the Choice router, specify one or more conditions to evaluate, and the message processors that execute when any condition evaluates to `true`. Additionally, configure a default route that executes when none of the defined conditions are `true`. ## Component XML This component supports the following XML structure: ```xml (1) (2) (3) ```
1The expression attribute has the condition to evaluate.
2Add any number of message processors to execute if expression evaluates to true.
3Add any number of message processors to execute if none of the conditions evaluates to true.
Choice (``) attributes are configurable through the UI and XML:
Attribute NameAttribute XMLDescription

Choice (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Choice (``) has the following child elements:
Child ElementDescription

<when/>

Child element for specifying a condition to meet before running embedded components to process the Mule event. One or more <when/> elements are allowed.

<otherwise/>

Child element that runs if no conditions set within any <when/> element are met.

The child element `` has the following attribute:
Attribute NameAttribute XMLDescription

Expression

expression

DataWeave expression used to evaluate input. If the expression evaluates to true, this routing option executes.

## Adding Routes to the Choice Router By default, the Choice router has one route option that executes when the configured DataWeave expression evaluates to `true`, and a default route that executes when none of the expressions in the existing routes are `true`. Add more routes when you need to evaluate more than one condition and then execute different operations depending on which condition is met. To add a new route: 1. Add a `` element inside the `` element. 2. Configure the `expression` attribute to define the condition to execute this route. ## Examples The following example configures an HTTP listener that receives a `language` query parameter and a Choice router that evaluates the parameter and executes the correspoding route depending on the value. ```xml ``` ## See Also - [Flows and Subflows](https://docs.mulesoft.com/mule-runtime/latest/about-flows) - [Extract Data](https://docs.mulesoft.com/dataweave/2.4/dataweave-cookbook-extract-data) - [DataWeave Scripts](https://docs.mulesoft.com/dataweave/2.4/dataweave-language-introduction) - [Business Events](https://docs.mulesoft.com/mule-runtime/latest/business-events) --- product: Anypoint Code Builder version: master --- # Command Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder provides a set of commands through the Command Palette. ## MuleSoft Commands ### Platform Commands - Open MuleSoft Vibes from the Command Palette. ```command MuleSoft: Open MuleSoft Vibes ``` - Export troubleshooting information, including logs and workspace details. See [Export Troubleshooting Information](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#export-troubleshooting-info). ```command MuleSoft: Export Troubleshooting Information ``` - Import an existing Studio workspace into Anypoint Code Builder. ```command MuleSoft: Import Studio Workspace ``` - Log in to Anypoint Platform from. See [Log in through the Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-acb#login-ide). ```command MuleSoft: Login to Anypoint Platform ``` - Open the **Settings** page for Anypoint Code Builder settings, which include settings for the Anypoint Platform control plane, such as a MuleSoft-hosted cloud or Private Cloud Edition. For an example, see [Set Anypoint Code Builder to a Different Control Plane](https://docs.mulesoft.com/anypoint-code-builder/start-acb#change-clouds). ```command MuleSoft: Open ACB Settings ``` - Open the **Welcome** tab for Anypoint Code Builder. See an example in [Discovering the UI](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui). ```command MuleSoft: Show Welcome ``` - Open project dependencies in the Explorer view. See [Viewing Project Dependencies](https://docs.mulesoft.com/anypoint-code-builder/start-view-project-dependencies). ```command MuleSoft: Show Project dependencies ``` ### Integration Commands - Deploy an integration or implementation to CloudHub. See [Deploy an App to CloudHub](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps#deploy-an-app-to-cloudhub). ```command MuleSoft: Deploy Mule Project to CloudHub ``` - Start an integration project. You can also start an integration project from the UI. See [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ```command MuleSoft: Develop an Integration ``` - Create a shareable or deployable JAR from your project. See [Export Mule Project](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project#export-mule-project). ```command MuleSoft: Export Mule Project ``` - Download a supported Java Development Kit version for local development. ```command MuleSoft: Download JDK ``` - Download a Mule runtime version for local development. ```command MuleSoft: Download Mule Runtime ``` - Import an API spec from Exchange and scaffold it into an implementation project. See [Scaffold an API and Create an Integration Project](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs#scaffold-new-integration). ```command MuleSoft: Implement an API Specification ``` - Import a connector, REST or GraphQL library, or DataWeave library from Anypoint Exchange. See examples in [Import a Connector from Exchange](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#import-connectors-from-exchange), [Import an API Spec into an Existing Implementation Project](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs#import-spec-into-project), and [Import a DataWeave Library](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#import-a-dataweave-library). ```command MuleSoft: Import Asset from Exchange ``` - Import a JAR file for a Mule project and load it into a workspace. See [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project). ```command MuleSoft: Import a Mule Project ``` - Open custom metadata management for a Mule project. ```command MuleSoft: Manage Custom Metadata ``` - Publish an integration project to Anypoint Exchange. ```command MuleSoft: Publish Mule Project to Exchange ``` - Save and hot-deploy to a local Mule runtime. ```command MuleSoft: Save and Hot-deploy to Local Runtime ``` - Run a Mule application locally. ```command MuleSoft: Run Mule Application ``` - Run a saved multi-project launch configuration from your workspace. See [Running Multiple Local Integration Projects with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-run-multiple-integration-projects-locally). ```command MuleSoft: Run Multi-Project Configuration ``` - Open Mule project properties. ```command MuleSoft: Open Mule Project Properties ``` - Toggle the canvas layout between classic and descriptive views. ```command MuleSoft: Toggle Canvas Layout (Classic/Descriptive) ``` ### API and Governance Commands - Add an API spec fragment from Exchange to the project directory to include the fragment in your spec. See [Add a Fragment from Exchange to Your Project](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments#add-fragment-to-project). ```command MuleSoft: Add Fragment dependency from Exchange ``` - Open the API Console from an API design project. See [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs). ```command MuleSoft: Show API Console ``` - Start an API design project. You can also start the project from the UI. See [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs). ```command MuleSoft: Design an API ``` - Scaffold a local API spec project into an implementation project. See [Scaffold an API Spec into a New Implementation Project](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis). ```command MuleSoft: Implement this local API ``` - Import an API spec from MuleSoft VCS. See [Import an API Specification from MuleSoft VCS](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#import-spec). ```command MuleSoft: Import API Specification from MuleSoft VCS ``` - Open API project properties. ```command MuleSoft: Open API Project Properties ``` - Publish an API project to Anypoint Exchange. See [Publish an API spec to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange#publish-spec). ```command MuleSoft: Publish API Project to Exchange ``` - Re-scaffold an API after updating a local API spec. See [Re-Scaffold the API Spec](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis#rescaffold-api-spec). ```command MuleSoft: Re-scaffold this local API ``` > [!NOTE] This command is available only for API specifications that haven’t been published to > Anypoint Exchange. If you publish the spec to Exchange, re-scaffolding is no longer available > for that asset. - Open the API Governance panel in an API design project. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Show API Governance ``` - Change a governance ruleset version in an API design project. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Change Ruleset Version ``` - Remove a governance ruleset from an API design project. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Remove Governance Ruleset ``` - Run governance validation across all rulesets and rules in the project. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Run Governance Validation with all Rulesets and Rules ``` - Sync centralized governance rulesets. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Sync Centralized Rulesets ``` - Sync centralized rulesets and run governance validation. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: Sync and Run Validation ``` - View API conformance status in Exchange. For information about rulesets, see [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). ```command MuleSoft: View API Conformance Status on Exchange ``` ### Agent Network Commands - Create an Agent Network project. ```command MuleSoft: Create an Agent Network Project ``` - Add Exchange assets to an Agent Network project. ```command MuleSoft: Add Exchange Assets to Agent Network Project ``` - Deploy an Agent Network project. ```command MuleSoft: Deploy Agent Network ``` - Publish Agent Network assets. ```command MuleSoft: Publish Agent Network Assets ``` - Set up Agent Network gateways. ```command MuleSoft: Set Up Agent Network Gateways ``` ## Other Commands Other helpful commands include the following: - Open a project folder from the Command Palette. For examples, see [Adding Folders to Your Home Directory](https://docs.mulesoft.com/anypoint-code-builder/start-add-folders). ```command File: Open Folder ``` - Open the Anypoint Code Builder panel. The panel provides links to frequent actions. See an example in [Discovering the UI](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui). ```command View: Show Anypoint Code Builder ``` --- product: Anypoint Code Builder version: master --- # Configure API Autodiscovery for Local Testing > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure **API Autodiscovery** to connect your local Mule application to an API instance in [API Manager](https://docs.mulesoft.com/api-manager/latest/latest-overview-concept). This setup enables local policy testing before you deploy the application. ## Before You Begin Ensure you have: - An active API instance in API Manager - The [client ID and client secret from Access Management](https://docs.mulesoft.com/access-management/environments#to-view-the-client-id-and-client-secret-for-an-environment) ## Get the API ID 1. In Anypoint Platform, open **API Manager**. 2. In **API Administration**, select your API instance. 3. On the API summary page, copy the **API Instance ID**. ## Add the Autodiscovery Element Add API Autodiscovery from **Global Elements**: 1. Open **Project Properties** > **Global Elements**. 2. Click **New Configuration**, and select **API Autodiscovery**. 3. Complete the form and select the flow that Autodiscovery starts. For more information, see [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements). Alternatively, add the autodiscovery element in your flow definitions. Use a property reference for `apiId` so you can load the value through configuration: ```xml ``` ## Configure Local Credentials For local execution in Anypoint Code Builder, provide your environment credentials through `config.yaml` or through Mule runtime arguments in VS Code settings. Avoid hardcoding secrets in Mule XML files. Set these properties: - `anypoint.platform.client_id` - `anypoint.platform.client_secret` Example `config.yaml`: ```yaml api.instance.id: "" anypoint.platform.client_id: "" anypoint.platform.client_secret: "" ``` Example Mule runtime arguments: ```text -M-Danypoint.platform.client_id= -M-Danypoint.platform.client_secret= ``` To add these values in Anypoint Code Builder: 1. Open the **Settings** tab. Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 2. In the **Settings** tab, find **Mule › Runtime: Default Arguments**. 3. Append the client ID and client secret arguments to the end of the existing arguments. Append the placeholder values with your client ID and client secret. ## See Also - [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements) - [Tracking Requests with Autodiscovery](https://docs.mulesoft.com/anypoint-code-builder/int-autodiscovery-config) --- product: Anypoint Code Builder version: master --- # Configure External Libraries for Mule Projects > For the full documentation index, see: https://docs.mulesoft.com/llms.txt External libraries are project-level dependencies that Mule applications require to support certain connectors and components, such as Database connectors or Spring-based components. Anypoint Code Builder provides a guided interface to add, edit, and delete external libraries, and automatically manages the corresponding entries in the project POM file. External library configurations apply at the project level. Any change to a configured library affects all components in the project that require that library. ## Before You Begin - [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). - Add a connector or component that requires an external library, such as a Database or Spring component. ## When You Need to Configure an External Library Anypoint Code Builder prompts you to configure an external library when you add or configure a component that requires additional dependencies. For example, this can occur when you: - Add a Database connector connection - Configure a Spring-based component - Use a custom component that depends on external libraries You can also manage external libraries from the project-level configuration, independent of a specific component. ## Add an External Library You can add an external library from the component configuration or from the project-level library configuration interface. Add external libraries from one of these sources: - Recommended libraries - Maven dependencies - Local files Open the library configuration interface from a component: 1. In the canvas, select a component that requires an external library. 2. In the component configuration panel, locate the **Required Libraries** list. 3. Click the **Configure library** icon. Anypoint Code Builder opens the **Library Configuration** page. Changes made on this page apply to the entire project. ### Add a Recommended Library Some components provide recommended libraries that match the component requirements. 1. Open the **Library Configuration** page. 2. Select **Recommended Library**. The interface shows the library to add to the project. 3. Click **Apply**. Anypoint Code Builder adds the recommended library to the project POM file and applies it to all components that require it. ### Add a Maven Dependency Search Maven Central or manually specify Maven coordinates to add a dependency. 1. Open the **Library Configuration** page. 2. Select **Maven Dependency**. 3. In the **Search Maven Central Repository** field, search for a dependency or enter the required Maven fields manually. 4. Specify values for **Group ID**, **Artifact ID**, and **Version**. 5. Optionally, configure additional fields such as **Scope**. 6. Click **Apply**. Only libraries that meet the required criteria appear in component library fields after configuration. ### Add a Library from a Local File Add a dependency from a local file, such as a JAR or an external POM file. 1. Open the **Library Configuration** page. 2. Select **Local File**. 3. Select a file from your system. Anypoint Code Builder automatically populates the Maven fields based on the selected file. 4. Override the populated values if required. 5. Click **Apply**. If you select an external POM file, it takes precedence over any POM embedded in the artifact file. ## Edit or Delete an External Library Edit or remove an existing library configuration. 1. Open the **Library Configuration** page. 2. Select the configured library. 3. Use the available actions to update or delete the library. Deleting a library removes it from the project POM file and affects all components that use the library. --- product: Anypoint Code Builder version: master --- # Configure Responses for Your GraphQL Implementation > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure your GraphQL implementation to return a specific response for each flow. ## Before You Begin Complete these procedures: - [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api). - [Test Your GraphQL Project](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-test-first-implementation) ## Add Logic to Your Flows 1. In Anypoint Code Builder, open the **Books Implementation** project. 2. From the Explorer, open `flows.xml` from the project directory. 3. Within the `Query.bookById` flow, _replace_ the **Set Payload** component after the `` element with the following Set Payload configuration: ```XML ``` The XML for the `Query.bookById` flow now has this configuration: ```XML ``` 4. Rebuild the application by clicking the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar, and then clicking the **Start Debugging (F5)** icon. 5. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). If the application is already running, click **Start New** to rerun the application in debug mode. 6. Run the following `curl` command from the command prompt: ```curl curl --request POST \ --location 'http://localhost:8081/graphql' \ --header 'Content-Type: application/json' \ --data '{ "query": "query bookById($id: ID) {bookById(id: $id){ id name pageCount author{ id firstName lastName}}}", "variables": { "id": 1 } }' ``` Anypoint Code Builder returns your JSON response in the terminal (manually reformatted to enhance readability): ```JSON { "data": { "bookById": { "id":"1", "name":"My Book", "pageCount":28, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } } } } ``` After testing the `bookById` endpoint, you can use Set Payload to add mock responses for testing the remaining flows. For example: ```XML ``` [Test Your GraphQL Project](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-test-first-implementation) --- product: Anypoint Code Builder version: master --- # Configure Slack Integration > For the full documentation index, see: https://docs.mulesoft.com/llms.txt With your email and Salesforce integration complete, you can now configure your Slack integration to send a Slack message for a new case that is not escalated. ## Before You Begin Complete these procedures: 1. [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api). 2. [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc) and configure your Salesforce integration. 3. [Extract Payload Information to Variables](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-extract-payload-information). 4. [Add a Condition to Your Flow Logic](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-add-condition-to-your-flow). ## Add a Slack Action 1. In Anypoint Code Builder, open your `new-case-salesforce.xml` file and delete **Temporary Logger** from the **Not Escalated** route of the Choice router: ![A workflow with the \*Temporary Logger\* component highlighted, both in the flow canvas UI and in the code view](/mulesoft/current/en-us/anypoint-code-builder/_images/delete-temporary-logger-slack.png) ```XML ``` 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after the **Not Escalated** route of the Choice router: ![A flow in the canvas UI with the \*Add Component\* button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-slack-action-example-canvas.png) 3. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png) (**Search in Exchange**) icon, type `Slack`, and select **Slack Connector**: ![A list of search results with the Slack connector highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-slack-connector-canvas-exchange.png) 4. Select the **Chat: Post Message** operation from the Slack section: ![A list of search results containing Slack connector components](/mulesoft/current/en-us/anypoint-code-builder/_images/select-post-message-operation.png) 5. Configure the Slack operation using the following code sample: ```XML (1) ```
1Set the channel field to the channel name that you set earlier in the tutorial.
## Configure the Slack Connection 1. In Anypoint Code Builder, open your `new-case-salesforce.xml` file, and add a new line under your `` element. 2. Type `slack:` and select **slack:config**. 3. Add the following configuration to your `` element: ```XML ``` ## Test Your Mule Application 1. To expedite the test, remove the breakpoint next to your Logger component. 2. Select **Run** > **Start Debugging (F5)**. 3. After your application deploys successfully, log in to your Salesforce account. 4. From **App Launcher**, select **Service**: ![The Setup menu with the App Launcher button icon highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/salesforce-select-service.png) 5. Select **Cases** > **New Case**: ![The Service navigation bar with the \*New Case\* button highlighted in the Cases section](/mulesoft/current/en-us/anypoint-code-builder/_images/salesfroce-create-new-case.png) 6. Ensure that the **Status** of the new case is **New**. 7. After a few seconds, ensure that your configured Slack channel received a message with the information configured in the case: ```none Please handle this case. Case Number: 00001030, Origin: Phone, Case Type: , Priority: Medium, Status: New ``` [Add a Condition to Your Flow Logic](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-add-condition-to-your-flow) --- product: Anypoint Code Builder version: master --- # Configuring an MCP Server > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Add and manage MCP servers in Anypoint Code Builder to extend MuleSoft Vibes with tools for API design, integrations, governance, and agent networks. ## Use MuleSoft MCP Servers MuleSoft MCP Servers implement the Model Context Protocol (MCP) so AI assistants in your IDE can work with MuleSoft products and services. MuleSoft DX MCP Server supports API design, application deployment, and asset management. MuleSoft Platform MCP Server supports service discovery, policy enforcement, and traffic monitoring across your organization. MuleSoft MCP Servers are available in Anypoint Code Builder and are also supported when you use the Anypoint Extension Pack in compatible IDEs such as VS Code, Cursor, or Windsurf. For more information about MuleSoft MCP Servers, see: [MuleSoft MCP Servers](https://docs.mulesoft.com/mulesoft-mcp-server/). ## Use MuleSoft MCP Server Tools with GitHub Copilot When you install Anypoint Code Builder, the MuleSoft MCP Server tools are automatically registered in VS Code through the Language Model API. > [!IMPORTANT] The MuleSoft MCP Server is included with Anypoint Code Builder. You do not need to > install or configure it separately. To invoke the tools using natural language commands, you need GitHub Copilot. The MuleSoft MCP Server tools work with **GitHub Copilot Chat** in Agent mode. They are not available in the MuleSoft Vibes AI chat interface. ### Before You Begin 1. Set up and log in to GitHub Copilot in VS Code. For instructions, see [Set up GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/setup). 2. Enable Agent mode in VS Code settings: 1. Open **Settings** by pressing **Ctrl+,** (Windows/Linux) or **Cmd+,** (Mac). 2. Search for `chat`. 3. Enable the following settings: - **Chat > Agent: Enabled** — Enables agent mode for Copilot Chat. - **Chat > Extension Tools: Enabled** — Enables tools contributed by third-party extensions, including MuleSoft MCP tools. - **Chat > Mcp: Enabled** — Enables integration with MCP servers. 4. Restart Anypoint Code Builder if needed. ### Invoke MCP Tools in Agent Mode 1. Open Copilot Chat in VS Code by selecting **View** > **Chat**. 2. In the Copilot Chat panel, set the chat mode to **Agent**. > [!IMPORTANT] The MuleSoft MCP Server tools are only available in **Agent** mode. They are not > available in **Ask** mode. 3. Select **Add Context** > **Tools** to add MuleSoft MCP tools to your session. 4. Scroll through the list and select one or more MuleSoft MCP tools. > [!NOTE] You may need to re-add the context at the start of each session if it is not retained. 5. Enter a natural language prompt to invoke a MuleSoft MCP Server tool. For a list of available tools and example prompts, see [MuleSoft MCP Servers](https://docs.mulesoft.com/mulesoft-mcp-server/). ## Add and Manage Custom MCP Servers From the MuleSoft Vibes panel, you can add your own MCP server or manage connected MCP servers through the MCP Server settings. ## Open MCP Server Settings 1. Open the MuleSoft Vibes panel in Anypoint Code Builder. 2. Select **Manage MCP Servers**. > [!NOTE] From this view, you can enable or disable MCP servers that have been installed. > MuleSoft MCP Servers comes pre-installed with MuleSoft Vibes. 3. Select the gear icon to open the full MCP Server settings. This opens the MCP Servers UI with three tabs: - **Marketplace** - **Remote Servers** - **Installed** With these views, you can install new MCP servers, connect to remote MCP servers, and manage existing MCP servers. ## Add an MCP Server You can add a custom MCP server by installing the server from the Marketplace, adding a remote MCP server, or manually editing the configuration file. ### Install From Marketplace 1. In MCP Server settings, select the **Marketplace** tab. 2. Browse the available MCP servers or filter by category. 3. Click **Install** to add the selected MCP server to your environment. > [!NOTE] Marketplace servers include community-provided MCP servers. Not all servers are > supported by Salesforce. ### Add a Remote MCP Server 1. Select the **Remote Servers** tab. 2. Enter a **Server Name** and a **Service URL** for the remote MCP server. 3. Click **Add Server** to connect to the remote instance. 4. (Optional) Select **Edit Configuration** to manually configure the MCP server by updating the `a4d_mcp_settings.json` file. ### Manually Configure the JSON File If needed, you can configure MCP servers directly by editing the `a4d_mcp_settings.json` file: 1. From the **Remote Servers** tab, select **Edit Configuration**. 2. Update fields such as server names, URLs, and additional settings. 3. Save your changes to apply the configuration. ## Manage Installed MCP Servers Once an MCP server has been installed, you can manage it from the **Installed** tab. ## Turn Servers On and Off 1. Select the **Installed** tab. 2. Toggle each MCP server on or off. 3. To restart a server, select **Restart Server** from its configuration panel. ## Manage Tools for an MCP Server Each MCP server provides a set of tools that MuleSoft Vibes can use. The following steps show you how to work with an MCP server: 1. In the **Installed** tab, select a server to expand its details. 2. View the list of available tools for that server. 3. To auto-approve an individual tool, check the **Auto-approve** box next to that tool. > [!NOTE] Auto-approval for tools is available only if Auto-approve has been enabled in MuleSoft > Vibes settings. 4. To auto-approve all tools from a server, scroll to the bottom of the list and enable **Auto-approve all tools**. ## Configure Request Timeout Follow these steps to configure how long MuleSoft Vibes waits for a response from an MCP server: 1. In the server details panel, locate **Request Timeout**. 2. Select a timeout value. ## Delete an MCP Server To remove an MCP server: 1. Open the server’s configuration panel from the **Installed** tab. 2. Scroll to the bottom of the tools list. 3. Select **Delete Server**. 4. Confirm the deletion. > [!NOTE] You can delete custom MCP servers that you add. The MuleSoft MCP Server is pre-installed > with MuleSoft Vibes and can be turned on or off, but it can’t be removed. Tool availability, behavior, and stability may vary depending on the MCP server version and configuration, as well as whether the server is community-provided or supported by Salesforce. --- product: Anypoint Code Builder version: master --- # Configuring Components > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure connectors and processors within your implementation and integration projects from the canvas or the code editor. Common tasks include the following: - [Add a Component to Your Project](#add-components) - [Configure Expressions](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions) - [Test a Connection Configuration](#check-connection) - [Import a Connector from Exchange](#import-connectors-from-exchange) - [Open a Component in the Canvas from the Code Editor](#open-component-from-xml) ## Before You Begin - Determine which connectors and processors you intend to use. When adding components, you can start from the canvas or the code editor for your app. You can configure components from their configuration panels in the canvas or from the code editor. For reference documentation on specific connector and component configurations, see [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference). - Review [Get Familiar with the Basics](https://docs.mulesoft.com/anypoint-code-builder/#get-familiar-with-the-basics) to ensure that you are familiar with important concepts and features. Understand the basics of Mule flows, the Mule event structure, including the payload, attributes, and Mule variables. To transform data and add expressions to your components, have some familiarity of the DataWeave language. ## Add a Component to Your Project These examples illustrate basic configurations for adding components to your project from the canvas, and the code editor. The examples assume you are beginning with an empty integration project. 1. In the Explorer, open the configuration XML file for your project:, such as `my-project-name.xml`. ![Canvas showing visual representation of Mule flow and the Mule configuration file](/mulesoft/current/en-us/anypoint-code-builder/_images/int-empty-canvas.png)
1The canvas provides space for a visual representation of your Mule flows or subflows.
2The code editor displays the configuration file for your Mule application.
2. Select **Build a Flow** from the canvas to create an empty flow within a Mule integration application. 3. Change the default name of the flow from the canvas or from the code editor. - From the canvas - From the code editor Click **Flow name1** to open the configuration panel for the Flow component, change the flow name, and click the check mark to set the new name. ![Change name of flow through canvas.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-flow-name-ui.png) Replace the default name of the flow (`name1`) with your flow name, such as `getFlights`, for example: ```xml ``` 4. Add a component to your project from the canvas. For example, add the HTTP Listener component: 1. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, search for and select **Listener** from the **HTTP** results: ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png) The configuration XML file now includes the XML for the HTTP Listener within the `` element, for example: ```XML ``` 5. Add another component, this time using the code editor. In the code editor, place your cursor before the opening `` tag. Ensure that the cursor is not inside the `` element. Add the following code: ```xml ``` 1. Notice that the Listener component in the canvas now displays an error: ![Listener error in the canvas](/mulesoft/current/en-us/anypoint-code-builder/_images/int-canvas-error.png) 2. To determine where the error is, select the processor in the canvas. Anypoint Code Builder highlights its location in the code editor, and you can mouse over the issue for more information, for example: ![Selecting configuration reference from configuration panel](/mulesoft/current/en-us/anypoint-code-builder/_images/int-select-listener-config.png) 3. To fix the error, change the value of the `name` attribute in `http:listener-config` to match the name of the `config-ref` value in your `http:listener` configuration: ```xml ``` The HTTP listener within your flow now references the HTTP listener configuration, a global connection configuration that resides outside of the flow. For more information about debugging, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). 6. Add another component to your flow. For example, add a Set Payload component to your HTTP Listener operation: 1. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, search for and select **Set payload** from the **Transformer** results. 3. In the canvas, click **Set payload** to open its configuration panel, and add a string value, DataWeave expression, Mule variable, or configuration property. - To add a string, type a value such as `my value`. For example: ![Adding string to Set Payload](/mulesoft/current/en-us/anypoint-code-builder/_images/int-set-payload-config-string.png) - To add a DataWeave expression or a Mule variable as a value, such as `payload`, click **fx** (located before the field), and provide the value, for example: ![Adding expression to Set Payload](/mulesoft/current/en-us/anypoint-code-builder/_images/int-set-payload-config-fx.png) For more information about configuring DataWeave expressions, see [Using DataWeave Expressions and Transformations in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions). - To add a configuration property as a value, type a value such as `${secure::mysensitiveprop}`. For more information about configuration properties, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). Your configuration XML file now looks similar to the following: ```xml ``` 7. Add another component to your flow. For example, add the **Create** operation from Anypoint Connector for Salesforce to insert an Account record. Use this pattern when your flow receives data through an HTTP Listener and must create Salesforce records. If you completed the earlier steps that add **Set payload** with a fixed string, remove or replace that processor so you can shape the payload before **Create**. For more information about using **Create** with Account records, see [Salesforce Connector 12.0 Examples](https://docs.mulesoft.com/salesforce-connector/latest/salesforce-connector-examples). 1. In the configuration XML, add a global Salesforce connection element above your `` element (not inside the flow). Use configuration properties for credentials instead of literals; for example: ```xml ``` For more information about connection types and authentication fields, see [Salesforce Connector 12.0](https://docs.mulesoft.com/salesforce-connector/latest/). 2. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after **HTTP Listener**. 3. In the **Add Component** panel, search for **Set payload**, and add the component. 4. Configure **Set payload** with a DataWeave expression that builds a JSON object whose fields match your HTTP API (they need not match Salesforce field names yet). For example, use **fx** to enter DataWeave with `output application/json` and sample fields such as `companyName`, `industry`, and `phoneNumber`. Alternatively, add **Transform Message** and use the same DataWeave in ``. For more information about **Transform Message**, see [Transform ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform). 5. From the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after **Set payload** (or **Transform Message**). 6. In the **Add Component** panel, click **Connectors**, select **Salesforce**, and select **Create**. 7. In the configuration panel for **Create**, set: - **Connection config**: The global Salesforce configuration name (for example, `Salesforce_Config`). - **Type**: `Account`. If **Type** stays empty until you establish a working Salesforce connection, set `type="Account"` on `` in the code editor. - **Records**: A DataWeave expression that resolves to the records to create. If the incoming payload uses different property names than Salesforce expects, map those properties in **Records**, as shown in the configuration XML example that follows. If the payload is already an array of Java objects with Salesforce field names (`output application/java`), you can use `#[payload]`. For more information about connector fields for this operation, see [Salesforce Connector 12.0](https://docs.mulesoft.com/salesforce-connector/latest/). > [!NOTE] Picklist fields such as **Industry** must use values that exist in your Salesforce > organization. This configuration listens on `/accounts`, builds a JSON payload, maps it to Account fields inside ``, and calls **Create**. Align `config-ref` on `` with the `name` of your `` (for example, `config-ref` from the earlier steps in this topic). ```xml #[%dw 2.0 output application/java --- [{ Name: payload.companyName, Industry: payload.industry, Phone: payload.phoneNumber }]] ``` If the message payload is already an array of Java objects with Salesforce field names, you can omit `` and set **Records** to `#[payload]`, or use a self-closing `` element with that default. You can achieve the same result by adding **Transform Message** with `output application/java` followed by `` with **Records** set to `#[payload]`. ## Set Custom Metadata for a Component To set custom metadata for a component, add or open the component in the canvas and then apply the metadata using the custom metadata options from the **Metadata** tab, **Expression Builder**, or dataweave functions. For more information, see [Set Custom Metadata on the Metadata or Data Tab](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-component-custom-metadata-on-metadata-or-data-tab) and see [Set Custom Metadata in Transformation Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-custom-metadata-in-transformation-builder). ![Set Custom Metadata for a component](/mulesoft/current/en-us/anypoint-code-builder/_images/int-set-component-custom-metadata.png) ## Refactor Flows Using Canvas Actions Reorganize and refactor your flows directly from the canvas. Move, copy, and extract components without manually updating the underlying XML. These actions help you reduce rework, maintain clean flow structures, and safely evolve your implementations as complexity grows. You can use canvas actions to: - Move components within a flow or across files - Copy and reuse components in the same or different projects - Extract components into a new flow or subflow When you perform these actions, Anypoint Code Builder automatically updates references, connections, and configurations to prevent broken flows. > [!NOTE] Some components can’t be extracted or moved. If a selection includes unsupported > components, the available actions are limited to prevent invalid configurations. In some cases, > the **Extract to Flow** option is displayed but no extraction is performed, for example when > extraction across scopes isn’t supported. ### Extract Components to a Flow Extract one or more components into a new flow or subflow. This is useful for simplifying large flows or reusing logic. To extract components: 1. Select one or more components in the canvas. 2. Right-click the selection and select **Extract to Flow**. 3. Enter a name for the new flow. 4. Select the target Mule configuration file. 5. Configure metadata preferences if needed. 6. Click **Extract**. Anypoint Code Builder creates the new flow and replaces the selected components with a Flow Reference in the original flow. By default, the current file is selected as the target configuration file. > [!NOTE] Some components can’t be extracted or moved. If a selection includes unsupported > components, the available actions are limited to prevent invalid configurations. In some cases, > the **Extract to Flow** option is displayed but no extraction is performed, for example when > extraction across scopes isn’t supported. ### Metadata Preferences When extracting components, you can define metadata preferences for the new flow. You can configure: - Payload metadata - Attributes metadata - Variables metadata These settings help ensure that the extracted flow has the correct input structure. ### Multi-Selection Behavior You can select multiple components by holding Shift and clicking components in the canvas. ### Validation and Safeguards Canvas actions include built-in validation to prevent invalid operations. For example: - Extraction is blocked until required metadata is loaded - Unsupported components can’t be extracted - Actions are disabled while the canvas is loading These safeguards help ensure that your flows remain valid and executable after refactoring. ## Copy Components You can copy components and paste them in the same flow or in a different file or project. To copy a component: 1. Right-click the component. To copy multiple components, press and hold Ctrl (Windows) or Cmd (macOS), select the components, and then right-click a selected component. 2. Click **Copy Component**. Or press Ctrl+c (Windows) or Cmd+c (macOS). 3. Right-click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) icon in the current flow or in a different file or project and select **Paste Component** or press Ctrl+v (Windows) or Cmd+v (macOS). The component and its configuration are pasted in the new location. If multiple components are copied, they’re pasted in the same order as they’re copied. > [!NOTE] Some components, like an HTTP Listener, can’t be pasted to certain locations. An error > message shows if a component can’t be pasted to the location. ## Disable Components You can temporarily remove components from your flow without deleting them by disabling them directly from the canvas. This action is equivalent to commenting out code in the code editor. To disable a component: 1. Right-click a component in the canvas. 2. Select **Disable Component**. Disabled components appear with a dashed outline and a disabled icon. In the code editor, the component is wrapped in an XML comment ( --- product: Anypoint Code Builder version: master --- # Configuring FIPS Compliance in Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure Anypoint Code Builder to run in FIPS 140-2 or FIPS 140-3 compliant environments. When FIPS mode is enabled, Anypoint Code Builder configures the embedded JVM to use Bouncy Castle FIPS (BCFIPS) cryptographic modules and generates a FIPS-compliant keystore for your Mule applications. FIPS support in Anypoint Code Builder is functionally equivalent to FIPS support in Anypoint Studio. The configuration experience reflects the VS Code settings interface. ## Before You Begin - [Install and set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb-desktop). - Make sure the Mule runtime you use is FIPS 140-3 compliant. Mule runtime 4.9 (LTS) or 4.10 and later supports FIPS 140-3 compliance. - Use Java 17 when running Mule runtime 4.9. ## Configure FIPS Compliance Enable FIPS mode in Anypoint Code Builder settings: 1. Open MuleSoft Settings: \+ .Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 1. Find the **Mule > Runtime: Fips Enabled** setting. 2. Select the checkbox to enable FIPS compliance mode. When enabled, the embedded JVM is configured to use Bouncy Castle FIPS modules. This setting is required for regulated PCE and GIA2H environments. 3. In the **Mule > Runtime: Fips Mode** dropdown, select the FIPS compliance level: - **FIPS 140-2** - **FIPS 140-3** This setting only applies when FIPS compliance mode is enabled. 4. Optionally, set a path in **Mule > Runtime: Fips Custom Cacerts Path** if you need to use a custom `cacerts` file. If not specified, the default `cacerts` from the JDK is used. When FIPS mode is enabled, this file is automatically converted to BCFKS format. ## FIPS Mode Effects When you enable FIPS mode, Anypoint Code Builder automatically configures the following: - BCFIPS libraries Bouncy Castle FIPS JARs are included in the Mule runtime boot classpath to provide FIPS-validated cryptographic implementations. - Custom `java.security` file A `java.security` file is dynamically generated to configure the JVM to use BCFIPS providers for all security operations. The file supports both FIPS 140-2 and FIPS 140-3. - BCFKS keystore A keystore in Bouncy Castle FIPS KeyStore (BCFKS) format is created based on your existing or default keystore. BCFKS is the recommended FIPS-compliant format for storing keys and certificates. - Run configuration Each Mule application run configuration is updated with the required FIPS parameters. ## See Also - [MuleSoft Settings](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings) - [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties) --- product: Anypoint Code Builder version: master --- # Configuring Permissions > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Manage user access to Anypoint Code Builder and Anypoint Platform features. Use Access Management to grant permissions directly to individual users or assign permissions to teams to which the users belong. ## Required Permissions These permissions are required: - Set these [Anypoint Exchange permissions](https://docs.mulesoft.com/access-management/permissions-by-product#exchange) so that users can download and publish assets: - **Viewer** - **Creator** - Set these [Runtime Manager permissions](https://docs.mulesoft.com/access-management/permissions-by-product#runtime-manager) to enable services related to CloudHub and CloudHub 2.0, such as deploying applications: - **Read applications** - **Create applications** - **Delete applications** - Set the [Design Center Developer](https://docs.mulesoft.com/access-management/permissions-by-product#design-center) permission only if users design API specifications in Design Center. This permission isn’t required to design API specifications locally in Anypoint Code Builder. For a complete list of permissions, including **Anypoint Code Builder Developer** and **Mule Developer Generative AI User**, see [Permissions by Product in Anypoint Platform](https://docs.mulesoft.com/access-management/permissions-by-product). ## Before You Begin Log in to Anypoint Platform. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) If you do not have an Anypoint Platform account, you can sign up from one of the hosts. ## Grant Permissions to Users To grant permissions to an individual user: 1. In Anypoint Platform, navigate to **Access Management**. For the Anypoint Platform URL, see [Before You Begin](#before-you-begin). 2. Assign [permissions](#permissions) to the user by following the steps in [Grant Permissions to Users](https://docs.mulesoft.com/access-management/users#grant-user-permissions). The user can now develop using Anypoint Code Builder. ## Grant Permissions to Teams To grant the permission to a team: 1. In Anypoint Platform, navigate to **Access Management**. For the Anypoint Platform URL, see [Before You Begin](#before-you-begin). 2. If you haven’t started using Teams in Access Management, click **Try New Features** > **Start Using These Features** to [opt in to Teams](https://docs.mulesoft.com/access-management/teams#opt-in-to-teams). 3. Follow the steps in [Configuring Teams in Anypoint Platform](https://docs.mulesoft.com/access-management/configure-teams): - If necessary, create the team and add users. - Assign [permissions](#permissions) to the team. The members of the team can now develop using Anypoint Code Builder. ## See Also - [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups) --- product: Anypoint Code Builder version: master --- # Controlling Source Files > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use source control management (SCM) to store and share your design, integration, and implementation projects. A useful SCM provides change history of each file and a branching methodology to maintain project quality, full traceability, the ability to restore earlier versions of your files, and a way to recover source code if your Anypoint Code Builder environment is lost or removed. GitHub and the Git command line interface (CLI) are widely used in the industry and supported by VS Code out-of-the-box, with minimal configuration. The procedures on this page show how to set up and use GitHub for source control. VS Code extensions for other SCM systems are also available for you to set up and use. For information, see [SCM Providers](https://code.visualstudio.com/docs/sourcecontrol/overview#_scm-providers). For more information, see [Using Git source control in VS Code](https://code.visualstudio.com/docs/sourcecontrol/overview) in the VS Code documentation. For detailed information about Git, see the [Git documentation](https://git-scm.com/book). ## Before You Begin Ensure that these prerequisites are in place: - A GitHub account If you do not have an account, create one from the [Join GitHub](https://github.com/signup) page on the GitHub site. - A Git installation on your computer If Git is not installed on your computer, follow the [Git installation instructions](https://github.com/git-guides/install-git) for your machine. - Access to Anypoint Code Builder For setup and installation information, see [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb), and be sure to meet all prerequisites. - A GitHub user name and email configuration (see [Configure Your Git Username and Password](#config-git)) ### Configure Your Git Username and Password Check for and configure your username and email properties so that you can add, update, and retrieve your project files from a remote Git repo in GitHub. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 3. From the Anypoint Code Builder terminal, check for any existing Git configuration by running this command: ```command git config --list ``` - If your GitHub `user.name` and `user.email` are not listed or if no data returns, configure the properties: 1. Run this command to set your `user.name`, replacing `YourUserName` with your GitHub username: ```command git config –-global user.name "YourUserName" ``` 2. Run this command to set your `user.email`, replacing `your@email.com` with your GitHub email address: ```command git config –-global user.email "your@email.com" ``` If two-factor authentication is enabled on your GitHub account and you are prompted for a password, enter your personal access token instead of your GitHub login password. For more information, see GitHub documentation [Access GitHub with 2FA](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/accessing-github-using-two-factor-authentication). - If your GitHub `user.name` and `user.email` are listed, you are ready to use Git to control your project files. For guidance with common source control tasks in VS Code, see: - [Set Up a Repository from Anypoint Code Builder](#set-up-repo) - [Sync Project Changes with Your Repository](#sync-changes) ## Set Up a Repository from Anypoint Code Builder Set up a repo for your design, integration, or implementation project. If your project is already set up to sync with a repo in an SCM that you want to use, no additional setup is required. You can sync your changes without further setup. For an example, see [Sync Project Changes with Your Repository](#sync-changes). To set up a remote GitHub repo for your projects, the following scenarios are common: - [Generate and Publish to a Repository in GitHub](#create-repo) If you have a project in Anypoint Code Builder but do not have a repo for that project, you can generate a repo in GitHub and publish your project files to that remote repo. The process also implicitly initializes a local repo. - [Initialize and Commit Project Files to a Local Repository](#initialize-repo) Initializing and committing your project files into a local repo is a prerequisite to publishing and syncing files into a remote repo in GitHub. - [Publish Project Files into an Empty Repository in GitHub](#publish-to-empty) If you have an empty repo in GitHub, you can publish your project files to the repo. - [Publish Project Files to a Different Repository](#add-extra-repo) If your project is already configured to sync with a remote repo, you can configure Anypoint Code Builder to publish your project files to a different repo. This feature is helpful, for example, if you want to use your own repo for an API spec project that you imported from MuleSoft VCS or if you created your design project before the February 2024 release. Both types of projects automatically add a connection to a remote Git repo in MuleSoft VCS. - [Clone a Project Repository into Anypoint Code Builder](#clone-repo) If a design, implementation, or integration project is already stored in a repo on GitHub, you can clone it into Anypoint Code Builder. ### Generate and Publish to a Repository in GitHub If you have a project in Anypoint Code Builder but do not have a repo for that project, you can generate a repo in GitHub and publish your project files to that remote repo. The process also implicitly initializes a local repo. If you already have an empty repo in GitHub that you intend to use for a project in Anypoint Code Builder, see [Publish Project Files into an Empty Repository in GitHub](#publish-to-empty) to add and publish to the repo. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 3. Open the Source Control panel. Show me how Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-source-control-no-edits.png) (**Source Control**) icon in the activity bar or use the keyboard shortcuts: - Mac: Ctrl+Shift+g - Windows: Cmd+Shift+g 4. In the Source Control panel, click **Publish to GitHub**. ![Publish repo to GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo.png) When no repo is associated with your project, Anypoint Code Builder provides options for initializing a _local_ repo (**Initialize Repository**) or directly publishing your project to a new remote repo in GitHub (**Publish to GitHub**). Publishing to GitHub also implicitly initializes your local repo for the project. 5. Provide a name for your repo in the field that opens, or use the default name that appears. ![Name of new repo](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-name.png) The default repo name matches the project name. 6. Select a repo type (private or public). To protect data in your repo, select a private repo (**Publish to GitHub private repo**). This process commits and pushes your project files to your new repo. 7. If prompted, select the files to publish to the repo. You can select all or a subset of the files of a design project, for example: ![Selecting files to add to the new repo](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-select-files.png) 8. To view your project files in a GitHub repo, click **Open on GitHub** in the popup. ![Opening repo in GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-open-in-github.png) Alternatively, open GitHub from your browser and locate your new repo. To sync changes to project files with your repo, see [Sync Project Changes with Your Repository](#sync-changes). ### Initialize and Commit Project Files to a Local Repository Initializing and committing your project files into a local repo is a prerequisite to publishing and syncing files into a remote repo in GitHub. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 3. Open the Source Control panel. Show me how Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-source-control-no-edits.png) (**Source Control**) icon in the activity bar or use the keyboard shortcuts: - Mac: Ctrl+Shift+g - Windows: Cmd+Shift+g 4. From the Source Control panel for your project, initialize and commit your project files to a local repo for your project: 1. In the Source Control panel, click **Initialize Repository** to generate a local repo for your project. ![Initializing a local repo for a project](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-initialize.png) When no repo is associated with your project, Anypoint Code Builder provides options for initializing a _local_ repo (**Initialize Repository**) for your project or directly publishing your project to a new remote repo in GitHub (**Publish to GitHub**). 2. Stage your files to your local repository by hovering over the **Changes** area (located after the **Commit** button) and clicking the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-scm-add-changes.png) (plus) icon. ![Adding commit message for staged changes](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-stage-changes.png) Alternatively, you can stage a single file by clicking the plus icon for that file. Staged files move from the **Changes** area in the Source Control panel to the **Staged Changes** area. The UI uses the `git add` command to add changes from your working directory to the staging area in your local Git repo. 3. Provide your a commit message for the files, and then click **Commit**, for example: ![Commit message for staged changes](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-commit-staged.png) 5. To publish your files to a remote repository, you can: - [Publish Project Files into an Empty Repository in GitHub](#publish-to-empty) If you have an empty repo in GitHub, you can publish your project files to the repo. - [Publish Project Files to a Different Repository](#add-extra-repo) If your project is already configured to sync with a remote repo, you can configure Anypoint Code Builder to publish your project files to a different repo. ### Publish Project Files into an Empty Repository in GitHub If you have an empty repo in GitHub, you can publish your project files to the repo. This procedure assumes that the project files are ready to stage and publish to the repo. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. If you have not yet initialized a local repo for your project, see [Initialize and Commit Project Files to a Local Repository](#initialize-repo). 3. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 4. Configure a connection from the project to your empty remote repo in GitHub: 1. Provide the following command to add the remote repo on GitHub: ```command Git: Add Remote... ``` 2. Select **Add Remote from GitHub** from the popup menu. ![Adding an remote repo from GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-add-remote.png) 3. Provide the URL to your git repo, for example: ![Adding a remote repo URL from GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-add-remote-uri.png) 4. Provide a name for the remote, for example: my-acb-project-repo The name for the repo can match or differ from the repo name in GitHub. 5. Click **Publish Branch**. ![Publish branch files in a repo on GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-publish-branch.png) 6. Open your repo in GitHub to review the published files, for example: ![Project files in a repo on GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-github.png) To sync changes to project files with your repo, see [Sync Project Changes with Your Repository](#sync-changes). ### Publish Project Files to a Different Repository If your project is already configured to sync with a remote repo, you can configure Anypoint Code Builder to publish your project files to a different repo. This feature is helpful, for example, if you want to use your own repo for an API spec project that you imported from MuleSoft VCS or if you created your design project before the February 2024 release. Both types of projects automatically add a connection to a remote Git repo in MuleSoft VCS. For more information, see [Source Control for API Design Projects](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs#anypoint-scm). If you are unsure whether your project is already connected to a remote repo, see [Check for a Remote Repository URL](#check-remote). This example assumes that you have an empty repo in GitHub. If you do not, you can create one from GitHub. For guidance, see [Quickstart for repositories](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories) in the GitHub documentation. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 3. Open the Source Control panel. Show me how Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-source-control.png) (**Source Control**) icon in the activity bar or use the keyboard shortcuts: - Mac: Ctrl+Shift+g - Windows: Cmd+Shift+g 1. In the Source Control Panel, notice that there is a repo in the **Source Control Repositories** area of the panel, for example: ![Project source control using MuleSoft VCS](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-anypoint.png) 4. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 5. Configure a connection from the project to your repo in GitHub: 1. Provide the following command to add the remote repo on GitHub: ```command Git: Add Remote... ``` 2. Select **Add Remote from GitHub** from the popup menu. ![Adding an extra remote repo from GitHub](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-add-remote.png) 3. Provide the URL to your git repo, for example: https://github.com/me/my-extra-repo.git 4. Provide a name for the remote, for example: my-extra-repo This name for the repo can match or differ from the repo name in GitHub. 6. Publish your project to your extra remote repo: 1. In the command palette, provide the following command: ```command Git: Push to... ``` 2. Select **Git: Push to…​** from the popup menu. ![Selecting 'Push to…​'](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-push-to.png) 3. Select the extra remote repo that you added, for example: ![Selecting the extra remote repo](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-publish-to-private-repo.png) 7. Check for your project source files in your repo on GitHub, for example: ![Viewing project files in the extra remote repo](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-oas-in-github.png) You can now clone this project repo to easily modify and sync your changes from the UI. See [Clone a Project Repository into Anypoint Code Builder](#clone-repo). ## Sync Project Changes with Your Repository After your project is connected and published to a remote repo in GitHub, you can sync your changes with that repo. If your repo is not set up yet, see [Set Up a Repository from Anypoint Code Builder](#set-up-repo). Use the UI or the built-in terminal to sync your changes: - [Sync Changes from the Source Control Panel](#sync-from-ui) - [Sync Changes from the Command Terminal](#sync-from-terminal) ### Sync Changes from the Source Control Panel To sync changes to your files from your project’s Source Control panel: 1. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 2. Open the Source Control panel. Show me how Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-source-control.png) (**Source Control**) icon in the activity bar or use the keyboard shortcuts: - Mac: Ctrl+Shift+g - Windows: Cmd+Shift+g 3. In the Source Control panel: 1. Stage your files to your local repository by hovering over the **Changes** area (located after the **Commit** button) and clicking the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-scm-add-changes.png) (plus) icon. ![Adding commit message for staged changes](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-stage-changes.png) Alternatively, you can stage a single file by clicking the plus icon for that file. Staged files move from the **Changes** area in the Source Control panel to the **Staged Changes** area. The UI uses the `git add` command to add changes from your working directory to the staging area in your local Git repo. 2. Provide your a commit message for the files, and then click **Commit**, for example: ![Commit message for staged changes](/mulesoft/current/en-us/anypoint-code-builder/_images/start-scm-repo-commit-staged.png) 3. Click **Sync Changes** to push your changes to your remote repo on GitHub. 4. Open the project in GitHub to check for the synced changes. ### Sync Changes from the Command Terminal To sync changes to your files from your project’s command terminal: 1. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 2. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 3. At the prompt, run Git commands to add new files to your repo and to stage, commit, and push changes to your remote repo on GitHub. The following example uses `git status` to check the status of changes, `git commit` to commit all changed files and add a commit message, and `git push` to merge the changes into the files on the remote repo. $ git status On branch main Your branch is up to date with '011124-test-api-remote/main'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: 011124-test-api.raml no changes added to commit (use "git add" and/or "git commit -a") $ git commit -am 'my commit message' \[main bccc296\] another commit 1 file changed, 1 deletion(-) $ git push Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 944 bytes | 944.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To https://github.com/me/my-repo.git e4156cc..bccc296 main -> main For common Git commands, see [About Git](https://docs.github.com/en/get-started/using-git/about-git) in the GitHub documentation, or find all commands in the [Git command reference](https://git-scm.com/docs). ## Branch and Review Changes to a Mule Project When multiple developers work on the same Mule project, merging changes to flow configuration XML files is more error-prone than merging typical source code. Work on a separate branch for each feature or fix so that concurrent changes stay isolated and conflicts are easier to resolve when you merge. Global elements in `global-config.xml`, such as connector configurations and connection details, affect every flow that references them. Commit changes to this file separately from flow changes, with a commit message that explains what changed and why, so you can roll back a global configuration change without also reverting unrelated flow work. When you review changes in a Mule configuration XML file, attribute reordering, namespace declarations, and auto-generated component IDs can clutter the review process. Focus your review on the parts that affect runtime behavior, such as connector configurations, DataWeave scripts, and flow logic. ## Clone a Project Repository into Anypoint Code Builder If your design, implementation, or integration project is already stored in a repo on GitHub, you and your team members can clone it into Anypoint Code Builder. Cloning is helpful for sharing your project, for enabling you to edit source and sync changes, and for retrieving a backup of a deleted project. For example, you can work on the same project on different computers if your project is stored in a repo to which you and your team have access. 1. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Clone the repo into the Source Control panel for your project: 1. Provide the following command to add the remote repo on GitHub: ```command Git: Clone ``` 2. Provide the URL to your repo in GitHub, for example: ```command https://github.com/_owner_/_yourrepo_.git ``` Replace the URL in the example with the URL to your repo in GitHub. The owner and repo URL are unique to your GitHub site. 3. Navigate to a directory for your new repo, and click **Select as repo Destination**. 4. If prompted with the request **Would you like to open the cloned repository?**, click **Open** to open the project. For cloned integration or implementation projects, you can navigate to `src`→ `main` → `mule` to find the config XML file or files. To sync changes to project files with your repo, see [Sync Project Changes with Your Repository](#sync-changes). ## Check for a Remote Repository URL To determine whether a remote GitHub repo for your project is configured, check for a URL to the repo: 1. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 2. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 3. Provide the following command: ```command git remote -v ``` - If the project has one or more remote repo configurations, the command returns the URL for each remote, along with `push` and `fetch` information, for example: $ git remote -v origin https://github.com/me/my-project-repo.git (fetch) origin https://github.com/me/my-project-repo.git (push) - If no results return, a remote repo is not configured for the project. - If the error `fatal: not a git repo (or any of the parent directories): .git` returns, a local repo is not initialized for the project. For information about `git remote` command options, see [git-remote reference](https://git-scm.com/docs/git-remote) in the GitHub documentation. ## Remove a Remote Repository from Your Project To remove a remote repo from your project workspace: 1. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 2. Open the Source Control panel. Show me how Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-source-control.png) (**Source Control**) icon in the activity bar or use the keyboard shortcuts: - Mac: Ctrl+Shift+g - Windows: Cmd+Shift+g 3. In the Source Control panel: 1. Provide the following Git command to add the remote repo on GitHub: ```command Git: Remove Remote... ``` 2. In the popup, select the remote repo that you want to remove. Your local Git repo remains because it was initialized before syncing with the remote. ## See Also - [Introduction to Git in VS Code](https://code.visualstudio.com/docs/sourcecontrol/quickstart) --- product: Anypoint Code Builder version: master --- # Core Processors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure message and event processing in an integration application or API implementation. Core processors (also called Mule components) run on the Mule runtime engine. - [Async ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-async) - [Batch Job ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-batch) - [Cache Scope ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-cache) - [Choice ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-choice) - [Custom Event ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-custom-event) - [Dynamic Evaluate ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-dynamic-evaluate) - [Error Handler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-error-handler) Includes On-Error Continue (``) and On-Error Propagate (``) - [First Successful ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-first-successful) - [Flow ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow) - [Flow Reference ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow-ref) - [For Each ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-for-each) - [Idempotent Message Validator ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-idempotent-message-validator) - [Invalidate Cache ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-cache) - [Invalidate Key ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-key) - [Logger Component ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-logger) - [Parallel For Each ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-parallel-for-each) - [Parse Template ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-parse-template) - [Raise Error ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-raise-error) - [Remove Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-remove-variable) - [Round Robin ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-round-robin) - [Scatter-Gather ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scatter-gather) - [Scheduler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scheduler) - [Set Payload ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-payload) - [Set Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-variable) - [Subflow ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-subflow) - [Transaction ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transaction) - [Transform ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform) - [Try Scope ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-try) - [Until Successful ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-until-successful) --- product: Anypoint Code Builder version: master --- # Create a Configuration File for Slack and Salesforce > For the full documentation index, see: https://docs.mulesoft.com/llms.txt A configuration file is a YAML file that can reference different configurations and specify different values for your connector properties. Configuration files enable you to define specific properties depending on the environment to which you are deploying your application. To start configuring your Slack and Salesforce connectors in your escalation API, create a configuration file. ## Before You Begin Complete [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api). ## Create a Configuration File 1. In your Explorer view, right-click the **resources** folder (`src/main/resources`) and select **New File**: ![The resources directory highlighted in the explorer, with the \*New File\* menu option selected](/mulesoft/current/en-us/anypoint-code-builder/_images/contact-sync-integration-new-file.png) 2. Name the file `config.yaml`. 3. Populate your file with your Salesforce, Gmail, and Slack configurations: ```YAML salesforce: username: "yourUserName" password: "yourPassword" token: "yourToken" email: host: "smtp.gmail.com" username: "yourGmailEmail" password: "yourEmailAppPassword" slack: token: "yourSlackToken" ``` 4. Navigate to your `new-case-salesforce.xml` file, add a new line before the `` tag, and paste this line: ```XML ``` ## Configure Your Salesforce Connector Use the values in your `config.yaml` file to connect the Salesforce Connector to your Salesforce environment: 1. In your `new-case-salesforce.xml` file, create a new line after the `` element, and paste the following code: ```XML ``` - > [!NOTE] When you move your cursor over the `${salesforce.username}` and `${salesforce.password}` > elements, Anypoint Code Builder shows the values from the configuration file. 1. Verify your connection to Salesforce by clicking **Test Connection** for the `` element: ![Code snippet with \*Test Connection\* button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/sync-api-sfdc-test-connection.png) Anypoint Code Builder returns a **Connection is valid** message. If you get an error, verify the error message to troubleshoot further. ## Add a Salesforce Trigger 1. Add a new flow on your canvas. 2. In the code editor, name the flow `​NewSalesforceCaseFlow`: ```XML ``` 3. On your canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after **Flow**, type `new object`, and select **On new object** after **Salesforce**. 4. In the code editor, set the following values of the `` element: - `objectType`: **Case** - `config-ref`: **Salesforce-Config** - `name`: **On New Case** 5. In the `` element, replace `` with the following XML: ```XML ``` ## Test Your Salesforce Integration 1. Add a logger at the end of your flow: ![The flow canvas with the \*Add Flow\* plus sign button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-logger-end-flow-canvas.png) ![A workflow with the \*Logger\* component added](/mulesoft/current/en-us/anypoint-code-builder/_images/drag-logger-canvas.png) A `logger` component is added to the flow in the code editor. 2. Replace the `logger` component in the code editor with the following: ```XML ``` 3. Add a breakpoint to this line by clicking the red dot at the line number: ![A line of code with the breakpoint highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/logger-breakpoint-sfdc.png) Alternatively, add a breakpoint to the `logger` component by right-clicking on the component in the canvas UI and selecting **Add Breakpoint**. 4. Select **Run** > **Start Debugging (F5)**. 5. After your application deploys successfully, log in to your Salesforce account. 6. From **App Launcher**, select **Service**: ![The \*Setup\* menu with the \*App Launcher\* button icon highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/salesforce-select-service.png) 7. Select **Cases** > **New Case**: ![The \*Service\* navigation bar with the \*New Case\* button highlighted in the \*Cases\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/salesfroce-create-new-case.png) 8. Ensure that the **Status** of the new case is **New**. 9. Create a new case and save it. 10. In Anypoint Code Builder, your application stops at the logger. Inspect the payload in **Variables**: ![The \*Variables\* panel with the \*Payload\* variables highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-app-debugger-logger-breakpoint.png) The payload contains information about your newly created case. 11. Step over your Logger component. 12. Proceed to [Extract Payload Information to Variables](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-extract-payload-information) to learn how to extract your case information to a variable to use it later in the flow. [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api) [Extract Payload Information to Variables](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-extract-payload-information) --- product: Anypoint Code Builder version: master --- # Creating and Importing API Specifications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder to create, import, and test API specs before publishing to Anypoint Exchange. You can start a new spec or import an existing spec from MuleSoft Version Control System (VCS). 1. Create an API spec project in Anypoint Code Builder or import the spec from MuleSoft VCS: - [Create an API spec project](#design-new-api-spec) (example uses OAS 3.0 (YAML)) - [Create an API spec project using RAML 1.0](#create-raml-rest-api-spec) - [Import an API spec from MuleSoft VCS](#import-spec) 2. [Track progress in the output panel](#open-output-panel). 3. [Review your spec in the API console](#review-spec-console). 4. [Test your spec using the mocking service](#test-spec). Use the [`oas-example`](#example-oas-api-spec) API spec to explore the functionality of Anypoint Code Builder with OAS, or see [Create a REST API Specification Using RAML 1.0](#create-raml-rest-api-spec) for a RAML-first project. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Understand the basics of designing API specs. See [Take Your API Specification from Design Through Deployment](https://docs.mulesoft.com/anypoint-code-builder/tutorials#modular-learning-paths) for a suggested order of topics. - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API spec to Exchange from Anypoint Code Builder, it requests the name of the business group. See [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups). ## Create a New API Specification Project To create an API spec project in Anypoint Code Builder: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Design an API**: ![\*Design an API\* link highlighted in the \*Create\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/design-api-1.png) 3. Complete the **API Specification** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the API spec title in Exchange, the name of the spec file, and the name of the project’s root directory. For example, if the project name is OAS Example, the spec file name is oas-example.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Type

The type of API spec to create.

Available options are REST API and AsyncAPI.

Select REST API to use the example in this procedure.

API Specification Language

Select OAS 3.0 (YAML) to use the example in this procedure.

4. Click **Create Project**. If prompted, trust the authors of the files in the folder. When the project is ready for editing, the API project opens the spec in the Editor view, for example, this OAS 3.0 (YAML) spec: ![New OAS 3.0 (YAML) API project](/mulesoft/current/en-us/anypoint-code-builder/_images/des-oas-create.png) 5. Continue designing your API spec. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (or press Ctrl+Space) to display available options within the context. ## Create a REST API Specification Using RAML 1.0 To create a REST API specification project that uses RAML 1.0: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Design an API**: ![\*Design an API\* link highlighted in the \*Create\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/design-api-1.png) 3. Complete the **API Specification** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the API spec title in Exchange, as the name of the spec file, and as the name of the project’s root directory.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Type

REST API

API Specification Language

RAML 1.0
Anypoint Code Builder also supports RAML 0.8 and OAS formats. For the full list, see Supported OAS and RAML Versions.

4. Click **Create Project**. If prompted, trust the authors of the files in the folder. When the project is ready for editing, the API project opens your root RAML file in the Editor view. The file name matches the project name you provided (for example, `my-inventory-api.raml`). 5. Continue designing your RAML spec in the Editor view. Use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (Ctrl+Space or Cmd+Space) to add resources, methods, traits, and other RAML constructs in context. To add reusable data types and examples from Anypoint Exchange, add fragment dependencies to the project and reference them with `!include` directives in RAML. For step-by-step procedures, see [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments). When you want to try requests against your examples, [open the API Console](#review-spec-console) and [use the mocking service](#test-spec) the same way you do for OAS projects. Optional starter RAML for a `/items` resource ```raml #%RAML 1.0 title: Example Items API /items: get: description: List items ``` ## Import an API Specification from MuleSoft VCS Import an API spec from MuleSoft VCS and use Git or another source-control management system compatible with VS Code to keep your project in sync. For more information, see [Source Control for API Design Projects](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs#mulesoft-vcs). > [!NOTE] Importing an API spec from MuleSoft VCS requires Git installed on your computer. If Git is > not installed on your computer, follow the > [Git installation instructions](https://github.com/git-guides/install-git) for your machine. 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide the following command: ```command MuleSoft: Import API Specification from MuleSoft VCS ``` 3. If prompted, log in to Anypoint Platform. 4. Complete the import process: 1. Select your business group from the **Select a Business Group** popup. 2. Search for the API spec in the **APIs from MuleSoft VCS** field. 3. Navigate to or create a folder for the spec, and click **Select target folder**. If you receive an error that the import failed (**Importing project _a\_project\_name_ has failed**), check your target folder for a project with the same name. To address a duplicate naming issue before importing, you can import the design project to a different target folder or delete the project (see [Deleting API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-delete-api-projects)). 5. Edit or continue designing your spec, as needed. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (or press Ctrl+Space) to display available options within the context. 6. You can sync your changes with MuleSoft VCS. This feature is available only for API projects that you import from MuleSoft VCS. You can also store your work in another SCM. For SCM options, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). ## Track Progress in the Output Panel To track the progress of internal processing as you design your API: 1. Open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 2. Select **Mule DX Server** from the dropdown list: ![Mule DX Server in the output pane](/mulesoft/current/en-us/anypoint-code-builder/_images/des-output-panel.png) To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. ## Review Your Spec in the API Console To display your spec in the console: 1. Click your spec file in the editor. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-api-console.png) (**API Console**) icon. Alternatively, you can provide the command `MuleSoft: API Console` from the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 3. Wait for the endpoints to render in the API Console. The API Console shows the endpoints for the spec in API Console, for example: ![API spec in the API Console](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-console.png)
1Click a method to view details.
2Display the console menu.
4. Click methods in the console or select items from the menu to view different parts of your spec. For example, click **GET**: ![API Console with Get details](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-console-detail.png) ## Test Your API Spec Using the Mocking Service Use the Mocking Service in the API Console to check the request and responses that you configured in your API spec. 1. In Anypoint Code Builder, open the spec for your API project, such as [`oas-example`](#example-oas-api-spec). 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-api-console.png) (**API Console**) icon to display your spec in the console. 3. In the API Console, click a method, such as GET or POST. 4. Click **Try It**: ![Try It button in the API console](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-console-try-it.png) 5. Confirm that the parameters that you’ve defined are correct and click **Send**. 6. Verify that API console returns the response you defined, for example: ![Example response in the API console](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-console-response.png) 7. Optionally, review your configured response examples when querying your mocked API endpoints. ## Example OAS 3.0 (YAML) API Specification If you created an OAS 3.0 (YAML) project, you can replace the initial spec with following example code: Example OAS 3.0 (YAML) API Specification ```YAML openapi: "3.0.0" info: version: 1.0.0 title: oas-example paths: /contacts: get: summary: Retrieve a list of contacts description: Returns a list of contacts. responses: '200': description: Successful response content: application/json: example: - id: 1 firstName: John lastName: Doe company: Example Corp - id: 2 firstName: Jane lastName: Smith company: Another Company post: summary: Create a new contact description: Creates a new contact. requestBody: description: Contact object to be created required: true content: application/json: schema: $ref: '#/components/schemas/Contact' responses: '201': description: Contact created successfully content: application/json: example: id: 3 firstName: John lastName: Doe company: Example Corp '400': description: Invalid request '500': description: Internal server error '/contacts/{contactId}': put: summary: Update a contact description: Updates an existing contact based on the contact ID. parameters: - name: contactId in: path description: ID of the contact to update required: true schema: type: integer format: int64 requestBody: description: Updated contact object required: true content: application/json: schema: $ref: '#/components/schemas/Contact' responses: '200': description: Contact updated successfully content: application/json: example: id: 3 firstName: John lastName: Doe company: Updated Corp '400': description: Invalid request '404': description: Contact not found '500': description: Internal server error components: schemas: Contact: type: object properties: id: type: integer format: int64 firstName: type: string lastName: type: string company: type: string required: - firstName - lastName ``` ## See Also - [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - [Take Your API Specification from Design Through Deployment](https://docs.mulesoft.com/anypoint-code-builder/tutorials#modular-learning-paths) - [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups) - [Use Auto-Complete in the Editors](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) - [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) - [Deleting API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-delete-api-projects) - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) --- product: Anypoint Code Builder version: master --- # Creating and Importing AsyncAPI Specifications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder to design, import, govern, and test AsyncAPI specs before publishing to Anypoint Exchange: 1. Create and design an AsyncAPI spec project in Anypoint Code Builder or import the spec from MuleSoft VCS: - [Create and design an AsyncAPI spec project](#design-new-api-spec) - [Import an AsyncAPI spec from MuleSoft VCS](#import-spec) 2. [Track progress in the output panel](#open-output-panel). 3. [Review your spec in the API console](#review-spec-console). Use the [`asyncapi-example`](#example-asyncapi-api-spec) API spec to explore the functionality of Anypoint Code Builder. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Understand the basics of designing AsyncAPI specs. - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API spec to Exchange from Anypoint Code Builder, it requests the name of the business group. See [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups). ## Create and Design a New AsyncAPI Specification Project To create and design an AsyncAPI spec project in Anypoint Code Builder: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Design an API**: ![\*Design an API\* link highlighted in the \*Create\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/design-api-1.png) 3. Complete the **API Specification** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the AsyncAPI spec title in Exchange, the name of the spec file, and the name of the project’s root directory. For example, if the project name is AsyncAPI Example, the spec file name is asyncapi-example.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Type

The type of API spec to create.

Available options are REST API and AsyncAPI.

Select AsyncAPI to use the example in this procedure.

API Specification Language

Select AsyncAPI 2.6 (YAML) to use the example in this procedure.

4. Click **Create Project**. If prompted, trust the authors of the files in the folder. When the project is ready for editing, the API project opens the spec in the Editor view, for example, this AsyncAPI 2.6 (YAML) spec: ![New AsyncAPI 2.6 (YAML) API project](/mulesoft/current/en-us/anypoint-code-builder/_images/des-asyncapi-create.png) 5. Continue designing your API spec. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (Ctrl+Space) to display available options within the context. ## Import an AsyncAPI Specification from MuleSoft VCS Import an AsyncAPI spec from MuleSoft VCS and use Git or another source-control management system compatible with VS Code to keep your project in sync. For more information, see [Source Control for API Design Projects](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs#anypoint-scm). > [!NOTE] Importing an API spec from MuleSoft VCS requires Git installed on your computer. If Git is > not installed on your computer, follow the > [Git installation instructions](https://github.com/git-guides/install-git) for your machine. 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide the following command: ```command MuleSoft: Import API Specification from MuleSoft VCS ``` 3. If prompted, log in to Anypoint Platform. 4. Complete the import process: 1. Select your business group from the **Select a Business Group** popup. 2. Search for the API spec in the **APIs from MuleSoft VCS** field. 3. Navigate to or create a folder for the spec, and click **Select target folder**. If you receive an error that the import failed (**Importing project _a\_project\_name_ has failed**), check your target folder for a project with the same name. To address a duplicate naming issue before importing, you can import the design project to a different target folder or delete the project (see [Deleting API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-delete-api-projects)). 5. Edit or continue designing your spec, as needed. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (Ctrl+Space) to display available options within the context. 6. Optionally, sync your changes by using MuleSoft VCS. This feature is available only for API projects that you import from MuleSoft VCS. You can also store your work in another SCM. For SCM options, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). ## Track Progress in the Output Panel To track the progress of internal processing as you design your API: 1. Open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 2. Select **Mule DX Server** from the dropdown: ![Mule DX Server in the output pane](/mulesoft/current/en-us/anypoint-code-builder/_images/des-output-panel.png) ## Review Your Spec in the API Console To display your spec in the console: 1. Click your spec file in the editor. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-api-console.png) (**API Console**) icon. Alternatively, you can provide the command `MuleSoft: API Console` from the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 3. Wait for the channels to render in the API Console. The API Console show the channels for the spec, for example: ![AsyncAPI spec in the API Console](/mulesoft/current/en-us/anypoint-code-builder/_images/des-asyncapi-api-console.png)
1Click a channel to view details.
2Display the console menu.
4. Click channels in the console or select items from the menu to view different parts of your spec. For example, click **PUBLISH**: ![API Console with Publish details](/mulesoft/current/en-us/anypoint-code-builder/_images/des-asyncapi-api-console-detail.png) ## Example AsyncAPI (YAML) API Specification If you created an AsyncAPI 2.6 (YAML) project, you can replace the initial spec with this example code: Example AsyncAPI 2.6 (YAML) Specification ```YAML asyncapi: '2.6.0' (1) info: title: Orders AsyncAPI version: '1.0.0' description: Orders API license: name: Anypoint MQ url: https://license.com contact: name: Max Muley email: max@salesforce.com url: http://salesforce.com defaultContentType: application/json tags: - name: Orders API description: API for orders servers: (2) AMQ-prod: url: https:://your_MQ_server_URL_here protocol: anypointmq protocolVersion: v1 description: Anypoint MQ broker kafka-prod: url: your_kafka_URL_here protocol: kafka description: kafka broker sfpubsub-prod: protocol: salesforcepubsub protocolVersion: v1 url: api.pubsub.salesforce.com description: Salesforce pub sub for Platform events production solace-server: protocol: solace variables: port: enum: - '1000' bindings: solace: msgVpn: your_solace_vpn_here bindingVersion: 0.4.0 protocolVersion: 1.0.0 url: mySolaceURL channels: (3) order-placed: description: new orders channel servers: - AMQ-prod publish: operationId: listen-order-placed description: listen for new order events summary: Order Placed Event message: $ref: '#/components/messages/OrderPlaced' subscribe: operationId: publish-order-placed description: publish new order events summary: Order Placed Event message: $ref: '#/components/messages/OrderPlaced' order-updated: description: updated orders channel servers: - solace-server publish: operationId: listen-order-updated description: listen for updated order events summary: Order updated Event bindings: solace: bindingVersion: 0.3.0 destinations: - destinationType: queue queue: name: listen-order-updated topicSubscriptions: - acmeretail/onlineservices/order/updated/v1/*/* - acmeretail/onlineservices/order/updated/v2/*/* message: $ref: '#/components/messages/OrderUpdated' subscribe: operationId: publish-order-updated description: publish updated order events summary: Order updated Event bindings: solace: bindingVersion: 0.3.0 destinations: - destinationType: queue queue: name: C360.CUSTOMERS topicSubscriptions: - acmeretail/onlineservices/order/updated/v1/*/* - acmeretail/onlineservices/order/updated/v2/*/* message: $ref: '#/components/messages/OrderUpdated' order-cancelled: description: orders cancelled channel servers: - AMQ-prod publish: operationId: listen-order-cancellations description: listen for order cancellation events summary: Order Cancelled Event message: $ref: '#/components/messages/OrderCancelled' subscribe: operationId: publish-order-cancellations description: publish order cancellation events summary: Order Cancelled Event message: $ref: '#/components/messages/OrderCancelled' order-confirmed: description: orders confirmed channel servers: - sfpubsub-prod publish: operationId: listen-order-confirmations description: listen for order confirmation events summary: Order Confirmed Event message: $ref: '#/components/messages/OrderConfirmedSub' subscribe: operationId: publish-order-confirmations description: publish order confirmation events summary: Order Confirmed Event message: $ref: '#/components/messages/OrderConfirmedPub' order-backordered: servers: - kafka-prod description: orders backordered channel publish: operationId: listen-order-backordered description: listen for backorder events summary: Backorder Event message: $ref: '#/components/messages/BackOrder' subscribe: operationId: publish-order-backordered description: publish backorder events summary: Backorder Event message: $ref: '#/components/messages/BackOrder' components: (4) messages: OrderPlaced: payload: type: object properties: orderId: type: string customerName: type: string email: type: string items: type: array items: type: object properties: productId: type: string productName: type: string quantity: type: integer price: type: number required: [productId, productName, quantity, price] additionalProperties: false required: [orderId, customerName, email, items] additionalProperties: false OrderConfirmedPub: summary: order message pub contentType: application/json payload: type: array orderconfirmation: type: object properties: orderId__c: type: string email__c: type: string required: [orderId, email] additionalProperties: false OrderConfirmedSub: summary: order message sub contentType: application/json payload: type: object properties: event: type: object properties: orderId__c: type: string email__c: type: string required: [orderId, email] additionalProperties: false OrderCancelled: payload: type: object properties: orderId: type: string email: type: string reason: type: string required: [orderId, email, reason] additionalProperties: false BackOrder: payload: type: object properties: orderId: type: string email: type: string required: [orderId, email] additionalProperties: false OrderUpdated: contentType: application/json description: Shows changes to customer information including name, address and loyalty status payload: "$ref": "#/components/schemas/Order_JSON" schemaFormat: application/vnd.aai.asyncapi+json;version=2.0.0 x-ep-application-domain-id: p4oo2ehrcpf x-ep-application-domain-name: OnlineServices x-ep-custom-attr-confidential: 'true' x-ep-event-id: 66gdcid5pht x-ep-event-name: Customer Created x-ep-event-state-id: '2' x-ep-event-state-name: RELEASED x-ep-event-version: 2.0.2 x-ep-event-version-displayname: '' x-ep-event-version-id: 29btjydowi0 x-ep-shared: 'true' schemas: Order_JSON: "$schema": http://json-schema.org/draft-07/schema# properties: customer_id: description: The unique identifier of the customer type: string insight_description: description: A brief description of the insight type: string insight_type: description: The type of insight (e.g., demographic, behavioral, transactional) type: string insight_value: description: The value or result of the insight type: string timestamp: description: The timestamp when the insight was generated format: date-time type: string required: - customer_id - insight_type - insight_description - insight_value - timestamp title: CustomerInsight type: object x-ep-application-domain-id: a3hbbd7unz2 x-ep-application-domain-name: Customer360 x-ep-schema-id: 6dqkacw0k70 x-ep-schema-name: Customer Insight x-ep-schema-state-id: '1' x-ep-schema-state-name: DRAFT x-ep-schema-version: 0.1.0 x-ep-schema-version-displayname: '' x-ep-schema-version-id: u15ylfss2qx x-ep-shared: 'false' ```
1AsyncAPI

Identifies the API model as AsyncAPI and specifies the title and version of the API spec

2Servers

Defines message brokers that determine the connectors to use (indirectly) when publishing events or subscribing to events through operations in the AsyncAPI module:

  • AMQ-prod configures an Anypoint MQ broker

  • kafka-prod configures an Apache Kafka broker

  • sfpubsub-prod configures a Salesforce Pub/Sub broker

  • solace-server configures a Solace PubSub+ broker

3Channels

Defines the bindings:

  • order-placed configures an Anypoint MQ channel for publishing and subscribing to new orders

  • order-updated configures a Solace PubSub+ channel for publishing and subscribing to order updates

  • order-cancelled configures an Anypoint MQ channel for publishing and subscribing to cancelled orders

  • order-confirmed configures a Salesforce Pub/Sub channel for publishing and subscribing to order confirmation events

  • order-backordered configures a Kafka channel for publishing and subscribing to backorders

4Components

Defines the structure of messages for the different types of orders, which include OrderPlaced, OrderConfirmedPub, OrderConfirmedSub, OrderCancelled, BackOrder, and OrderUpdated

## See Also - [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - [Tutorials](https://docs.mulesoft.com/anypoint-code-builder/tutorials) - [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups) - [Use IntelliSense to Auto-Complete in the Editor](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) - [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api) - [Deleting API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-delete-api-projects) --- product: Anypoint Code Builder version: master --- # Creating and Using API Spec Fragments > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Using Anypoint Code Builder, you can create your own API fragments and publish them to Anypoint Exchange to share with other people, add fragments from Exchange to your API specification, or create fragments in your project to add directly to your API specification. Alternatively, you can create and add a fragment directly in your project without publishing it to Exchange. Anypoint Code Builder supports scaffolding these schema fragment files if they’re referenced from API specs:
AvroJSONRAML

AsyncAPI

Yes

Yes

No

GraphQL

No

No

Yes

OData

No

No

Yes

REST

No

Yes

Yes

SOAP

No

No

Yes

If you add a fragment that isn’t supported, the scaffolder doesn’t add these fragments as project dependencies when you import the spec from Exchange. However, you can scaffold schemas that are specified inline within the spec. The process for adding a fragment from Exchange is: 1. [Add the API fragment from Exchange](#add-fragment-to-project) to your API spec project as a dependency. 2. [Add the API fragment to your API spec](#add-fragments-to-spec) using the `$ref` (OAS and AsyncAPI) or `!include` (RAML) directives. The process for adding a fragment without publishing it to Exchange is: - [Create and add a fragment directly in your project](#create-add-fragment-directly) without publishing it to Exchange. Use these examples to explore the functionality of Anypoint Code Builder: - [`example-oas-fragment`](#example-oas-api-frag) API spec fragment - [`example-oas-api-spec`](#example-oas-api-spec) API spec - [`example-asyncapi-avro-fragment`](#example-avro-api-frag) AsyncAPI spec Avro schema fragment - [`example-asyncapi-spec`](#example-asyncapi-spec) AsyncAPI spec - [`example-asyncapi-spec-inline-avro`](#example-asyncapi-spec-inline-avro) AsyncAPI spec (inline Avro) ## Before You Begin Before adding fragments: - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Understand the basics of designing API specifications. To see where adding fragments fits in the journey from API design through deployment, see [Take Your API Specification from Design Through Deployment in Mule](https://docs.mulesoft.com/anypoint-code-builder/tutorials#modular-learning-paths). - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API fragment to Exchange from Anypoint Code Builder, it requests the name of the business group. See [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups). ## Create an API Fragment and Publish it to Exchange The process for creating and publishing API spec fragments is similar to the process for API specs. To create an API spec fragment: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Design an API**: ![\*Design an API\* link highlighted in the \*Create\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/design-api-1.png) 3. In **Design an API**, click the **API Fragment** tab: Ensure that you select the **API Fragment** tab. 4. Complete the **API Fragment** form:
Field NameField Value

Project Name

Unique name for your fragment.

This name is used as the fragment title in Exchange and name of the fragment file. For example, if the project name is Example OAS Fragment, the specification file name is example-oas-fragment.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Specification Language

Select OAS 3.0 (YAML) to use the example in this procedure.

<Language> Syntax

The syntax for the selected language.

Select YAML to use the example in this procedure.

5. Click **Create Project**. If prompted, trust the authors of the files in the folder. When the project is ready for editing, the API fragment project opens in the Explorer view. For example, this OAS 3.0 (YAML) API fragment: ![API Fragment tab on the Design an API page](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-fragment-new.png) 6. Continue designing your API fragment. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) (or press Ctrl+Space) to display available options within the context. If you created an OAS 3.0 (YAML) fragment project, you can replace the initial API fragment with the [example](#example-oas-api-frag) code to test adding fragments to a spec. 7. [Publish your fragment to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). The status bar shows the progress. When complete, you see a message that the API fragment successfully published to Exchange. 8. Navigate to Anypoint Platform and log in using your credentials. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) 9. Navigate to Anypoint Exchange. Show me how - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) Your API specification appears as an API spec fragment type asset in your organization, for example: ![API Spec Fragment in Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-exchange.png) If your API spec appears on Exchange as a REST API rather than an API spec fragment, check that the `classifier` attribute in the `exchange.json` file in the project folder is set to one of the following, depending on the language: - OAS: `oas-components` - RAML: `raml-fragment` - JSON Schema: `json-schema` If the attribute is set to one of the following, the project is an API spec rather than a fragment: - OAS: `oas` - RAML: `raml` ## Add a Fragment from Exchange to Your Project To add an API spec fragment from Exchange to the project directory so that you can include the fragment in your spec: 1. Open your API spec project file, for example, [`example-oas-spec`](#example-oas-api-spec). 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Enter `mulesoft` and select the following command: ```command MuleSoft: Add Fragment dependency from Exchange ``` 4. If prompted, log in to Anypoint Platform. 5. In the **Search for Asset** field, provide the name of the data type asset to add. To search for assets, type the search term and press Enter, for example: ![Search for fragment in Assets from Exchange dropdown](/mulesoft/current/en-us/anypoint-code-builder/_images/des-add-frag-from-exchange.png) 6. Select the fragment from the **Assets From Exchange** menu. 7. Select a version of the fragment. The status bar shows the progress. When complete, you see a message that the selected API fragment was successfully added to the project. 8. Verify that the fragment appears under **Project Dependencies** in Explorer, for example: ![API fragment in the Explorer view](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-dependencies.png) For more information, see [Viewing Project Dependencies](https://docs.mulesoft.com/anypoint-code-builder/start-view-project-dependencies). ## Add an API Fragment to Your API Spec To add an API spec fragment to a spec: 1. Open your API spec project file, for example, [`example-oas-spec`](#example-oas-api-spec). 2. Place the cursor where you want to add the fragment. 3. Depending on the API spec language, select the directive to add the fragment to your specification. - OAS and AsyncAPI specs: Use the `$ref` directive. - RAML specs: Use the `!include` directive. For OAS 3.0 and 3.1 APIs, scaffolding supports `$ref` API fragments from Exchange, including fragments with transitive dependencies. OAS 3.1 requires Mule runtime 4.13 or later and APIkit for Mule 4 1.13.2 or later. DataSense resolves types defined in fragment files when you scaffold into a Mule project that uses a supported Mule runtime version (currently Mule 4.9.19, Mule 4.11.6, and Mule 4.13). - OAS Example - RAML Example - AsyncAPI Example This `$ref` directive adds the `AmericanFlightDataType` from `example-oas-fragment` as a data type: ```YAML schema: $ref: exchange_modules/e91cab06-650b-4634-9c6f-5bc4f4fc4d17/example-oas-fragment/1.0.0/example-oas-fragment.yaml#/components/schemas/AmericanFlightDataType ``` This `!include` directive adds the `AmericanFlight` object from `AmericanFlightDataType.raml` as a data type: ```RAML types: AmericanFlight: !include exchange_modules/68ef9520-24e9-4cf2-b2f5-620025690913/training-american-flight-data-type/1.0.1/AmericanFlightDataType.raml ``` This `$ref` directive adds the `AmericanFlightDataType` from `example-asyncapi-fragment` as a data type: ```YAML payload: $ref: exchange_modules/e91cab06-650b-4634-9c6f-5bc4f4fc4d17/example-asyncapi-fragment/1.0.0/example-asyncapi-fragment.json#/components/schemas/AmericanFlightDataType ``` 4. Use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) (or press Ctrl+Space) to display available options within each context, for example: ![Add the fragment to your API spec](/mulesoft/current/en-us/anypoint-code-builder/_images/des-add-frag-to-spec.png) 5. To reference an element within a component defined in the fragment file: 1. Select the fragment file name. 2. Enter `#/`. 3. Press Ctrl+Space. 4. Select the element from the options, for example: ![Reference an element in the fragment](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-ref-element.png) After adding the fragment to your spec, you can: - Navigate to the dependency: Place the cursor on the fragment reference and press Command+Click. For example: ![Navigate to the fragment dependency](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-goto-dependencies.png) - View the dependency in the API Console: Place the cursor on the fragment reference and click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-api-console.png) (**API Console**) icon to open the fragment in the console. For more information, see [Review Your Spec in the API Console](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#review-spec-console). ## Create and Add a Fragment Directly in Your Spec To create a fragment in your project and include it in your specification: 1. Open your API spec project file, for example, [`example-oas-spec`](#example-oas-api-spec). 2. In the Explorer view, right-click on an empty space, and create a folder for your fragments, such as `fragments`. 3. In the `fragments` folder, create a new file, such as `my-fragment` and add your fragment code. 4. Place the cursor where you want to add the fragment. 5. Depending on the API spec language, select the directive to add the fragment from the folder to your spec: - OAS and AsyncAPI specs: Use the `$ref` directive. - RAML specs: Use the `!include` directive. - OAS Example - RAML Example - AsyncAPI Example This `$ref` directive adds the `api_key` object from the `my-fragment.yaml` file: ```YAML api-key: $ref: fragments/my-fragment.yaml#/components/securitySchemes/api_key ``` This `!include` directive adds the `AmericanFlightsExample.raml` example: ```RAML examples: output: !include examples/AmericanFlightExample.raml ``` This `$ref` directive adds the `fragments/my-fragment` example: ```YAML payload: $ref: fragments/my-fragment ``` 6. Use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) (or press Ctrl+Space) to display available options within each context, for example: ![Add the fragment from a folder to your API spec](/mulesoft/current/en-us/anypoint-code-builder/_images/des-add-frag-from-folder-to-spec.png) 7. To reference an element within a component defined in the fragment file: 1. Select the fragment file name. 2. Enter `#/`. 3. Press Ctrl+Space. 4. Select the element from the options, for example: ![Reference an element in the fragment](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-ref-element.png) After adding the fragment to your spec, you can: - Navigate to the dependency: Place the cursor on the fragment reference and press Command+Click. For example: ![Navigate to the fragment dependency](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-frag-goto-dependencies.png) - View the dependency in the API Console: Place the cursor on the fragment reference and click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-api-console.png) (**API Console**) icon to open the fragment in the console. For more information, see [Review Your Spec in the API Console](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#review-spec-console). ## Example OAS 3.0 (YAML) API Spec Fragment If you created an OAS 3.0 (YAML) fragment project, you can replace the initial API fragment with following example code: Example OAS 3.0 (YAML) API Spec Fragment ```YAML openapi: "3.0.0" info: version: 1.0.0 title: ExampleComponents paths: {} components: schemas: AmericanFlightDataType: type: object description: American Flight Data Type properties: ID: type: number code: type: string price: type: number departureDate: type: string origin: type: string destination: type: string emptySeats: type: number plane: type: object properties: type: type: string totalSeats: type: number example: ID: 1 code: ER38sd price: 400 departureDate: 2017/07/26 origin: CLE destination: SFO emptySeats: 0 plane: type: Boeing 737 totalSeats: 150 ``` ## Example OAS 3.0 (YAML) API Spec If you created an OAS 3.0 (YAML) API spec project, you can replace the initial API spec with following example code to test adding the API spec fragments: Example OAS 3.0 (YAML) API Spec ```YAML openapi: "3.0.0" info: version: 1.0.0 title: Example OAS Spec paths: /flights/{ID}: get: parameters: - name: ID required: true in: path schema: type: string responses: "200": description: "Flight with ID" content: application/json: schema: ``` ## Example AsyncAPI Spec Avro Schema Fragment If you created an Avro schema fragment, you can replace the initial API fragment with following example code: Example AsyncAPI Spec Avro Schema Fragment ```JSON { "name": "AmericanFlightDataType", "type": "record", "fields": [ {"name": "ID", "type": "int", "example": 1}, {"name": "code", "type": "string", "example": "ER38sd"}, {"name": "price", "type": "int", "example": 400}, {"name": "departureDate", "type": "string", "example": "2017/07/26"}, {"name": "origin", "type": "string", "example": "CLE"}, {"name": "destination", "type": "string", "example": "SFO"}, {"name": "emptySeats", "type": "int", "example": 0}, { "name": "plane", "type": { "name": "Plane", "type": "record", "fields": [ {"name": "type", "type": "string"}, {"name": "totalSeats", "type": "int"} ] } } ] } ``` ## Example AsyncAPI Spec If you created an AsyncAPI spec project, you can replace the initial API spec with following example code to test adding the API spec fragments: Example AsyncAPI Spec ```YAML asyncapi: 2.6.0 info: title: Example AsyncAPI Spec version: '1.0.0' channels: myChannel: publish: message: schemaFormat: application/vnd.apache.avro;version=1.9.0 payload: $ref: exchange_modules/e91cab06-650b-4634-9c6f-5bc4f4fc4d17/example-asyncapi-fragment/1.0.0/example-asyncapi-fragment.json ``` ## Example AsyncAPI Spec (Inline Avro) If you created an AsyncAPI spec project, you can replace the initial API spec with following example code to test inlining the API spec fragments: Example AsyncAPI Spec (Inline Avro) ```YAML asyncapi: 2.6.0 info: title: Example AsyncAPI Spec (Inline Avro) version: '1.0.0' channels: myChannel: publish: message: schemaFormat: 'application/vnd.apache.avro;version=1.9.0' payload: name: AmericanFlightDataType type: record fields: - name: ID type: int example: 1 - name: code type: string example: ER38sd - name: price type: int example: 400 - name: departureDate type: string example: 2017/07/26 - name: origin type: string example: CLE - name: destination type: string example: SFO - name: emptySeats type: int example: 0 - name: plane type: name: Plane type: record fields: - name: type type: string - name: totalSeats type: int ``` ## See Also - [Viewing Project Dependencies](https://docs.mulesoft.com/anypoint-code-builder/start-view-project-dependencies) - [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) - [Test Your API Spec Using the Mocking Service](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#test-spec) - [Add the API fragment from Exchange](#add-fragment-to-project) - [Deleting API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-delete-api-projects) --- product: Anypoint Code Builder version: master --- # Creating API Specs with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes is a purpose-built assistant for the development lifecycle, available directly in Anypoint Code Builder. It provides a unified panel that lets you interact with AI features using natural language prompts. Mulesoft Vibes works with the embedded MuleSoft MCP Servers (see [Mulesoft MCP Servers](https://docs.mulesoft.com/mulesoft-mcp-server/)) to support capabilities such as deploying applications, managing instances, and creating new projects. One of these capabilities is AI-powered API specification generation. With Mulesoft Vibes, you can generate and mock API specifications from natural language. This feature reduces the time spent on API design by simplifying the creation of syntax-heavy specifications. ## Before You Begin Before you start creating your API spec, make sure you meet the following prerequisites: - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Make sure you have the [required Anypoint Code Builder permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). - Ensure you have the **Mule Developer Generative AI User** and **Anypoint Code Builder Developer** permissions to use Mulesoft Vibes. - Make sure Einstein is enabled in Access Management. For more information, see [Enabling Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). > [!NOTE] Authentication happens through the user logged into Anypoint Code Builder. Mulesoft Vibes > inherits the same permissions as that user and can only execute actions that the user is > authorized to perform in Anypoint Platform. ## Design an API Spec with AI To design an API spec with Mulesoft Vibes: 1. Open Mulesoft Vibes from the toolbar or from the **Build Your Ecosystem with AI** card in the canvas. 2. Enter a message that describes your API specification. Include these required details and consider including optional details to generate a more precise spec: Base Details Optionally provide the API name, version, and description. Security Details Include a required security scheme of type Oauth 1.0, Oauth 2.0, Basic Authentication, Digest Authentication, or Pass Through. - For Basic Authentication, Digest Authentication, or Pass Through, specify responses, query parameters, and headers. - For Oauth 1.0 or 2.0, specify responses, query parameters, headers, and settings. - Settings for Oauth 1.0 can be of type `authorizationUri`, `requestTokenUri`, `tokenCredentialsUri`, or signatures. - Settings for Oauth 2.0 can be of type `authorizationUri`, `requestTokenUri`, or `authorizationGrants`. The following additional details apply: **Header Requirements** Headers must include the name, whether it’s required, and one of the following types: - Array - Boolean - Date only - DateTime - DateTime only - File - nil - Number - Object - String - Time only Optionally, provide a description, format, minimum and maximum length, default value, and example for the header. **Query Parameter Requirements** Query parameters must include the name, whether it’s required, and one of the following types: - Array - Boolean - Date only - DateTime - DateTime only - File - nil - Number - Object - String - Time only Optionally, provide a description, format, minimum and maximum length, default value, and example for the query parameter. **Response Requirements** Responses must include the status code and description. Resources and Methods Include a required security scheme of type Oauth 1.0, Oauth 2.0, Basic Authentication, Digest Authentication, or Pass Through. The following additional details apply: **Resource Requirements** Each resource can include one or more of the following methods: - GET - POST - PUT - PATCH - DELETE - HEAD - OPTIONS For GET and HEAD methods, you can include a summary, responses, requests, and query or header parameters. For POST, PUT, PATCH, and OPTIONS methods, you can include a summary, responses, requests, body, and query or header parameters. **Response Requirements** Responses must include the status code and description. Response bodies are optional and can include a description, type, media type, and example. **Request Requirements** Requests must include a description and body. **Header Requirements** Headers must include the name, whether it’s required, and one of the following types: - Array - Boolean - Date only - DateTime - DateTime only - File - nil - Number - Object - String - Time only Optionally, provide a description, format, minimum and maximum length, default value, and example for the header. **Query Parameter Requirements** Query parameters must include the name, whether it’s required, and one of the following types: - Array - Boolean - Date only - DateTime - DateTime only - File - nil - Number - Object - String - Time only Optionally, provide a description, format, minimum and maximum length, default value, and example for the query parameter. 3. Send your message. The agent creates a validated API spec. > [!NOTE] Governance isn’t included in the validation. 3. Enter your message in Mulesoft Vibes and submit it. 4. Review the generated specification. 5. If **Auto-approve** is enabled, Mulesoft Vibes writes the generated API spec directly into your project files. 6. If **Auto-approve** is disabled, Mulesoft Vibes prompts you to approve or reject each file change before applying it. 7. After the API project is generated, you can also: - Ask Mulesoft Vibes to publish the API asset to Exchange. - Add governance rulesets to validate your specification. - Mock requests to the API directly. ## Define Rules and Workflows To define reusable rules and workflows for Mulesoft Vibes: 1. In the Mulesoft Vibes panel, click the **Rules/Workflows** icon in the lower-left corner (next to the **Context** icon). 2. Choose one of the following tabs: - Rules: Define constraints or guidelines for how the API spec should be generated. For example, enforce naming conventions or require consistent error handling. Rules can be defined at the **Global Rules** or **Workspace Rules** level. - Workflows: Create a series of steps that Mulesoft Vibes executes as a predefined action. Workflows are invoked using slash commands (for example, `/workflow-name`) in the Mulesoft Vibes panel. ## Provide Additional Context You can provide additional inputs, such as requirement files (for example, `requirements.txt`), terminal outputs, or project folders, to help Mulesoft Vibes generate more accurate API specifications. These files are used as contextual references during API generation. To add context: 1. In the Mulesoft Vibes panel, click the **Add Context** icon in the lower-left corner. 2. Select the file or folder you want to attach, or paste terminal input/output. 3. Confirm to add the context to your current task. ## MuleSoft Vibes Settings You can control how Mulesoft Vibes interacts with your project through the **Settings** panel. To access this panel, click the **Auto-approve** section at the bottom of the Mulesoft Vibes window. Available settings are: - **Auto-approve**: Enable to apply changes automatically without prompting for confirmation. If Auto-approve is disabled, Mulesoft Vibes requests your approval before making any file changes. - **Read project files**: Allow MuleSoft Vibes to read project files for context. - **Edit project files**: Allow Mulesoft Vibes to write changes directly to your project. - **Read all files**: Allow Mulesoft Vibes to read all files on your computer. - **Edit all files**: Allow Mulesoft Vibes to edit any file on your computer. - **Use MCP Servers**: Allow Mulesoft Vibes to use connected MCP servers. - **Execute safe commands**: Allow Mulesoft Vibes Agent to execute safe terminal commands. - **Execute all commands**: Allow Mulesoft Vibes to execute any terminal command. - **Use the browser**: Allow Mulesoft Vibes to launch and interact with websites in a browser. ## See Also - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) --- product: Anypoint Code Builder version: master --- # Creating Integrations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To process your data with business logic, create an integration with connectors and other components in a Mule application. A typical workflow includes one or more of the following tasks: 1. Create or import an integration project: - [Create an integration project](#create-integration-project) Create the integration from scratch, or start from a project template or integration example that you import from Anypoint Exchange. For information about templates and examples in Exchange, see [Asset Types](https://docs.mulesoft.com/exchange/asset-types). - [Import a project](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project). 2. [Add components to your project](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components). You can create multiple configuration XML files in your project. See [Create an Additional Configuration XML File](#create-new-config). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). ## Create an Integration Project To create an integration project: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Create**, click **Develop an Integration**: ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png) 3. Specify a project name and location in the **Develop an Integration** form.
Field NameField Value

Project Name

Unique name for your project.

This name is used as the title and name of the integration project file. For example, if the project name is "OAS Integration," the project file name is oas-integration.

Project Location

Your home directory or another directory you create. Click Browse to select a different directory for the integration.

Don’t create the project within another project directory.

4. Create a project from scratch, or start with an asset from Anypoint Exchange. - **Start with an Empty Project** - **Start with a Project Template or Example** Click **Empty Project** to start an integration project from scratch, without any preconfigured components. ![Create integration project from scratch.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-create-integration-scratch.png) To import an existing integration template or example from Anypoint Exchange: 1. Click **Template or Example Project** to import an existing integration template or example from Anypoint Exchange. ![Create integration project from an Exchange asset.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-create-integration.png) 2. If you intend to import a private asset associated with your business organization, [log in to Anypoint Platform](https://docs.mulesoft.com/anypoint-code-builder/start-acb#login-ide) to list the template or example in the search results. Searches for public assets do not require login. 3. Search for a template or for an example. Partial searches are accepted. 4. Mouse over the asset that you want to add. 5. Click **Add Asset**. 5. Select a **Mule runtime** and **Java** version. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. By default, the latest bundled Mule runtime version (Java 17 compatible) is selected. For Java 8 projects, select Mule runtime version 4.8 (Java 8 compatible, reduced). You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. For information about version support and automated Mule patch updates, see [Mule and Java version support](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#versions-mule-jdk). To set default Mule runtime and Java versions for the projects you create, see [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). 6. Click **Create Project**. Your project opens instantly using the bundled Mule runtime versions. No Mule runtime download is required to start designing your integration. If you need a specific Mule runtime version for running or debugging, you can install it later using the `MuleSoft: Install Runtime` command. See [Install Additional Mule Runtime Versions](https://docs.mulesoft.com/anypoint-code-builder/int-versions#install-additional-runtimes). When you create an integration project from scratch or if your project from Exchange does not contain a flow structure (Flow, Subflow, or Error handling component), the canvas provides the option to create one. Otherwise, the canvas generates a graphical representation of the imported asset’s components that you can use to start your configuration. ## Create an Additional Configuration XML File Anypoint Code Builder creates the initial Mule configuration XML file in `src/main/mule` within the Mule project. You can create additional configuration files, for example, for an implementation file for a scaffolded interface or for global configurations that you can reference from an XML file. To create a new configuration XML file: 1. In the Explorer view, right-click the **mule** folder (`src/main/mule`) and select **Mule** > **New Mule Configuration File…​**. 2. In the **New Mule Configuration File…​** field that opens, provide a name for the new file without an extension. ![Provide name of Mule configuration XML file](/mulesoft/current/en-us/anypoint-code-builder/_images/int-add-config-xml.png) The name must be unique within the project. Permitted special characters are `_` (underscore), `-` (hyphen), `.`, `@`, `(`, and `)`. The process automatically appends an `xml` extension to the file name and opens the new configuration XML file and its canvas. The new configuration XML file contains the `` element with default namespaces: ```xml ``` The file’s canvas provides the same options for building your project file that appear when you create an integration project. For an example and to get started with your configuration, see [Add a Component to Your Project](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#add-a-component-to-your-project). For each configuration file, use a descriptive name that reflects the purpose of the flows it contains, such as `order-sync-flow.xml`, `customer-lookup-sapi.xml`, or `shared-error-handler.xml`, instead of a generic name such as `new-flow.xml`. Descriptive names make it easier for you and your team to locate the logic you need as the project grows. ## Organize Large Flows into Sub-Flows As a flow grows to include many processors, it becomes harder to read, test, and reuse. When a flow grows beyond approximately 15-20 processors, or when it contains logic you use in more than one place, such as validation, enrichment, or error formatting, move that logic into a sub-flow and reference it with a Flow Reference component (``). This keeps each flow focused on a single purpose and you can reuse the extracted logic elsewhere in the project. To move existing components into a new sub-flow without manually rewriting the XML, select the components in the canvas and use **Extract to Flow**. See [Refactor Flows Using Canvas Actions](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#canvas-actions). ## See Also - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference) - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) --- product: Anypoint Code Builder version: master --- # Creating Integrations with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes is a purpose-built assistant for the development lifecycle, available right in Anypoint Code Builder. MuleSoft Vibes supports many capabilities through the [MuleSoft MCP Servers](https://docs.mulesoft.com/mulesoft-mcp-server/), such as deploying applications, managing instances, and more. One such capability is transforming your business logic into a Mule application. The generated application includes the integration, connector configurations, a sample properties file, and the dependencies required for connectors. These artifacts ensure that the generated integration is runnable and can be deployed directly from Anypoint Code Builder. ## Before You Begin To create integrations with Mulesoft Vibes, ensure you: - Read [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Set the [required Anypoint Code Builder permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). - Configure the following permissions to use Mulesoft Vibes: - **Mule Developer Generative AI User** - Enable Einstein in Access Management. See [Enabling or Disabling Generative AI for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). - [Connecting a Trusted Salesforce Organization to Anypoint Platform](https://docs.mulesoft.com/access-management/connecting-salesforce-orgs). ## Access Mulesoft Vibes There are two ways to open Mulesoft Vibes: - When you create a new integration project, click a card in the canvas. For example, the **Build an Ecosystem with AI** card. - Click the Mulesoft Vibes icon in the toolbar. ![Arrow pointing to the Mulesoft Vibes icon in the toolbar](/mulesoft/current/en-us/anypoint-code-builder/_images/int-einstein-icon-in-toolbar.png) ## Create a New Integration Project To create a new integration development project: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Create**, click **Develop an Integration**: ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png) 3. Complete the **Develop an Integration** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the title and name of the integration specification file. For example, if the project name is "My Integration", the name of the folder for the integration project is my-integration, and the configuration XML file name is my-integration.xml.

Project Location

Your home directory or another directory you create. Click Browse to select a directory for the integration if you don’t want to use the prepopulated location.

4. Click **Create Project**. The integration builder canvas appears with starting cards. To generate an integration with AI, click **Use Mulesoft Vibes** in the **Build an Ecosystem with AI** card. ## Write Your Message Before you create an integration, define what you want to achieve with the integration, for example, optimizing a business process. In the Mulesoft Vibes panel, describe what you need using natural language. The clearer and more specific your message, the more accurate the generated integration. Best practices for messages: - Be clear and precise. - Include triggering events (for example, sending an email when a new case is created). - Emphasize key MuleSoft components and connector operations (for example, HTTP Connector **Listener** and Email Connector **Send**). - Specify the data objects (for example, **Salesforce Account object**). - Review your message before you submit it. After Mulesoft Vibes generates the initial integration, the code is written directly into your project. You can further customize it to fit your requirements. ### Generate Applications from Exchange Templates You can generate applications in MuleSoft Vibes by using local templates from Anypoint Exchange as a starting point. This helps you align generated integrations with established implementation patterns and internal standards. Template-based generation supports consistent project structure and reduces the effort required to apply organizational conventions after generation. ### Include Custom Connectors in Generated Applications You can include custom connectors published to your private Anypoint Exchange when generating applications with MuleSoft Vibes. Use integrations to target internal or specialized systems your organization supports. By reusing private Exchange assets during generation, you can apply approved connector implementations from the beginning of the project lifecycle. ### Invoke Exchange APIs Using REST Connectors Use MuleSoft Vibes to generate applications that invoke APIs published to Anypoint Exchange by using REST connectors. This capability helps you reuse existing API assets directly in generated integration implementations. Using Exchange APIs as generation targets improves consistency across your API and integration landscape while accelerating delivery. ## Complete Your Integration After Mulesoft Vibes builds the integration, complete the configuration as needed. Components that require further configuration display the error icon. Select the component in the canvas to determine where the error is. Anypoint Code Builder highlights the location of the error in the code editor. ## See Also - [Generative Flow Examples](https://docs.mulesoft.com/anypoint-code-builder/int-ai-gen-flow-examples) - [Developing Integrations Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/int-ai-developing-integrations) - [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference) --- product: Anypoint Code Builder version: master --- # Custom Event () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Add metadata and Key Performance Indicators (KPIs) to your flow through a custom business event. For your KPIs, use names that are easy to search for in the Anypoint Runtime Manager interface, and use a representative value, which can be any Mule expression:
NameExpression / Value

employee-id

#[payload['ID']]

employee-email

#[payload['Email']]

employee-git-id

#[payload['GITHUB_ID']]

price

700

price-after-discount

#[vars.price]

order-id

#[payload.order.header.orderID]

## Component XML This component supports the following XML structure: ```xml ``` Custom Business Event (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Custom event (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Event name

event-name

Name of the event to track.

Inherits

inherits

N/A

Meta data

metaData

N/A

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

The child element `` attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

N/A

key

Name of the KPI.

N/A

value

Value of the KPI.

## Example The following example configures a tracking event and a KPI. ```xml ``` ## See Also - [Business Events](https://docs.mulesoft.com/mule-runtime/latest/business-events) --- product: Anypoint Code Builder version: master --- # DataWeave Issues and Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When Anypoint Code Builder can’t process a value, it provides a visual indicator to identify an issue with the value. Issues include: - [Unable to find sample input](#sample-input) - [Unable to resolve reference](#resolve-reference) - [Expects _x_ but got _y_](#expects-y) - [Invalid input](#invalid-input) ## Unable to Find Sample Input The DataWeave error `Unable to find sample input` applies to a Mule event variable, such as `payload`. In this case, Anypoint Code Builder places a wavy blue line under the value in the configuration XML file. !['Unable to find sample input' error](/mulesoft/current/en-us/anypoint-code-builder/_images/dw-issue-sample-data.png) If your application isn’t running, Anypoint Code Builder can’t provide any information about Mule variables unless you provide sample data. Use [Quick Fix](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#sample-data) to provide sample data in the format and data structure that you expect to be present when the application runs. For more information about Mule event variables, see [Predefined Variables](https://docs.mulesoft.com/dataweave/latest/dataweave-variables-context). ## Unable to Resolve Reference The error `Unable to resolve reference` is typically for a sequence of characters like `afkdldjf` that isn’t recognized. ![\`Unable to resolve reference\` error](/mulesoft/current/en-us/anypoint-code-builder/_images/dw-issue-reference-resolution.png) Either provide the intended value or use [Quick Fix](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#sample-data) to convert the character sequence into a DataWeave variable. For more information, see [DataWeave Variables](https://docs.mulesoft.com/dataweave/latest/dataweave-variables). ## Expects _x_ but Got _y_ The error similar to `Expects _x_ but got _y_` typically indicates that something is wrong with the provided function. For example, `Expects 1 argument but got 0` occurs for `round()` because the function is missing an argument, in this case, a number to round. An example of a fix is `round(1.65)`. Similar errors indicate that an argument is of the wrong data type or that a function is otherwise malformed and requires correction. Read the error message to determine what part of the expression to fix, and review the function description after the error message to learn more about the function. See [DataWeave Modules](https://docs.mulesoft.com/dataweave/latest/dw-functions#dw_modules) to find additional DataWeave function documentation. ## Invalid Input The error `Invalid input` typically occurs when special characters, such as `?`, appear in a DataWeave expression and aren’t escaped, for example: !['Invalid input' error](/mulesoft/current/en-us/anypoint-code-builder/_images/dw-issue-invalid-input.png) For more information, see [Rules for Declaring Valid Identifiers](https://docs.mulesoft.com/dataweave/latest/dataweave-language-introduction#valid-identifiers) and [Escape Special Characters](https://docs.mulesoft.com/dataweave/latest/dataweave-language-introduction#escape-special-characters). ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Debug the American Flights API > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After implementing your API flows, validate that the application behaves as expected before writing automated tests. In this section, you run the project locally and use the debugger to trace request execution and error routing. ## Run the Application Locally Before testing your API, start the Mule application locally to verify the implementation works as designed. 1. Open the `american-flights-api-main` flow. 2. Click the **Listener** element. 3. On the **Connection Config** field, click **Edit Connection** (![The Edit Connection icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gear.png)). ![The Listener properties panel with Edit Connection selected next to the Connection Config field](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-listener-config.png) 4. Verify the values and update them if necessary:
Field NameField Value

Host

0.0.0.0

Port

8081

5. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 6. In the top menu, ensure **Run Mule Application** is selected and click **Start Debugging** (![The Start Debugging icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png)). 7. Wait for the application to deploy. You see deployment messages in the **Output** panel. When deployment is complete, you see a message similar to: ```command ********************************************************************** * - - + APPLICATION + - - * - - + STATUS + - - * ********************************************************************** * american-flights-api-implementation-1.0.0 * DEPLOYED * ********************************************************************** ``` 8. In your REST client (such as Advanced REST Client), test your API endpoints: - Send `GET [http://localhost:8081/api/flights](http://localhost:8081/api/flights)` and verify a `200` response with flight data. - Send `GET [http://localhost:8081/api/flights/AA123](http://localhost:8081/api/flights/AA123)` and verify a `200` response with data for flight with `"ID": 1`. - Send `GET [http://localhost:8081/api/flights/123](http://localhost:8081/api/flights/123)` and verify a `400` response from your API specification’s path parameter validation. 9. In Anypoint Code Builder, click **Stop** (![The Stop application icon. 2%](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-stop.png)) in the debug bar. == Understand the Debugger The built-in debugger in Anypoint Code Builder helps you understand how your Mule application processes requests, inspect variable values at runtime, and trace error-handling paths. Breakpoints pause execution at specific components in your flow, so you can inspect the current state of the message payload, attributes, and variables. There are two types of breakpoints: - **Component Breakpoint**: Pauses execution before a specific component executes (such as a Transform Message or Database Select operation). - **Error Breakpoint**: Pauses execution when an error occurs, allowing you to inspect the error object. When the application running in debug mode reaches a component with a breakpoint, execution pauses and the IDE highlights the current component with a yellow border. The **Debug** panel opens automatically, showing the current values of Mule variables, message attributes, payload, and the flow execution path leading to the current breakpoint. ## Set Component Breakpoints Set breakpoints in your application to pause execution and evaluate values at runtime. 1. With your application stopped, open the `get:\flights\(flightId):american-flights-api-config` flow. 2. Right-click the **Flight by ID** Database Select operation. 3. Select **Add Breakpoint** from the context menu. A red dot appears on the component, indicating an active breakpoint. ![The get:\\flights\\(flightId):american-flights-api-config flow with breakpoints set on the Flight by ID Database Select and Transform Flight components](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-add-breakpoint.png) 4. Add a breakpoint on the **Transform Flight** component after the database query to inspect the payload. ## Start a Debug Session 1. Click the **Run and Debug** icon in the activity bar. 2. Ensure **Debug Mule Application** is selected in the dropdown. ![The Run and Debug dropdown with Debug Mule Application selected](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-debug-app.png) 3. Click the **Start Debugging** button (green play icon). 4. Wait for the application to deploy in debug mode. ## Step Through the Execution and Inspect Variables and Payload 1. After your application starts running in debug mode, send a GET request from your REST client to your local application: ```command http://localhost:8081/api/flights/AA123 ``` The execution pauses at the **Flight by ID** breakpoint. 2. In the **Variables** section of the Debug panel, expand **Mule Message > Payload**. At this point, the message is empty because the query to the database hasn’t executed. 3. Expand **Mule Message > Attributes** to see HTTP request information: - `uriParams.flightId`: The flight ID from the URL. - `headers`: HTTP headers. - `method`: HTTP method (GET, POST, and so on). 4. Expand **Variables** to see Mule variables created by Transform Message components: - `flightCodeMap`: The flight code mapping. - `dbFlightId`: The database ID for the flight. 5. To evaluate a DataWeave expression, in the Debug panel, locate the **Watch** section. 6. Click **Add Expression** to add a watch expression. ![The Watch section with the Add Expression icon highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-add-expression.png) If the button doesn’t show, collapse and expand the **Watch** section so it shows again. 7. Enter a DataWeave expression, such as: ```dataweave attributes.uriParams.flightId ``` 8. Press Enter. The IDE evaluates the expression and displays the result. 9. Click **Step Over** (or press F10) to continue the execution. ![The Step Over button in the debug toolbar](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-step-over.png) 10. Execution stops at the **Transform Flight** component. 11. Expand **Mule Message > Payload**. Notice that now the message contains the results from the database query. 12. Click **Disconnect (SHIFT+F5)** (![The Disconnect icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-stop.png)) to finish debugging. ## Debug Error Paths To understand how your API handles errors, debug the validation and error-handling logic. 1. Set breakpoints on: - The Choice router in `get:\flights\(flightId):american-flights-api-config`. - The Raise Error component inside the **When** path. 2. Start debugging and send an invalid request in your REST client: ```command GET http://localhost:8081/api/flights/AA999 ``` The execution pauses at the Choice router. 3. In **Variables**, inspect `dbFlightId` (should be `null` because `AA999` isn’t in the mapping). 4. Click **Step Over** (F10). Execution moves to the **When** path and pauses at Raise Error. 5. Click **Step Over** (F10). Execution pauses at the On Error Propagate handler for `VALIDATION:FLIGHT_NOT_FOUND`: 6. In **Parameters**, verify: - `type`: `VALIDATION:FLIGHT_NOT_FOUND` - `description`: `"Flight code AA999 not found in our system"` 7. Click **Continue** (F5) to complete the error response. Once your application behaves as expected, add automated tests in [Test the American Flights API with MUnit](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-munit-test-api). [Validate Input Parameters and Transform Flight Data](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-validate-transform-data) [Test the American Flights API with MUnit](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-munit-test-api) --- product: Anypoint Code Builder version: master --- # Debugging Mule Applications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt In Anypoint Code Builder, the embedded debugger pauses Mule flows so you can inspect payloads and variables, evaluate DataWeave expressions, and step through processors in the XML editor or on the canvas. Set breakpoints in configuration files or on components, run in debug mode, step through execution with the debug toolbar, and hot deploy updates while the runtime stays up. The result is faster diagnosis: you confirm event state and processor behavior before you ship your integration. Complete these steps: 1. [Set breakpoints](#add-breakpoint) to pause the execution of a flow at lines that you want to inspect or fix. Breakpoints are markers that you add on line numbers in a configuration XML file for a Mule application that you are developing. 2. [Run the application in debug mode](#run-debug-mode). 3. Start execution of a flow in your Mule application. For example, trigger an HTTP Listener, or trigger a Scheduler on demand instead of waiting for its next tick. See [int-trigger-flows.adoc#trigger-scheduler-on-demand](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows#trigger-scheduler-on-demand). 4. When the execution stops at a breakpoint, use the [debug toolbar](#debug-toolbar) to navigate, inspect, and fix issues. 5. After addressing an issue at a breakpoint, redeploy ([hot deploy](#hot-deploy)) the running instance of your application. 6. Execute your flow again, and continue debugging until you address all issues. 7. [Stop the debug session](#stop-debug). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create an integration](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ## Debugger View Overview Use **Run and Debug** to open the view. Start a Mule debug session (**Start Debugging**, F5), inspect runtime state, and manage breakpoints. Keyboard shortcut to open the view: Cmd+Shift+D (Mac) or Ctrl+Shift+D (Windows). The **Debug Console** tab in the lower panel area lets you [evaluate DataWeave](#evaluate-dw-debug-console) while execution is paused. See [Evaluate DataWeave While Debugging](#evaluate-dw-while-debugging). ### Panels and Tools - **Debug toolbar** — Appears when a session is active. See [Debug Toolbar](#debug-toolbar) for **Continue**, **Step Over**, **Step Into**, **Step Out**, **Restart**, and **Stop**. - **Variables** — Tree of the current Mule event: payload, attributes, variables, and component parameters (such as the current processor name). See [Inspect Variables and the Mule Event](#inspect-mule-event-variables) for how errors, MIME types, copying, and editing appear in this release. - **Watch** — Pin [DataWeave expressions](#evaluate-dw-watch) that reevaluate whenever execution pauses. - **Call Stack** — Frames for the current execution context (including multiple threads when applicable). - **Breakpoints** — Breakpoints listed by file and line, including [**All Exceptions**](#exception-breakpoints) when you want to stop on any thrown exception. - **Terminal** — Maven build output and deployment messages for the embedded Mule runtime. Breakpoints appear in the XML editor and on canvas processors. For more information about adding breakpoints from the editor or the canvas, see [Add a Breakpoint](#add-breakpoint). ### Canvas Behavior While Debugging When execution pauses at a breakpoint or after a step, the flow canvas shows which processor is active. The paused processor is outlined so you can see where the runtime stopped. The canvas view scrolls as needed to keep that processor in view when a pause occurs so you can follow execution without searching the diagram manually. ### Source Editor and Multiple Configuration Files Projects can split flows across several Mule configuration XML files. When a breakpoint is hit or you step, the editor opens or switches focus to the XML file that contains the flow and processor that is actually executing, and the canvas shows that configuration. Stepping through a `` into a referenced flow opens the file that declares that referenced flow and updates the canvas accordingly. If the referenced flow is in an imported Mule project dependency, it opens in a read-only canvas and XML view. ## Inspect Variables and the Mule Event While execution is paused, use the **Variables** tree to inspect payload, attributes, `vars`, and related values. When the Mule event has an error in scope, the **Variables** view includes error information so you can diagnose failures without hunting through unrelated nodes. When no error is present, that error-specific presentation is omitted. Payloads and values that use common text-based MIME types (such as `application/json`, `text/xml`, and `text/plain`) appear as readable text in the tree. Values that are truly binary are shown with a compact placeholder instead of a long byte dump. To reuse a value elsewhere, copy it from the tree using the context menu action that copies the value as JSON. Copied JSON is valid for typical parsers. The string escaping matches what you paste into external tools. Change some variable values during a pause. Use the variable context menu to edit the value inline where the debugger allows it. After resuming, the running application uses the updated value. ## Add a Breakpoint A breakpoint enables you to pause your Mule application at a specific place to learn more about what is happening. You can either add a breakpoint to a configuration XML file or to a component in the canvas UI. Setting a breakpoint on every processor in a flow makes a debugging session slow to step through and harder to follow. Place breakpoints at specific points where you need visibility into the Mule event, such as before and after a transformation, at the entry to a Choice router, and at the start of an error handler, so each pause gives you useful information. ### Add a Breakpoint in a Configuration File To add a breakpoint in a configuration XML file: 1. In Anypoint Code Builder, on the Explorer view, open your configuration XML file, for example, `my-project-name.xml`. 2. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 3. In the XML editor, click the gutter beside the line number for the component where you want the execution to pause. The gutter shows a breakpoint indicator for that line. You can also move the caret to the line and press F9 to toggle a breakpoint. 4. Add more breakpoints on other lines as needed. Registered breakpoints appear in the **Run and Debug** view under **Breakpoints**, grouped by file and line, with checkboxes to enable or disable each one. ### Add a Breakpoint to a Component in the Canvas UI To add a breakpoint to a component in the canvas UI: 1. In Anypoint Code Builder, on the Explorer view, open your configuration XML file, for example, `flights-implementation.xml`. 2. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 3. In the canvas, right-click the processor where you want to pause and choose **Add Breakpoint**. A breakpoint indicator appears on that processor in the canvas and at the corresponding line in the configuration XML. ### Add a Breakpoint to a Batch Component Add a breakpoint to a batch component in the canvas UI or in a configuration XML file: 1. In Anypoint Code Builder, on the Explorer view, open your configuration XML file, for example, `batch-example.xml`. 2. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 3. In the canvas UI or code editor, select the batch component where you want to pause execution. You can add breakpoints to these components: \* Batch Job (``) \* Batch Step (``) \* Batch Aggregator (``) 4. Right-click the component in the canvas UI and select **Add Breakpoint**, or click the line number in the code editor. A breakpoint icon appears on the component and in the code editor for that component. 5. Run the application in debug mode. When execution reaches the breakpoint, processing pauses so you can inspect variables, payloads, and the execution state in the Debug panel. > [!NOTE] Batch execution is concurrent. Multiple record blocks can be processed in parallel, so > breakpoints can trigger on different threads. The Debug panel displays each thread context so you > can inspect each execution path. ## Set a Conditional Breakpoint A conditional breakpoint uses a DataWeave expression, so execution pauses at that line only when the expression evaluates to `true`. To set or change a breakpoint condition: 1. Add a breakpoint in the code editor. See [Add a Breakpoint](#add-breakpoint). 2. Right-click the breakpoint indicator in the gutter for that line. 3. Select **Edit Breakpoint**. 4. In the breakpoint editor, enter a DataWeave expression that uses the current Mule event. The gutter context menu for a breakpoint also includes **Remove Breakpoint**, **Disable Breakpoint**, and **Run to Line**. To review a condition later, hover over the breakpoint in the gutter. A tooltip shows the configured expression in the form `Condition:` followed by your DataWeave expression. ## Stop When an Exception Is Thrown You can configure the debugger to pause whenever any exception is thrown, which helps you inspect failures without adding breakpoints to every path. 1. Open **Run and Debug**. 2. In the **BREAKPOINTS** section, enable **All Exceptions**. When **All Exceptions** is enabled, the debugger pauses as soon as an exception is thrown during a debug session. The error type and a readable message are surfaced in the **Variables** area so you can see what failed without expanding deep trees first. Use [Inspect Variables and the Mule Event](#inspect-mule-event-variables) together with [Canvas Behavior While Debugging](#canvas-execution-indicators) to relate the exception to the processor on the canvas. ## Run Your Application in Debug Mode After setting up your debug conditions, run a debug session and evaluate your Mule application at each breakpoint: 1. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 2. In the **Run Configurations** dropdown menu, select **Debug {your-project-name}**. ![The Debug application dropdown menu.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-debug-dropdown-menu.png) 3. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png) (**Start Debugging (F5)**) icon for **Debug Mule Application**. Alternatively, if the **Start Debugging (F5)** icon is not present: 1. Click **Run and Debug**. 2. If a **Select debugger** dropdown menu appears, select **Mule Xml Debugger** to initiate the debugging session: ![Run and Debug button and Mule XML Debugger menu item](/mulesoft/current/en-us/anypoint-code-builder/_images/run-debug-imported-folder.png) When the application deploys successfully, you see a `DEPLOYED` log message in the output panel: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* - - + DOMAIN + - - \* - - + STATUS + - - \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* default \* DEPLOYED \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* > [!NOTE] Selecting **Run** > **Start without Debugging** produces an error. Anypoint Code Builder packages your application and deploys the application to the embedded Mule runtime engine. The integrated terminal shows Maven and deployment progress, and the status bar indicates that the application is running. Use the controls on the [debug toolbar](#debug-toolbar) to drive the session after you trigger your flow. ## Debug Toolbar When a Mule debug session is active, the debug toolbar provides: 1. **Continue** (F5) — Runs until the next breakpoint or the end of the application. 2. **Step Over** (F10) — Runs to the next processor in the current flow and pauses there. At a **Flow Ref** component (``), **Step Over** doesn’t enter the referenced flow. It moves to the next processor after the reference in the same flow instead. Step Over Details **Configuration XML example**: ```xml (1) (2) ``` **Step Over behavior**:
1Skips <flow-ref/> logic
2Reaches <logger/> named Logger1
3. **Step Into** (F11) — Enters the next processor, including following a `` into the referenced flow. When you step into a flow reference, Anypoint Code Builder opens the Mule configuration file that declares that referenced flow, moves the canvas to that flow, and pauses on the first processor inside it. If the referenced flow is in an imported Mule project dependency, the dependency flow opens in a read-only canvas and XML view. You can step through its processors, and stepping continues in the caller flow where appropriate after you step through the referenced flow. Step Into Details **Configuration XML example**: ```xml (1) (3) (2) ``` **Step Into behavior**:
1Enters <flow-ref/> to follow logic to myNewFlow
2Reaches Logger2 in next flow, myNewFlow
3Returns to flow flow1 to reach Logger1
4. **Step Out** (Shift+F11) — Leaves the current flow and returns toward the caller when possible; if there is no caller frame, behaves like **Continue**. 5. **Restart** (Shift+Cmd+F5 on Mac, Shift+Ctrl+F5 on Windows) — Stops and restarts without picking up new Maven dependencies from `pom.xml`. 6. **Stop** (Shift+F5) — Ends the application. The next debug session repackages the app if you added connector or dependency changes. ## Evaluate DataWeave While Debugging While execution is paused, you can run DataWeave against the current Mule event from the **Debug Console** or from pinned entries in the **Watch** panel. For the variables available in those expressions, see [Predefined Mule event variables](https://docs.mulesoft.com/dataweave/latest/dataweave-variables-context). ### Use the Debug Console 1. Start a debug session and pause execution at a breakpoint or after a step. See [Run Your Application in Debug Mode](#run-debug-mode) and [Debug Toolbar](#debug-toolbar). 2. Open the **Debug Console** tab, or choose **View** > **Debug Console**. 3. Ensure the input is set to **Expression**. Type a DataWeave expression and press Enter to evaluate it against the current message, attributes, variables, and other values visible to the debugger at the pause. The console shows each expression you run and its evaluated result for the current pause. Use the **Debug Console** for checking the steps as you debug through a flow. ### Use the Watch Panel 1. Open the **Watch** panel in the **Run and Debug** sidebar. 2. Add an entry with **+** and enter a DataWeave expression. Whenever execution pauses, the debugger reevaluates each watch expression and shows the result next to the expression, similar to the **Debug Console**. Watch expressions typically persist for later debug sessions in the same workspace, so you can keep inspecting the same values across runs. Use the **Watch** panel for values you want to track on every pause without retyping them. ## Perform a Hot Deploy When Debugging As you debug your application, periodically perform a hot deployment. A hot deployment updates a running instance of your application but does not package new dependencies, such as new connector dependencies in your `pom.xml`. To perform a hot deploy: 1. Ensure your Mule application is running. 2. Make an update to your application. 3. In the editor toolbar for the running Mule application, click **Save and Hot-deploy to Mule Runtime** (lightning bolt icon) to push the change to the running runtime without a full stop and dependency resolution cycle. ## Stop a Debug Session To stop your debug session, use **Stop** on the debug toolbar (Shift+F5), or open **Run and Debug** and choose the stop action for the active Mule session. The status bar no longer indicates that the application is running. ## See Also - [Predefined Variables](https://docs.mulesoft.com/dataweave/latest/dataweave-variables-context) - [Using DataWeave Expressions and Transformations in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions) --- product: Anypoint Code Builder version: master --- # Defining and Securing Properties for a Mule Application > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Define configuration properties to secure and customize your Mule application configuration for different deployment environments. - Encrypt sensitive values used in your Mule application. - Define and use variables instead of literal strings when setting values in the configuration XML. - Configure a variable for selecting different property files for a specific deployment environment, such as development, sandbox, or production. ![Diagram showing secure properties flow from runtime argument to global-configs.xml to encrypted properties file to flow references](/mulesoft/current/en-us/anypoint-code-builder/_images/int-secure-properties-overview-diagram.png) Figure 1. How secure properties work For a guided, conversational approach to setting up secure properties, use MuleSoft Vibes. For additional information, see [Working with Secure Properties Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-secure-properties). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create an integration](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ## Configuration Properties and Encryption Before following step-by-step procedures for encrypting properties or deploying applications that use them, learn the basics: - [Encryption with the MuleSoft Secure Properties Tool](#encryption-tool) - [Configuration Properties Files](#properties) - [References to Properties and Property Files in the Configuration XML](#reference-use) ### Encryption with the MuleSoft Secure Properties Tool To encrypt sensitive data, download the [Secure Properties Tool Jar file](https://docs.mulesoft.com/mule-runtime/latest/secure-configuration-properties#secure_props_tool). The tool accepts the following algorithms: - AES - Blowfish - DES - DESede - RC2 - RCA The tool accepts the following ciphers: - CBC (default) - CFB - ECB - OFB For step-by-step instructions on encrypting properties in a Mule application, see [Encrypt Sensitive Values](#encrypt). ### Configuration Properties Files Connectors and components in the Mule configuration XML accept variables for sensitive and non-sensitive data. The variables are defined in a `.yaml` or Spring-formatted `.properties` file that you create and store in the `src/main/resources` directory of the project for your Mule application, for example:
Unencrypted Values for All KeysEncrypted Values of uname and pw Keys
ftp:
  workingDir: /Users/me/myworkingdir
  host: localhost
  uname: myusername
  pw: mypassword
ftp:
  workingDir: /Users/me/myworkingdir
  host: localhost
  uname: "![UqoJI2fvggE=]"
  pw: "![n2LDIOKKxhQ5Tdv5AeCtFQ==]"
You can create separate properties files for your unencrypted and encrypted properties, for example, in a YAML file:
Unencrypted Values of workingDir and host KeysEncrypted Values of uname and pw Keys
dev.properties.yaml content:
ftp:
  workingDir: /Users/me/myworkingdir
  host: localhost
dev.secure.yaml content:
ftp:
  uname: "![UqoJI2fvggE=]"
  pw: "![n2LDIOKKxhQ5Tdv5AeCtFQ==]"
In a Spring-formatted `.properties` file, the same configurations are:
Unencrypted Values of workingDir and host KeysEncrypted Values of uname and pw Keys
dev.properties content:
ftp.workingDir=/Users/me/myworkingdir
ftp.host=localhost
dev.secure.properties content:
ftp.uname=![UqoJI2fvggE=]
ftp.pw=![n2LDIOKKxhQ5Tdv5AeCtFQ==]
For step-by-step instructions, see [Encrypt Sensitive Values](#encrypt). To provide property settings for different environments, such as production and development environments, create separate properties files for your environments. For instructions, see [Provide Settings for Different Environments](#create-prop-file). > [!TIP] Don’t hardcode production credentials directly in a global element or configuration XML > file. Instead, reference credentials through a properties file so you can pass the correct > environment’s values, encrypted where needed, at deployment time. ### References to Properties and Property Files in the Configuration XML Reference property files and use property values in the configuration XML: - If your properties file does not contain _any_ encrypted properties: - Use this syntax to reference the property value: `${property-key}` - Use this global element to reference the file: `` For example, assuming that the `port: "8081"` property is in the properties file `ports.yaml`, use `${port}` as the value of the `port` attribute in ``: ```xml ``` - If your properties file contains _any_ encrypted properties: - Use this syntax to reference the property value: `${secure::property-key}` - Use this global element to reference the file: `` This FTP example references `dev.secure.yaml` with ``, and uses the `secure::` prefix to reference all properties in that properties file: ```xml ... ``` For step-by-step instructions with encrypted values, see [Use Encrypted Properties](#use). ## Encrypt Sensitive Values Use the Secure Properties Tool to encrypt sensitive data that you add to properties files for your Mule application. Example with properties file `dev.secure.yaml` in the project workspace of a Mule application: ![Project Directory for a Mule Application Workspace](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-project-directory.png) 1. Create a properties file with _unencrypted_ properties: 1. Open the `src/main/resources` directory of your project. 2. Create a YAML file with a name like `dev.secure.yaml` or `local.secure.yaml` that configures properties as key-value pairs, for example: ```yaml myprop: "somevalue" mysensitiveprop: "mysensitivevalue" ``` For more guidance, see [Configuration Properties Files](#properties). 2. Encrypt sensitive properties: 1. Download the [Secure Properties Tool Jar file](https://docs.mulesoft.com/mule-runtime/latest/secure-configuration-properties#secure_props_tool). 2. From the command line, run the Secure Properties Tool on the values you intend to secure. Example that encrypts `"mysensitivevalue"` using Blowfish and `my-key-value` for an encryption key password: ```terminal $ java -cp secure-properties-tool-j17.jar com.mulesoft.tools.SecurePropertiesTool \ string \ encrypt \ Blowfish \ CBC \ my-key-value \ "mysensitivevalue" ``` Encrypted Output: ```terminal /MU0/xB/zoMPjxBA7/9X44Ad2H8O8AY5 ``` > [!IMPORTANT] Store your encryption key value (password) in a secure location. You’ll need > your key value later, when you deploy your application. > [!TIP] To verify an encrypted value, decrypt it using the same tool with the `decrypt` > command instead of `encrypt`: ```terminal $ java -cp secure-properties-tool-j17.jar com.mulesoft.tools.SecurePropertiesTool \ string \ decrypt \ Blowfish \ CBC \ my-key-value \ "/MU0/xB/zoMPjxBA7/9X44Ad2H8O8AY5" ``` 3. In your properties file, add each encrypted property value within `![]` brackets. Example that replaces the unencrypted value `"mysensitivevalue"` with the encrypted value `"![/MU0/xB/zoMPjxBA7/9X44Ad2H8O8AY5]"`: ```yaml myprop: "somevalue" mysensitiveprop: "![/MU0/xB/zoMPjxBA7/9X44Ad2H8O8AY5]" ``` For more guidance, see [Configuration Properties Files](#properties). ## Use Encrypted Properties Add encrypted properties to components in a Mule application. Reference a properties file with ``, and run a local deployment that decrypts your properties. For reference, the examples shown in the steps in this procedure are based on these configuration examples: Configuration XML (`my-secure-integration.xml`) ```xml ``` Properties file (`dev.secure.yaml`) The configuration XML uses these properties. ```yaml myprop: "somevalue" mysensitiveprop: "![/MU0/xB/zoMPjxBA7/9X44Ad2H8O8AY5]" ``` POM file (`pom.xml`) The POM file includes dependencies for the components in the configuration XML. ```pom 4.0.0 com.mycompany my-secure-integration 1.0.0-SNAPSHOT mule-application my-secure-integration UTF-8 UTF-8 3.3.5 org.apache.maven.plugins maven-clean-plugin 3.1.0 org.mule.tools.maven mule-maven-plugin ${mule.maven.plugin.version} true anypoint-exchange-v2 Anypoint Exchange https://maven.anypoint.mulesoft.com/api/v2/maven default mulesoft-releases MuleSoft Releases Repository https://repository.mulesoft.org/releases/ default mulesoft-releases mulesoft release repository default https://repository.mulesoft.org/releases/ false com.mulesoft.services mule-service-weave-ee 2.4.0-20221212 runtime com.mulesoft.modules mule-secure-configuration-property-module 1.2.5 mule-plugin ``` To use an encrypted value in a Mule application: 1. Before the `` element in the configuration XML, add the following Secure Configuration Properties configuration (``): ```xml ... ``` 2. Optionally change the `algorithm` attribute to select another algorithm: ![List of supported algorithms in Secure Configuration Properties module.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-secure-config-algorithms.png) 3. Configure the element with values for the `file`, `key`, and `algorithm` attributes, for example: ```xml ``` - `file`: Name of your properties file If you want to use the variable `${env}` in your filename configuration, see [Provide Settings for Different Environments](#create-prop-file) for the procedure. - `name`: A name of your choice for the encryption key (defaults to `${encryption.key}`) This name serves as the key for the encryption value (password) used to encrypt your secure properties with the Secure Properties Tool. - `algorithm`: Algorithm you used to encrypt your secure properties (defaults to Blowfish in the previous example). Other [algorithms](#algorithms) are available. 4. In the connector or component XML, add the key of an encrypted property as the value of an XML attribute, for example: ```xml ``` Notice the `secure::` prefix to the key. ## Edit Secure Properties Configuration via Global Elements Add, edit, or delete a secure properties configuration from **Global Elements**. To add one, click **New Configuration** and select the secure properties type. To delete one, click the **More actions** (**…​**) menu next to the element and select **Delete**. To edit the secure properties configuration: 1. Open **Project Properties** > **Global Elements**. ![Global Elements with a list of configurations including Secure Properties Config.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-global-elements-panel-list.png) 2. Select **global-configs.xml** from the **Selected File** dropdown. 3. Find **Secure Properties Config** in the list. 4. Click **More actions** (**…​**) in the configuration name. 5. Click **Edit**. The editor opens and you can modify these fields. ![Form editor showing configurable fields for Secure Properties Config.](/mulesoft/current/en-us/anypoint-code-builder/_images/int-secure-properties-form-editor.png)
FieldExample ValueWhat It Controls

Name

Secure_Properties_Config

Element name referenced internally

File

$site.secure.properties

Which encrypted file to load (resolves per environment)

Key

${encryption.key}

The decryption key placeholder (resolved from system property)

Algorithm

AES

Encryption algorithm (AES, Blowfish, DES, DESede, RC2)

Mode

CBC

Cipher mode (CBC, CFB, ECB, OFB)

Changes you make in the editor automatically update the XML in `global-configs.xml`. The editor manages the configuration element. To change the actual encrypted values in `.secure.properties` files, use the secure-properties-tool JAR, edit the file directly, or ask MuleSoft Vibes to re-encrypt values. See [Working with Secure Properties Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-secure-properties). ## Test Encrypted Properties in Anypoint Code Builder If your application uses encrypted properties, add arguments for the encryption key and value to the runtime command. Adding these arguments to the setting enables the runtime to decrypt properties used in your application so that it deploys successfully to the local runtime. The setting avoids an error that causes the deployment to fail when you use **Run and Debug**: Couldn't find configuration property value for key ${encryption.key} from properties provider environment properties provider 1. Provide a local key-value pair for your encryption key name and its value through the UI: 1. Navigate to **Manage** (gear icon) > **Settings**, and find **Runtime: Default Arguments** on the **Settings** page. 2. In the **Runtime: Default Arguments** field, append the key-value pair for your encryption key to the _end_ of the configuration, for example: ```key-configuration -M-Dencryption.key=my-key-value ``` In the example, `-M-D` is the required prefix, `encryption.key` is the default name of the encryption key, and `my-key-value` is the value used to encrypt the properties through the Secure Properties Tool. 3. If you are using a variable such as `${env}` in `${env}.secure.yaml` to identify the properties file in ``, append a value for `${env}` to the **Runtime: Default Arguments** field. For example, for a file `dev.secure.yaml` that contains properties for the development environment: ```env-configuration -M-Denv=dev ``` 2. Deploy the application locally by pressing Cmd+shift+p (Mac) or Ctrl+shift+p (Windows), and entering **View: Show Run and Debug**, then clicking **Run and Debug**. A successful deployment produces the following message in the **OUTPUT** tab of the output panel: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* - - + DOMAIN + - - \* - - + STATUS + - - \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* default \* DEPLOYED \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* For information about the output panel, see [Viewing Logs and Errors](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel). If the application does not deploy successfully, check the console for the error and troubleshoot. 3. If you intend to deploy your application to CloudHub or CloudHub 2.0, proceed to [Deploy to CloudHub and CloudHub 2.0 with Sensitive Values Hidden](#deploy-to-cloudhub). This procedure shows how to hide the encryption key value in Runtime Manager. ## Deploy to CloudHub and CloudHub 2.0 with Sensitive Values Hidden When you deploy an application that you build with Anypoint Code Builder to CloudHub or CloudHub 2.0, hide the value of your encryption key to prevent Runtime Manager UI from displaying the value (see [Manage Properties for Applications on CloudHub](https://docs.mulesoft.com/cloudhub/cloudhub-manage-props)). Runtime Manager serves as the management console for CloudHub and CloudHub 2.0 deployments. The encryption key value serves as the password for encryption and decryption. > [!IMPORTANT] This procedure configures the _name_ of your encryption key but not its value in > `mule-artifact.json`. For security, never configure the _value_ of your encryption key in this or > any other file that is packaged within a deployed project. Before you begin: - Run and test encrypted properties used by your Mule application. See [Configuration Properties Files](#properties) for guidance. To hide sensitive values from the Runtime Manager UI when you deploy to CloudHub or CloudHub 2.0: 1. In the `mule-artifact.json` file for your application, provide the _name_ of the encryption key (`encryption.key` by default) that you provided in the global `` element within your configuration XML, for example: { "minMuleVersion": "4.8", "javaSpecificationVersions": \[ "17" \], "secureProperties": \["encryption.key", "other.value.to.hide"\] } The _name_ (not the _value_) of your encryption key goes into a comma-separated `secureProperties` array. Later in this procedure, when you deploy your application to CloudHub, Anypoint Code Builder prompts you to provide the _value_ of the encryption key that you provided through the Secure Configuration Tool when encrypting your sensitive properties. 2. Deploy your application to CloudHub or CloudHub 2.0 by pressing Cmd+shift+p (Mac) or Ctrl+shift+p (Windows) and providing this command: ```command MuleSoft: Deploy to CloudHub ``` Alternatively, click the **Deploy to CloudHub** (rocket) icon when your configuration XML file is open, for example: ![Deploy to CloudHub rocket icon](/mulesoft/current/en-us/anypoint-code-builder/_images/deploy-to-cloudhub-icon-with-detail.png) 3. When prompted, enter _the same value_ you used to encrypt your secure properties. If you do not enter the same value, the application is able to upload to CloudHub or CloudHub 2.0, but the deployment fails because the encryption key value does not work. 4. Select the **Sandbox** environment for your deployment. Other environments are not supported, and attempts to deploy to the **Design** environment fail with a `500` error code. While the deployment is in progress, Anypoint Code Builder provides the status of the process and prompts you to open the application in Runtime Manager when the deployment completes. If you receive an error message that says the application `was not successfully deployed to "Sandbox" in CloudHub`, you can open Runtime Manager to check the logs and correct some issues. 5. Click **Open in Runtime Manager** to open the management options for the application in Runtime Manager. 6. Check the deployment in Runtime Manager to ensure that the encryption key is hidden by navigating to **Settings** > **Properties** for your application. 7. In the **Applications** screen for the **SANDBOX** environment, check the **Status** field for your application: - If the status is **Started**, the deployment is successful, and the application is running. - If the status is **Deploy failed**, click the name of your application, and navigate to **Logs** to discover the cause of the failure. If the encryption key value is wrong, the error is `org.mule.encryption.exception.MuleEncryptionException: Could not encrypt or decrypt the data.` To fix this error: 1. Navigate to **Settings** > **Properties** for your application in Runtime Manager and provide the correct value for your encryption key in the field for the encryption key. 2. Click **Apply Changes**. Runtime Manager applies your changes and attempts to deploy your application. For more information, see [Anypoint Runtime Manager](https://docs.mulesoft.com/runtime-manager/). For information about CloudHub, see [CloudHub Overview](https://docs.mulesoft.com/cloudhub/). For information about CloudHub 2.0, see [CloudHub 2.0 Overview](https://docs.mulesoft.com/cloudhub-2/) ## Provide Settings for Different Environments Hosts, ports, directories, and other settings in the configuration XML often differ depending on the target environment for your deployment, such as the development, sandbox, or production environment. For example, on your desktop, the host name is typically `localhost`, the port something like `8081`, and the directory is a path on your local machine rather than a path to an external host. When developing your application, create separate properties files for each of the target environments that require different settings, and provide the appropriate settings in each file. Typical filenames follow patterns like these: - `dev.properties.yaml` or `dev.secure.yaml` for your development environment - `sandbox.properties.yaml` or `sandbox.secure.yaml` for a pre-production environment - `prod.properties.yaml` or `prod.secure.yaml` for the production environment Consistent filename patterns enable you to use a `${env}` variable in your configuration XML for the prefix to the filename, for example, `${env}.properties.yaml` or `${env}.secure.yaml`. This pattern enables you to switch to the file that contains settings for the environment in which your application runs. You can include encrypted and unencrypted property values in the files. To configure and use the `env` variable as a prefix to a filename: 1. Using a consistent filename pattern, create properties files for each environment that requires different settings. 2. If you are using the `` or another element that points to your properties file, provide a prefix, such as `${env}`, to the file name. Notice the value of the `file` attribute in this example: ```xml ``` 3. _Before deploying to CloudHub or CloudHub 2.0_, ensure that the application deploys locally: 1. Press Cmd+shift+p (Mac) or Ctrl+shift+p (Windows), and provide this command: ```command Open 'launch.json' ``` 2. In `launch.json`, append the value of the `env` variable to use when running the application. Notice the setting `-M-Denv=dev` in this `launch.json` example. For more information about launch configurations and alternative methods for passing properties, see [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties). ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug Mule Application", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=dev" } ] } ``` `-M-Denv=dev` sets the `env` variable to `dev` as a Mule runtime argument (`"mule.runtime.args"`). 3. If your application defines encrypted properties in your properties file, configure the **Runtime: Default Arguments** command with the encryption key and value so that the local deployment can decrypt the properties when the application runs. _Do not_ configure `launch.json` with sensitive property values. See [Test Encrypted Properties in Anypoint Code Builder](#test-deploy) for guidance with the recommended configuration. 4. Launch the `deploy.json` file for your application by pressing Cmd+shift+p (Mac) or Ctrl+shift+p (Windows) and providing this command: ```command MuleSoft: Deploy to CloudHub ``` Alternatively, click the **Deploy to CloudHub** (rocket) icon when your configuration XML file is open, for example: ![Deploy to CloudHub rocket icon with deploy.json open](/mulesoft/current/en-us/anypoint-code-builder/_images/deploy-to-cloudhub-icon-with-deploy-json.png) 5. _Before opting to deploy_, edit `deploy.json` to specify the correct prefix to your properties file, for example: ```deploy.json { "runtime": "4.4.0", "workerSize": 0.1, "applicationName": "my-secure-int2-duke", "workers": 1, "autoStart": true, "properties": (1) { "env": "sandbox" (2) } } ```
1Add the "properties" key.
2Add an object that specifies the value of the ${env} prefix to your properties file, such as sandbox.
6. If prompted, enter _the same value_ you used to encrypt your secure properties. 7. Select the **Sandbox** environment for your deployment. 8. Once the deployment is complete, click **Open in Runtime Manager** to open the management options for the application in Runtime Manager. 9. To check for properties such as your `env` setting or a hidden value to your encryption key, click **Settings** > **Properties** for your application. You can create properties or change the value of existing properties, for example, to fix some deployment errors. ## Quick Reference Use this table for quick access to common secure properties tasks and commands:
TaskCommand / Location

Encrypt a value

java -cp secure-properties-tool-j17.jar com.mulesoft.tools.SecurePropertiesTool string encrypt AES CBC <key> <value>

Decrypt a value

java -cp secure-properties-tool-j17.jar com.mulesoft.tools.SecurePropertiesTool string decrypt AES CBC <key> <encrypted-value>

Reference encrypted property in XML

${secure::property.name}

Reference non-encrypted property in XML

${property.name}

Secure properties config element

<secure-properties:config file="$site.secure.properties" key="${encryption.key}">

Pass encryption key locally

Add -M-Dencryption.key=YourKey to mule.runtime.args in launch.json

Pass encryption key in CloudHub

Add to Properties tab in Runtime Manager: encryption.key=YourKey

Switch environment

Pass -M-Denv=qa or -M-Denv=prod as runtime argument

Hide encryption key in CloudHub

Add encryption key name to secureProperties array in mule-artifact.json

## See Also - [Working with Secure Properties Using MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-secure-properties) - [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements) - [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties) - [Launch Configuration Properties Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-launch-json-properties) - [Secure Configuration Properties](https://docs.mulesoft.com/mule-runtime/latest/secure-configuration-properties) --- product: Anypoint Code Builder version: master --- # Deleting API Specs and Fragments > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Deleting API specs and fragments varies depending on the project creation date and project hosting. - To delete a design project hosted locally on Anypoint Code Builder, delete the entire project folder. - To delete a design project hosted on US cloud or EU cloud with an API spec imported from MuleSoft VCS, you must delete the project from MuleSoft VCS by accessing Design Center. - To delete a design project created with versions of Anypoint Code Builder released prior to February 2024 that required storage of the spec in the MuleSoft VCS, you must delete the project from MuleSoft VCS by accessing Design Center. - To delete a project hosted on JP cloud or CA cloud, you must use an Anypoint CLI command. > [!NOTE] You must delete the previous project to reuse the project name for a new design project in > Anypoint Code Builder. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Create a [spec](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) or [fragment](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments). ## Delete an API Spec from Anypoint Code Builder To delete an API project (API spec or API spec fragment) from Anypoint Code Builder: 1. In the Explorer view, right-click on the folder and select **File** > **Open Folder**. 2. Locate the folder for the project to delete. 3. Right-click and select to delete the folder. ## Delete an API Design Project API design projects [imported to Anypoint Code Builder from Design Center](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#import-spec) or created in Anypoint Code Builder before the February 2024 release automatically connect to MuleSoft VCS, which enables you to sync with a corresponding design project. Design project names must be unique. To create a new design project with a name already used in Anypoint Code Builder, you must delete the existing project. To delete an API project (API spec or API spec fragment) from Anypoint Code Builder: 1. In Anypoint Code Builder, [delete the spec](#delete-spec). To delete a design project from Design Center: 1. Navigate to Anypoint Platform and log in using your credentials. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) 2. Select **Design Center** from the navigation panel. 3. Select **API Projects** from the navigation panel. 4. Select the project and click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-dc-delete-project.png) (**Delete Project**) icon. To delete a design project by using Anypoint CLI: 1. Run this command: designcenter:project:delete \[flags\] For more information, see [delete design projects using Anypoint CLI](https://docs.mulesoft.com/anypoint-cli/latest/design-center#designcenter-project-delete). ## See Also - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) - [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) - [About Design Center](https://docs.mulesoft.com/design-center/) --- product: Anypoint Code Builder version: master --- # Deploy the American Flights API to CloudHub 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After implementing, debugging, and testing your API locally, you’re ready to deploy it to CloudHub 2.0. CloudHub 2.0 is MuleSoft’s cloud-based integration platform that lets you deploy, manage, and scale your Mule applications without managing infrastructure. In this section, you deploy your American Flights API to CloudHub 2.0. You configure it in API Manager, apply a security policy, and monitor its performance using Runtime Manager in the pages that follow. CloudHub 2.0 provides a fully managed, containerized deployment environment for your Mule applications. Deploying from Anypoint Code Builder is a streamlined process that packages your application and deploys it directly to the cloud. See [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps) for more information about CloudHub and CloudHub 2.0 deployment concepts. ## Prerequisites for Deployment Before deploying to CloudHub 2.0, verify that you have: - A CloudHub 2.0 account with available vCores (virtual cores) for deployment. - Runtime Manager permissions to read, create, and delete applications. - An application that passes all MUnit tests. - An application that runs successfully in debug mode locally. ## Configure Deployment Settings and Deploy Your Project The first time you deploy an application to CloudHub 2.0, Anypoint Code Builder creates a deployment settings file. After modifying the deployment settings, deploy your project with those settings. 1. In the project explorer, Right-click the American Flights project XML file and select **Mule > Deploy Mule Project to CloudHub**. 2. If prompted, sign in to Anypoint Platform. 3. Select **CloudHub 2.0**. 4. Select a deployment target, for example: Cloudhub-US-East-1 - Shared Space. 5. Select an environment, for example: **Sandbox**. If there’s no deployment settings file for the project, Code Builder creates one. 6. Edit the deployment configuration file and provide the following information:
Field NameField Value

applicationName

Enter a unique name for your deployment (for example, american-flights-api-yourname). This name must be unique across all CloudHub deployments.

runtime

Confirm the Mule runtime version (the latest compatible version is selected by default).

replicas

1. The number of replica instances to deploy.

replicaSize

0.1. The compute capacity (vCores) allocated to each replica.

deploymentModel

Leave the default value: rolling.

7. Click **Deploy** in the notification pop-up. If the notification is no longer visible, restart the deployment from the first step. 8. Select the Mule version to use for the deployment. 9. If prompted to select an asset version, leave the default value and press Enter. > [!NOTE] Worker size and count affect your CloudHub 2.0 costs. For this tutorial, use 0.1 vCores > with 1 worker, which are the minimum allowed values. The deployment process starts and usually takes from two to five minutes. After this period, look for an ACB notification with a message similar to this: `The 'american-flights-api-implementation' project was published to the 'Sandbox' environment in CloudHub 2.0 'Cloudhub-US-East-1 - Shared Space'. The deployment is now processing. Monitor its progress in Runtime Manager.` ## Monitor the Deployment Process After initiating the deployment, open Runtime Manager to monitor the status. 1. In the notification that shows after deployment starts, click **Open Runtime Manager** and then click **Open**. Alternatively, if you missed the notification, open [Runtime Manager](https://docs.mulesoft.com/runtime-manager/) and search for your application name. Then, click the application name to open its status page. 2. Confirm the **Application status** is **Running**. If the application is still deploying and shows status **Not Running**, wait a few minutes for the process to finish. ## Verify Your Deployed Application Once deployed, verify that your API is accessible and functioning correctly. 1. In Runtime Manager, copy the application URL from the **Public endpoint** value. The URL is similar to this: `[https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e1.cloudhub.io](https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e1.cloudhub.io)` 2. In your REST client, test the deployed API by making a GET request to your endpoint and adding `/api/flights` to the URL. For example: ```command GET https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/api/flights ``` Replace the URL from the example with your actual endpoint URL. 3. Verify that you receive a `200 OK` response with the flight data. 4. Test additional endpoints: ```command GET https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/api/flights/AA123 ``` > [!TIP] Save your application URL for use in the next sections where you configure API Manager and > apply policies. [Test the American Flights API with MUnit](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-munit-test-api) [Manage, Secure, and Monitor the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-manage-secure-monitor-api) --- product: Anypoint Code Builder version: master --- # Deploying Mule Apps to CloudHub and CloudHub 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You can use Anypoint Code Builder to deploy your Mule application to CloudHub. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create an integration](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). - Install a REST client, such as Postman or AdvancedRestClient. ## Deploy an App to CloudHub or CloudHub 2.0 When you deploy an application to CloudHub or CloudHub 2.0, Anypoint Code Builder configures a default `deploy.json` or `deploy_ch2.json` file in your `src/main/resources` directory. If you intend to configure properties at deployment time, for example, to [create secure properties](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs), Anypoint Code Builder prompts you to modify `deploy.json` or `deploy_ch2.json` during the deployment process. > [!NOTE] For CloudHub 2.0 deployments, you must update your `pom.xml` file: > > - Modify `groupId` to match your Anypoint Platform business group (organization) ID. > > For more information, see > [Finding your Business Group ID](https://docs.mulesoft.com/access-management/managing-business-groups#find-business-group-id). > > - Remove the `-SNAPSHOT` suffix from `version`. > > - Increment `version` when redeploying. To deploy your app to CloudHub or CloudHub 2.0: 1. Open any configuration XML file for the Mule app to deploy. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-deploy.png) (**Deploy to CloudHub**) icon. Alternatively, open the Command Palette and select `MuleSoft: Deploy to CloudHub`. 3. If prompted, click **Allow** to allow sign in using Anypoint Platform and select the business group. 4. Select a Business Group to use for deployment. 5. When prompted via the VS Code command palette, select the deployment target: **CloudHub 2.0** or **CloudHub 1.0**. If you select CloudHub 2.0, you are prompted to select the space to deploy your application, for example: “myprivspace”. If the project doesn’t already have a `deploy.json` or `deploy_ch2.json` file, Anypoint Code Builder indicates that a deployment configuration file has been created and opens it for you to review, for example: ![Review deploy.json file](/mulesoft/current/en-us/anypoint-code-builder/_images/int-deploy-json-desktop.png) For applications deployed to CloudHub 2.0, ensure that the deploy\_ch2.json file contains the value for the deployment model. You can set this to the default value of **rolling**. The `applicationName` property defines part of the URL that you use to access your application on CloudHub. This name must be unique across all applications deployed to CloudHub. 6. After reviewing the deployment configuration, click **Deploy** to deploy the application to CloudHub or CloudHub 2.0. The VS Code status bar shows the progress of the deployment. 7. At the prompt, select the environment to deploy to. Anypoint Code Builder packages the application and deploys it to CloudHub or CloudHub 2.0. The Output panel opens with **Mule Maven Output** selected: ![Output panel with Mule Maven Output selected](/mulesoft/current/en-us/anypoint-code-builder/_images/int-deploy-output.png) 8. After deployment completes, click **Open in Runtime Manager**. Your app opens in Runtime Manager in Anypoint Platform. The domain name of the application varies, but it follows a similar structure such as: `app-with-40-schedulers.us-w1.cloudhub.io`. 9. Open your preferred REST client and make a GET request to the domain name as displayed in Runtime Manager, for example, `http://app-with-100-schedulers.us-w1.cloudhub.io/api/flights`. ## Change a Value in deploy.json Use auto-complete to select a preconfigured value in `deploy.json` or `deploy_ch2.json`. 1. Open `deploy.json` or `deploy_ch2.json` from the Explorer. The file is located in the project’s `src/main/resources` directory. The file opens to a **deploy.json** or **deploy.json\_ch2** tab. 2. In `deploy.json` or `deploy_ch2.json`, highlight the value to update. 3. Press Ctrl+Space. 4. Select a different value. ## Deployment Properties The `deploy.json` and `deploy_ch2.json` files contain the following properties for deployments of Mule applications to CloudHub and CloudHub 2.0, respectively, from Anypoint Code Builder.
PropertyDescriptionHost

runtime

Provides the Mule runtime version used by the project.

CloudHub or CloudHub 2.0

workersize

Sets the worker memory relative to a single worker or a number of available workers. The default is 0.1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

replicaSize

Sets the replica specific amount of memory capacity and processing power. The default value is 0.1. For more information, see CloudHub 2.0 Replicas in the CloudHub 2.0 documentation.

CloudHub 2.0

applicationName

Provides the hyphenated, lowercase name of the Mule application.

CloudHub or CloudHub 2.0

workers

Sets the number of Mule runtime instances for running this Mule application. The default is 1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

replicas

Sets dedicated instances of Mule runtime engine for running this Mule application. The default is 1. For more information, see CloudHub 2.0 Replicas in the CloudHub 2.0 documentation.

CloudHub

autoStart

Indicates whether to start the application automatically after the deployment process completes. The default value is true.

CloudHub or CloudHub 2.0

deploymentModel

Indicates the model by which you want the replicas of your application to be updated or redeployed. The default value is rolling. For more information, see Rolling Update vs. Recreate Deployment Model in the CloudHub 2.0 documentation.

CloudHub 2.0

ObjectStoreV2

Indicates whether Object Store v2 is enabled for this application. The default value is true. For more information, see Object Store v2 Overview

CloudHub or CloudHub 2.0

## See Also - [Deploy to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub) - [Deploying Apps to CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-deploy) - [Anypoint Runtime Manager](https://docs.mulesoft.com/runtime-manager/) --- product: Anypoint Code Builder version: master --- # Deployment Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt In Anypoint Code Builder, the error `Failed to deploy to CloudHub: 400` occurs when you deploy a Mule application to CloudHub if the root organization or business group to which you are deploying lacks a sufficient vCore allocation. To address this isssue, increase the vCore allocation to the root organization or business group in the **Sandbox** environment: - To reallocate resources, see [Redistribute Resources Between Existing Business Groups](https://docs.mulesoft.com/access-management/business-groups#redistribute-resources). - To manage environments, see [Anypoint Platform Environments](https://docs.mulesoft.com/access-management/environments). For additional help, contact your organization administrator for Anypoint Platform. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Deployment Properties for Mule Applications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When deploying a Mule application to CloudHub, Anypoint Code Builder relies on a configuration in `deploy.json`. Mule applications are integration or implementation projects. Example: { "runtime": "4.7-e-java17", "workerSize": 0.1, "applicationName": "my-integration-app", "workers": 1, "autoStart": true } The `deploy.json` and `deploy_ch2.json` files contain the following properties for deployments of Mule applications to CloudHub and CloudHub 2.0, respectively, from Anypoint Code Builder.
PropertyDescriptionHost

runtime

Provides the Mule runtime version used by the project.

CloudHub or CloudHub 2.0

workersize

Sets the worker memory relative to a single worker or a number of available workers. The default is 0.1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

replicaSize

Sets the replica specific amount of memory capacity and processing power. The default value is 0.1. For more information, see CloudHub 2.0 Replicas in the CloudHub 2.0 documentation.

CloudHub 2.0

applicationName

Provides the hyphenated, lowercase name of the Mule application.

CloudHub or CloudHub 2.0

workers

Sets the number of Mule runtime instances for running this Mule application. The default is 1. For more information, see CloudHub Workers in the CloudHub documentation.

CloudHub

replicas

Sets dedicated instances of Mule runtime engine for running this Mule application. The default is 1. For more information, see CloudHub 2.0 Replicas in the CloudHub 2.0 documentation.

CloudHub

autoStart

Indicates whether to start the application automatically after the deployment process completes. The default value is true.

CloudHub or CloudHub 2.0

deploymentModel

Indicates the model by which you want the replicas of your application to be updated or redeployed. The default value is rolling. For more information, see Rolling Update vs. Recreate Deployment Model in the CloudHub 2.0 documentation.

CloudHub 2.0

ObjectStoreV2

Indicates whether Object Store v2 is enabled for this application. The default value is true. For more information, see Object Store v2 Overview

CloudHub or CloudHub 2.0

## See Also - [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps) --- product: Anypoint Code Builder version: master --- # Design and Publish the American Flights API Specification > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Design the American Flights API specification in Anypoint Code Builder, test it with the built-in mocking service, and publish it to Anypoint Exchange so other team members can find and implement it. Before you begin, complete the setup in [Build an API from Start to Finish with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-api-tutorial). ## Create the API Specification Start creating the American Flights API spec: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon in the VS Code activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-acb-activity-bar-icon.png) 2. From **Create**, click **Design an API**. 3. Configure your API spec project using these values:
Field NameField Value

Enable this API for Topics and Actions

Select this checkbox to add the applicable agent topic metadata and apply centralized governance rulesets to the project. See Enabling an API Project for Topics and Agent Actions for more information.

Project Name

American Flights API

Project Location

Your home directory is selected by default. This is the root folder of your project, which acts as your workspace. Don’t select a different project directory for this API spec. See Adding Folders to Your Home Directory for more information.

API Type

REST API

API Specification Language

OAS 3.0 (YAML)

Business Group

Select the business group to use for this project.

4. Click **Create Project** to generate the American Flights API project file: `american-flights-api.yaml`. The file name is based on the project name you provide. 5. Configure the agent topic metadata and instructions by setting these values:
Field NameField Value

Topic Label

American Flights API

Classification Description

Use the API description.

Scope

Your job is only to book, update, or retrieve flight information.

Instruction

If a user asks to retrieve flight details, use the get flight operation to retrieve information using the booking ID.

If you don’t see the **Agent Topics** after creating the project, you must trust the workspace folder. You can do so by clicking **Manage** then **Trust** from the notification that shows. ![The workspace trust notification with Manage and Trust options](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-restricted-banner.png) > [!TIP] If you closed the notification, or it doesn’t show, see: > [Trusting a workspace](https://code.visualstudio.com/docs/editing/workspaces/workspace-trust#_trusting-a-workspace) > for instructions. 6. Click **Apply** to save your changes. 7. In the activity bar, click the MuleSoft Vibes icon. ![MuleSoft Vibes icon in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-open-vibes.png) 8. Enable auto-approve by clicking the **Auto-approve** section at the end of the MuleSoft Vibes window, and then select: - **Read project files** - **Edit project files** - **Execute safe commands** - **Use MCP Servers** ![Auto-approve panel with Read project files, Edit project files, Execute safe commands, and Use MCP servers checkboxes selected](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-vibes-auto-approve.png) With auto-approve enabled, MuleSoft Vibes automatically applies changes to your project without prompting you for confirmation. See [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) for more information. 9. Enter this prompt, and then send your message: ```command Create an OAS 3.0 API specification example for the American Flights API that returns flight information from a MySQL database. The API must define: 1. A GET /flights endpoint that retrieves all flights. 2. A GET /flights/(flightId) endpoint that retrieves a single flight by its flightId path parameter. The flightId must match the pattern ^[A-Z]{2}[0-9]{1,4}$. 3. Both endpoints must return flight objects with this exact structure: ID (integer), code (string), price (number), departureDate (string), origin (string), destination (string), emptySeats (integer), and a nested plane object with type (string) and totalSeats (integer). ``` MuleSoft Vibes generates the spec and saves it to your file. ![The american-flights-api.yaml file open in the editor showing the generated OAS 3.0 specification](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-generated-spec.png) > [!TIP] If you get an `API streaming failed` error, click **Resume Task** to retry creating the > spec. > If you see this message: `The model has determined this command requires explicit approval.`, > click **Run Command**. ## Mock and Test the API Next, use MuleSoft Vibes and the built-in mocking service in the API Console to test the API before you publish it. Send this message to MuleSoft Vibes: ```command Test the API using the built-in mocking service in API console. ``` Alternatively, you can open the API Console and manually test the endpoints: 1. In the project explorer, open your API spec YAML file. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide this command: ```command MuleSoft: Show API Console ``` 4. Click **GET** in any of the endpoints. ![The american-flights-api.yaml file next to the API Console showing the Get all flights and Get a flight by ID endpoints](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-api-console.png) 5. Click **Try it** and then **Send**. The API Console shows an example response. Your API spec is now ready to publish to Anypoint Exchange. ## Publish the API Spec to Exchange Publish the American Flights API spec to Exchange so that other team members can find and implement it. Send this message to MuleSoft Vibes: ```command Publish the American Flights API specification to Exchange with asset version 1.0.0, API version v1, and asset ID american-flights-api. ``` If prompted, sign in to Anypoint Platform and select a business group. When asked to implement the API now, select **No** to avoid scaffolding the American Flights API spec into your integration. You scaffold the API in [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api). ### Manually Publish the API Spec to Exchange If you prefer not to use MuleSoft Vibes, publish the spec manually: 1. In the project explorer, open your API spec YAML file. 2. Click **Publish API Project to Exchange**. ![Publish API Project to Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-publish-to-exchange.png) - You can also provide this command in the command palette: ```command MuleSoft: Publish API Project to Exchange ``` 3. If prompted, click **Allow**, and follow the prompts to sign in to Anypoint Platform. 4. If you haven’t selected a business group, select one now in **Select a Business Group**. 5. Enter the asset version: `1.0.0`. 6. Enter the API version: `v1`. 7. Confirm the asset ID in the project metadata: `american-flights-api`. 8. Click **Publish**. The status bar shows the progress after the API is published successfully to Exchange. 9. When prompted to implement the API now, select **No** to avoid scaffolding the American Flights API spec into your integration. Selecting **Yes** scaffolds the API spec into your project. Instead of scaffolding now, you scaffold the API in [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api). ## Locate Your API in Exchange After publishing your API spec, you can find it in Anypoint Exchange: 1. Navigate to Anypoint Exchange. Show me how - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) 2. Type `american` in the search bar and press Enter. 3. Notice that your API spec is listed as an asset. You can select the API, navigate through its summary, and see all the endpoints you defined in the previous tasks. [Build an API from Start to Finish with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-api-tutorial) [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api) --- product: Anypoint Code Builder version: master --- # Designing a gRPC API Specification with Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder supports designing gRPC API specifications using Protocol Buffers 3 (Protobuf 3). Create and edit `.proto` files, import reusable Protobuf libraries from Anypoint Exchange, and use syntax highlighting and validation. gRPC uses HTTP/2 and supports four RPC patterns: - Unary - Client streaming - Server streaming - Bidirectional streaming You author service and message definitions in `.proto` files and can reuse shared types by importing Protobuf fragments (libraries) from Exchange. ## Before You Begin - [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Understand the basics of gRPC and Protocol Buffers (Protobuf 3). See [Introduction to gRPC](https://grpc.io/docs/what-is-grpc/introduction/) and the [Protocol Buffers 3 Language Guide](https://protobuf.dev/programming-guide/proto3/). - Have some familiarity with [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups). ## Create a New gRPC API Specification Project To create a gRPC API spec project in Anypoint Code Builder: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Create**, click **Design an API**: 3. Complete the **API Specification** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the API spec title in Exchange, the name of the spec file, and the name of the project’s root directory.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Type

The type of API spec to create.

Select gRPC API to create a gRPC project.

API Specification Language

The language for the API specification.

Select Protobuf 3 for gRPC API projects.

4. Click **Create Project**. If prompted, trust the authors of the files in the folder. When the project is ready, the API project opens with a default `.proto` file in the Editor view. 5. Continue designing your gRPC API spec. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (or press Ctrl+Space) to display available options within the context. ## Organize gRPC API Projects and Dependencies A new gRPC API project includes a root `.proto` file (for example, `main.proto` or a file named after your project) that defines your service and messages. Edit the main `.proto` file to define `service`, `rpc`, and `message` blocks. To reuse shared types, add new `.proto` files in the same project and import them. You can also add a Protobuf fragment as a dependency from Exchange and import it in your specification. ## Publish a gRPC Fragment to Exchange Publish reusable `.proto` definitions as a fragment to Anypoint Exchange so other gRPC API specifications can import them as dependencies. A fragment contains shared definitions such as `message` or `enum` blocks. ### Publish the Fragment To publish a gRPC fragment to Exchange: 1. Ensure that you’re logged in to Anypoint Platform. 2. Open the project that contains your reusable `.proto` files. 3. Select the publish action. 4. When prompted: - Select the business group. - Provide the asset name and version. - Add any required metadata. 5. Confirm the publication. After publishing, the fragment appears in Exchange as an API Fragment asset and can be added as a dependency to other gRPC API specification projects. To use the fragment in another gRPC API specification: 1. Add the fragment as a dependency from Exchange. 2. Import the corresponding `.proto` file in your main specification. 3. Validate that all references resolve correctly. ## Import a Protobuf Library from Anypoint Exchange Import reusable Protobuf libraries (fragments) from Anypoint Exchange and add them as dependencies to your gRPC API project. You can reuse messages and services across multiple specifications. To use a Protobuf fragment published to Exchange: 1. Ensure you’re logged in to Anypoint Platform. 2. Open your gRPC API project. 3. Open the Command Palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows). 4. Select **MuleSoft: Add Fragment dependency from Exchange**. 5. Search for the Protobuf fragment you need and select the version to add. 6. After the dependency is added, the library appears under **Project Dependencies** in Explorer. 7. In your main `.proto` file, use `import` to reference the library’s package and message or service definitions. For example: ```protobuf syntax = "proto3"; import "path/to/library.proto"; service MyService { rpc GetOrder(OrderRequest) returns (OrderResponse); } ``` 8. Save the spec. Anypoint Code Builder resolves the dependency and validates references. You can reuse messages and services from the imported library across your gRPC specs. ## Define Technical Details for gRPC Specifications Specify RPC communication patterns in your service definitions and use built-in validation to verify your Protobuf specification. ### Declare Communication Patterns for gRPC Services Anypoint Code Builder and Mule runtime support all four gRPC RPC patterns: - **Unary** – Single request, single response. - **Client streaming** – Client sends a stream of messages; server returns a single response. - **Server streaming** – Client sends a single request; server returns a stream of messages. - **Bidirectional streaming** – Both client and server send and receive streams of messages. Define these in your `.proto` file using the appropriate `rpc` declarations and stream modifiers. ### Verify Specification Accuracy with Syntax Validation Anypoint Code Builder provides syntax highlighting and validation for Protobuf 3 specifications. Validation is performed using the API Modeling Framework (AMF) parser, so you get inline feedback and error reporting as you edit your `.proto` files. Use the editor and the [output panel](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel) to track validation and scaffolding status. ## See Also - [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - [Implementing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-grpc-api-spec) - [Designing API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs) - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) - [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) - [Publishing Your gRPC API to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-grpc-api-to-exchange) - [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) - [Use Auto-Complete in the Editors](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#use-autocomplete) --- product: Anypoint Code Builder version: master --- # Designing API Specs and Fragments > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder to create, design, test, and publish new API specifications to Exchange. The process for designing API specifications is: 1. [Create or import and test your API specification](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) 2. [Optionally, create and add fragments to your specification](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments). 3. [Publish your API specifications to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). For source management options, see [SCM for API Design Projects](https://docs.mulesoft.com/anypoint-code-builder/start-scm#anypoint-scm). ## Supported Languages for API Specs Supported OAS and RAML versions are: - OAS 2.0 (JSON) - OAS 2.0 (YAML) - OAS 3.0 (JSON) - OAS 3.0 (YAML) - OAS 3.1 (JSON) - OAS 3.1 (YAML) - RAML 1.0 - RAML 0.8 Supported AsyncAPI versions are: - AsyncAPI 2.6 (JSON) - AsyncAPI 2.6 (YAML) For gRPC API specifications, Anypoint Code Builder supports Protocol Buffers (Protobuf 3). See [Designing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec). ## Supported Specification Languages for API Fragments Create, include, or reference API fragments within your API specification. Supported API specification languages and syntaxes for API fragments are: - OAS 3.0 and 3.1 - YAML - JSON - RAML 1.0 See the RAML 1.0 specification for descriptions of these types: - Trait - Resource - Library - Data Type - User Documentation - Example - JSON Schema - Avro 1.9.0 schema - gRPC fragments (Protobuf 3) Reusable Protobuf definitions (for example, `message` or `enum` types) published as API fragment assets. See [Publish a gRPC Fragment to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec#publish-a-grpc-fragment-to-exchange). ## Minimum Resource Requirements for Anypoint Code Builder When parsing an API specification, Anypoint Code Builder depends on your computer’s resources. To avoid issues, ensure that your computer has the following minimum resources available: - 8 GB RAM - Ryzen series 5 / Intel i5 CPU or higher To achieve optimal parser performance, keep the total project size for all files in your design project below 500 KB. A project size that exceeds 1.5 MB severely affects validation time. ## Best Practices To avoid common issues, follow these guidelines: - Divide your fragments into short, reusable dependencies when possible. - Keep only one version of the same dependency. - Keep only one browser tab open at a time. - Before designing an OAS or RAML API specification, review [OAS Specification Best Practices](#apid-best-practices-oas) or [RAML Specification Best Practices](#apid-best-practices-raml) ### OAS Specification Best Practices - Use the `$ref` property to define reusable components. To improve parsing efficiency, reference each component from the API specification instead of duplicating component definitions, for example: components: schemas: User: type: object properties: id: type: integer paths: /users: get: responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/User' - Use simpler types to represent your data if possible. Avoid unnecessary nesting and complicated types, for example: properties: age: type: integer # Prefer simple types over complex types like objects - Use the `enum` property for fields with a fixed set of values to improve parsing efficiency: properties: status: type: string enum: \[active, inactive\] - Use simple nesting for objects to simplify the structure and improve readability and parsing efficiency: \# Good properties: name: type: string address: type: string # Avoid properties: user: type: object properties: profile: type: object properties: name: type: string - Use `response` headers instead of the response body to provide additional information, for example: responses: '200': description: Successful response headers: X-Rate-Limit-Limit: description: The number of requests allowed in the current period schema: type: integer - Provide concise and short examples: Book: type: string example: "Explain the string with as few words as possible." - When using union-type properties, use `oneOf` to represent union-type object fields, `allOf` to represent an intersection type and composite objects and fields, and `anyOf` when defining a property with multiple possible data structures. ### RAML Specification Best Practices - When extracting RAML fragments, import each fragment as a local declaration first: Create a fragment file, and before publishing the fragment to Anypoint Exchange, import the local fragment file to validate that the fragment works as expected. If the fragment works, publish the fragment to Exchange so you can reuse the fragment in your API specifications instead of duplicating it. - Reuse data types as declarations. - Use inheritance only when needed: Car: description: This is a car properties: brand: string model: string example: brand: Toyota model: Corolla Person: properties: owns: Car - Use short unions: Person: type: Employee | Customer - Use simple traits, and avoid combining traits with resource type properties: /basic: type: {resourceTypes.fhirResourceType: { postExample : !include /examples/requests/post\_resource.json, getExample : !include /examples/responses/get\_resource.json, bundleName : basic.BasicBundle } } /\_search: get: is: \[ searchParams \] post: is: \[ POSTSearchParams \] ## Source Control for API Design Projects Use source control management (SCM) to store and share your design, integration, and implementation projects. Source control options for API design projects depend on how and when you created the project: - As of the February 2024 release, design projects that you create from scratch in Anypoint Code Builder with **Design an API** (see [Create a New API Specification Project](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#design-new-api-spec)) or with the command `MuleSoft: Design an API` no longer use MuleSoft VCS to store and sync changes. - API design projects [imported to Anypoint Code Builder from Design Center](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs#import-spec) or created in Anypoint Code Builder before the February 2024 release automatically connect to MuleSoft VCS, which enables you to sync with a corresponding design project. If you prefer to use your own remote repository, GitHub is one option. To store your API project in a repository on GitHub, without synchronizing with the project in MuleSoft VCS, see [publish your project files to another repository](https://docs.mulesoft.com/anypoint-code-builder/start-scm#add-extra-repo). For source control options, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). --- product: Anypoint Code Builder version: master --- # Developing Integrations > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder to build integrations within a Mule application. Integrations with Anypoint Code Builder rely on a service-based framework that decouples your source from protocols and routing requirements. You can reuse or change operations and processors in the application when your systems or business needs change. Integrations enable multiple services to work as one. Some common use cases are: - Scheduling data processing - Connecting cloud and on-premises applications - Transforming message data to a required structure or format - Event processing in which multiple services are composed and operate simultaneously After you [create your integration project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations), you can optionally: - [Manage global configuration elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements) - [Define and Secure properties for a Mule application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Configure API autodiscovery for local testing](https://docs.mulesoft.com/anypoint-code-builder/int-configure-api-autodiscovery-local) - [Trigger flows in your development environment](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows) - [Use DataWeave expressions and transformations](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions) - [Debug Mule applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) Other tasks you can do with your integration apps are: - [Export Mule projects](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project) - [Import projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project) - [Deploy Mule apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps) ## Source Control for Integration Projects Use source control management (SCM) to store and share your design, integration, and implementation projects. For source control options, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). --- product: Anypoint Code Builder version: master --- # Developing Integrations Using MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes is a purpose-built assistant for the development lifecycle, available with Anypoint Code Builder. Use it to develop, manage, or maintain your applications. MuleSoft Vibes integrates with the [MuleSoft MCP Server](https://docs.mulesoft.com/mulesoft-mcp-server/) and supports many capabilities, such as: - Developing API specifications - Creating and configuring applications - Searching for assets - Deploying and managing instances - Managing custom metadata All of these actions are driven by natural language messages. When you generate an integration, MuleSoft Vibes transforms your business logic into a Mule application. The generated application includes: - Flows - Connector configurations - A sample `config.properties` file - Dependencies required for connectors, such as Salesforce and HTTP These capabilities are powered by large language models (LLMs) that run within the Salesforce Shared Trust Boundary. > [!NOTE] MuleSoft Vibes is available on US, EU, Canada, Japan, India, Australia, and United Kingdom > cloud hosts. ## Before You Begin Before you start creating your API spec, make sure you meet the following prerequisites: - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Make sure you have the [required Anypoint Code Builder permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). - Ensure you have the following permissions to use MuleSoft Vibes: - **Mule Developer Generative AI User** - Make sure Einstein is enabled in Access Management. For more information, see [Enabling Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). > [!NOTE] MuleSoft Vibes always uses the permissions of the Anypoint Platform user who is logged > into Anypoint Code Builder, and can only execute actions that the authenticated user has > permission to perform in Anypoint Platform. ## Unified MuleSoft Vibes Experience MuleSoft Vibes provides a single panel where you can develop integrations and API specifications. Unlike earlier versions of generative features, it does not insert output through a separate panel. Instead, it writes directly into your project files when you grant edit permissions. Depending on your settings, MuleSoft Vibes can: - Request approval before writing to your files. - Write automatically if **Auto-approve** is enabled in the MuleSoft Vibes settings. For details on configuring permissions and server connections, see [Troubleshooting AI Features in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-generative-ai). ## Provide Additional Context You can improve the accuracy of generated outputs by adding extra context to MuleSoft Vibes. Besides the message you send in the panel, you can attach these types of input: - **Files** – Add a requirements file or other reference documents. - **Folders** – Provide an entire project folder for MuleSoft Vibes to consider. - **Terminal Input** – Share terminal outputs as context for the request. This context helps MuleSoft Vibes generate flows and API specifications that align more closely with your requirements. ## Trust Layer The Einstein trust layer bridges Anypoint Platform and the LLMs, as shown in this flow: ![Flow depicting how the trust layer works, including the steps of the flow](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-einstein-trust-layer.png)
1You create a message based on your use case and send it to MuleSoft Vibes.
2To minimize inaccurate responses, messages are grounded with MuleSoft proprietary data and user context.
3To ensure safe data transfer to external LLMs, the message is sent via a secure gateway.
4All data remains within Salesforce-managed boundaries.
5After the LLM generates a response, the content is returned through the secure gateway.
6MuleSoft validates the generated output to ensure compatibility with the MuleSoft ecosystem.
7Anypoint Code Builder logs the interaction for monitoring before surfacing the validated response.
> [!IMPORTANT] This feature uses AI models that can produce inaccurate or harmful responses. Review > the generated output for accuracy and safety before using it. You assume responsibility for the > output when making business decisions. ## See Also - [Troubleshooting](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting) - [Creating API Specs with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-api-ai-create-spec) - [Custom metadata in MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#custom-metadata-vibes) --- product: Anypoint Code Builder version: master --- # Discovering the UI > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Get familiar with the Anypoint Code Builder UI and elements to design, develop, and deploy APIs and integrations. ![Welcome mat in Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/welcome-mat-reference.png)
1Activity Bar: Use VS Code Activity Bar items as you work on your projects. Mouse over the items to find their names:

Activity Bar buttons

In addition to Anypoint Code Builder (MuleSoft icon), commonly used items in the Activity Bar include:

  • Explorer: Open project files, folders, and project dependencies.

  • Source Control: Store your project files.

  • Run and Debug: Run and debug integrations and implementations.

  • Extensions: Open for installations and updates.

    You can change the order of the items in your activity bar.

2Anypoint Code Builder (MuleSoft icon): Open the Anypoint Code Builder panel to start a project. Follow the tutorials to get started with API specification design, implementation, and integration development in Anypoint Code Builder.
3Create: Start an API specification, implementation, or integration project.
4Settings: Set Anypoint Code Builder configurations, including the US or EU cloud. Select the cloud where your Anypoint Platform user account resides.
## Project UIs in Anypoint Code Builder Integration and implementation projects are Mule applications with similar UIs: ![Anypoint Code Builder UI with integration project](/mulesoft/current/en-us/anypoint-code-builder/_images/ui-elements.png)
1Explorer: Open a workspace for your project.
2Editors: Develop your project in the canvas and configuration XML files. Configuration XML files support auto-completion.
3Status Bar: Check for your user name to learn if you are logged in to Anypoint Platform.
4Output Panel: As your projects run in Anypoint Code Builder, view output and logs from Mule DX Server or Mule DX Server: Scaffolding. Open the built-in command terminal. View problems and ports.
API design projects include a service for mocking endpoints in the API Console: ![Anypoint Code Builder UI with integration project](/mulesoft/current/en-us/anypoint-code-builder/_images/ui-elements-api.png)
1Editor: Configure API specification project files. This editor supports auto-completion.
2API Console: Test endpoints on your examples.
## Use Auto-Completion Menus Auto-completion is supported through the Anypoint Code Builder extensions and through IntelliSense, a built-in code-completion feature of VS Code, to provide auto-completion in Editor views. 1. Open auto-completion options from the Editor view using one of the following options: - Using IntelliSense: Press Ctrl+Space to display a list of available options, and enter a search term to narrow the results, for example: ![Auto-complete options for \`get\`](/mulesoft/current/en-us/anypoint-code-builder/_images/des-autocomplete.png) IntelliSense shows different options, depending on the context, for example: ![Auto-complete options for \`responses\`](/mulesoft/current/en-us/anypoint-code-builder/_images/des-autocomplete-context.png) - Using the extensions: Place your cursor at the location where you intend to use the auto-suggestion menu, and optionally, start typing to narrow the list of suggested options to return. If the line has some content, click Tab, provide a space, or start typing after the content on the line. To close the auto-suggestion menu, click Escape. For API design, you can enable or disable auto-completion: Show me how 1. Open the **Extensions** panel from the activity bar by clicking the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-extensions.png) (Extensions) icon. 2. Right-click the extension **Anypoint Code Builder - API Extension**, and select **Extensions Settings**. This action opens the **Settings** tab to the configuration for the extension, **@ext:salesforce.mule-dx-api-component**. 3. In the **Settings** tab, enable the API design editor to suggest auto-completion options. See [Mule > Editor > Auto-completion: Enablement](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-auto-complete). 4. Optionally, set a time in milliseconds to wait before listing auto-completion options. See [Mule > Editor > Auto-completion: Trigger Delay](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-auto-complete). 2. Use the arrow keys to navigate the list. 3. Press Enter or Tab to insert the selected element. Auto-complete adds the element to the code and places the cursor for you to add values. For more information, see [IntelliSense](https://code.visualstudio.com/docs/editing/intellisense) in the VS Code documentation. ## Change the Look and Feel of Anypoint Code Builder Select a theme to change the look and feel. 1. Select the **Manage** (gear) icon from the activity bar. 2. Select **Themes** > **Color Themes**, and select a theme, for example, **Dark Modern**: ![Anypoint Code Builder using the dark theme](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-ui-dark-theme.png) ## Explore the Canvas View By default, when you open a project in Anypoint Code Builder, the canvas view opens first. This allows you to begin building and editing your flows visually, without switching to the code editor. ### Switch Views You can use the toolbar to switch between the canvas and the code editor: 1. Click the **** icon in the toolbar to toggle between canvas and code. 2. To open both views side by side, right-click the canvas tab and select **Open in Canvas and Code Editor**. > [!NOTE] A dot (•) on a canvas tab indicates that the file contains unsaved changes. ### Identify Components with Errors Components that contain errors are marked with a red dot in the canvas. When you hover over the component, a tooltip lists the errors and warnings, including the field names involved. --- product: Anypoint Code Builder version: master --- # Dynamic Evaluate () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Evaluates an expression to select a DataWeave script, and then executes the new script to generate a result. The script can use any of the usual [predefined variables](https://docs.mulesoft.com/dataweave/2.4/dataweave-variables-context), such as `message`, `payload`,`vars`, or `attributes`, but you can also add custom ones by providing a set of key-value pairs. ## Component XML This component supports the following XML structure: ```xml #[] ``` Dynamic Evaluate (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Dynamic evaluate (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Expression

expression

Expression that selects a DataWeave script that Mule executes, for example, expression="#[vars.generateOrderScript]".

Additional Bindings

parameters

N/A

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

`` is a child element of Dynamic Evaluate.
Child ElementDescription

<ee:parameters/>

Key-value pairs that serve as parameters that the DataWeave script can evaluate, for example, <ee:parameters>#[{name: attributes.queryParams.userName}]</ee:parameters>.

## Example The following example selects a script from a database through a `userId` query parameter and stores that script in a `userScript` variable. Dynamic Evaluate (``) accesses the `userScript` variable to invoke the script by using the provided parameter `name`, which contains the value of `attributes.queryParams.userName`. ```xml #["SELECT script FROM SCRIPTS WHERE ID = $(attributes.queryParams.userId)"] #[{name: attributes.queryParams.userName}] ``` Assume that the scripts `lsalander` and\`mblomkvist\` are stored in this example’s database: Example: lsalander script output application/json --- { message: "Order " ++ attributes.queryParams.orderId ++ " has been received from " ++ name, items: payload.items } Example: mblomkvist script output application/x-www-form-urlencoded --- { message: "Order " ++ attributes.queryParams.orderId ++ " has been received from " ++ name, items: payload.items } ### Example Application Behavior When Mule application [example](#example1) receives `lsalander` as the `queryParams.userId` in the request, Mule executes the `lsalander` script, which results in a JSON response. If the application receives `mblomkvist` as the `queryParams.userId` value, Mule executes a different script that generates a `x-www-form-urlencoded` response. The example demonstrates how the response type can be parameterized based on the user, but the entire response can be parameterized to suit user needs. ## See Also - [DataWeave Overview](https://docs.mulesoft.com/dataweave/2.4/) --- product: Anypoint Code Builder version: master --- # Enabling an API Project for Topics and Agent Actions > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use MuleSoft for Agentforce: Topic Center (also known as Topic Center) to enable API specifications for topics and agents, which can then be synced to API Catalog in Salesforce. You can then augment agent functionality by assigning topics to Agentforce agents in Agent Builder. Use the Topic Center visual editor to: - Enable the API specifications for topics and agents. - Apply governance rules to validate that your API is ready to generate agent actions and topics in Salesforce. - Add metadata to make your topic and action-enabled APIs available in Salesforce using Salesforce API Catalog. Topics are bundles of actions and sets of instructions Agentforce agents use to complete tasks. Actions are tasks that the agent can do, and instructions help the agent understand how to use actions. Topic Center makes your API operations available as agent actions and topics. Agents perform common tasks autonomously, such as updating records, searching and summarizing data, and securely taking action in various systems. Agents are reusable across any set of topics and can contain multiple topics. > [!NOTE] The MuleSoft for Agentforce Extension Pack (beta) must not be installed at the same time > as the Anypoint Code Builder Extension Pack\* in Visual Studio Code. The extensions conflict with > each other and can’t run concurrently. Make sure you only install the extension you plan to use. ## Before You Begin - Establish [a tenant relationship](https://docs.mulesoft.com/access-management/trusted-salesforce-org) between your Anypoint Platform organization and a trusted Salesforce organization that has agent entitlements. - Verify that [API Catalog is enabled](https://docs.mulesoft.com/access-management/enabling-api-catalog) for the connected Salesforce organization. - Verify that you have the [required permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions): - [Anypoint Exchange permissions](https://docs.mulesoft.com/access-management/permissions-by-product#exchange) so that users can download and publish assets: - **Viewer** - **Creator** - [Runtime Manager permissions](https://docs.mulesoft.com/access-management/permissions-by-product#runtime-manager) to enable services related to CloudHub and CloudHub 2.0, such as deploying applications: - **Read applications** - **Create applications** - **Delete applications** - [Design Center Developer](https://docs.mulesoft.com/access-management/permissions-by-product#design-center) permission so that users can view and create APIs. - In **Anypoint Platform → API Governance**, make sure you [opt in to govern APIs by version](https://docs.mulesoft.com/api-governance/get-started). - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Understand the basics of designing API specs. See the [Tutorials](https://docs.mulesoft.com/anypoint-code-builder/tutorials) for details. - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). ## Create an API Specification Project for Agent Actions and Topics 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Design an API**: ![\*Design an API\* link highlighted in the \*Create\* section](/mulesoft/current/en-us/anypoint-code-builder/_images/design-api-1.png) 3. Select **Enable this API for Agent Topics and Actions**. 4. Complete the **API Specification** form:
Field NameField Value

Project Name

Unique name for your project.

This name is used as the API spec title in Exchange, the name of the spec file, and the name of the project’s root directory. For example, if the project name is Agent Example, the spec file name is agent-example.

To reuse an existing project name, you must delete the project that is already using the name first. See Deleting API Specs and Fragments.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

API Type

Select REST API.

API Specification Language

Select OAS 3.0 (YAML), OAS 3.0 (JSON), OAS 3.1 (YAML), or OAS 3.1 (JSON).

Only OAS 3.0 and 3.1 are supported for topics and actions.

Business Group

Select the business group the API will belong to. The business group is required for API governance and syncing centralized rulesets. When you publish your API spec to Exchange from Anypoint Code Builder, it requests the name of the business group.

5. Click **Create Project**. If prompted, trust the authors of the files in the folder. The Agent Topics configuration panel opens. 6. In the Agent Topics configuration panel, configure agent topic metadata and instructions, and click **Apply**. 7. Continue designing your API spec. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (or press Ctrl+Space) to display available options within the context. ## Add Metadata to the API Project 1. In **Explorer**, right-click the API specification and select **API** > **Open API Project Properties**. The **API Project Properties** tab opens and is auto-populated with: - **Asset Version** The asset version for your API project must follow the semantic versioning model. For more information, see [Asset Versions](https://docs.mulesoft.com/exchange/asset-versions). - **API Version** The major version for the API. - **Business Group** Select the Anypoint Platform business group this API will be available in. - **Asset ID** - **Asset Name** - **Tags** - **Categories** These properties are used when you publish your API specification to Exchange. Tags and categories help users filter search results when they search Anypoint Exchange. The `sf-api-catalog` and `sf-api-topic` tags are applied automatically when you enable the API for agent actions and topics. ![API Project Properties tab with sf-api-catalog and sf-api-topic tags applied](/mulesoft/current/en-us/anypoint-code-builder/_images/ai-topic-center-api-project-properties.png) You can edit any of the fields. 2. If you make any changes to the API project properties, click **Apply**. ## Configure Topics Configure your topic in the **Agent Topics** configuration panel: 1. Click the **#** icon to open the **Agent Topics** configuration panel if it’s not already open. 2. Configure these fields for topics:
Field NameDescriptionExample

Topic Label

Enter a unique name for the topic.

Sales Agent

Classification Description

Enter one to three plain text sentences. An agent uses this description to determine when to use a topic in a conversation. When a user enters a message, the agent identifies the user’s intent, compares it to the topic name and classification description, and uses the best matching topic.

These are some examples of classification descriptions:

Answers questions about business policies, procedures, or products.

Interacts with the user to draft or revise content.

Answers questions related to a user’s order status, return status, or making a return.

Scope

The scope defines exactly what the agent can and can’t do for a given topic. The scope is most effective when it narrowly defines the agent’s job for a given topic as it helps limit the agent so it doesn’t try to respond outside the desired job or scope you want the topic to include.

These are some examples of scope descriptions:

Your job is to only handle tasks related to setting a closing strategy to close deals. This may include answering product-related pricing questions, briefing users on customer sentiment based on conversations, suggesting a close plan to help users close deals, or giving advice based on video and voice calls.

Your job is to only educate the user with their reservation questions and only handle changing upcoming or existing reservations by resending the reservation confirmation email. You aren’t able to make new reservations.

Instructions

Plain text instructions help an agent make decisions about how to use the actions in a topic for different use cases. Each instruction is a single topic-specific guideline, usually phrased as “Always…”, “Never…”, “If x, then y…”, or “As a first step,…”.

Instructions are nondeterministic, so they shouldn’t include sensitive or deterministic business rules.

These are some examples of instructions:

Always clarify what type of mobile device (iOS or Android) before using the Answer Questions with Knowledge function to retrieve troubleshooting information.

Never ask the user for an ID. Instead, use the name or ask for the name of the record to use IdentifyRecordByName to get the ID to call other actions.

If a user asks about the status of their order or order confirmation, ask if they have their order number or their email. If a user doesn’t have their email or order number, ask if they’d like to escalate to an agent or create a case.

## Configure Actions Create agent actions using a schema to define the required metadata. As you enter elements, use [auto-complete](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui#auto-complete) (or press Ctrl+Space) to display available options within the context. To enable an API for agent topics and actions, you must annotate at least one operation to use as an agent with `x-sfdc/agent/action/publishAsAgentAction` and set the value to `true`.
ExtensionDescriptionDefault Value

x-sfdc/agent/action/publishAsAgentAction

Required. Set this attribute to true to enable the operation as an action.

false

x-sfdc/privacy/isPii

Optional. Set this attribute to true to enable PII service for queries sent under that operation

false

x-sfdc/agent/action/isUserInput

Required. Set this attribute to true to surface the field to the user for further input.

false

x-sfdc/agent/action/isDisplayable

Required. Set this attribute to true for the field to be displayable to the user.

false

Adding agent metadata in a schema that’s defined using `$ref` isn’t supported. The metadata must be defined inside the schema, for example: ```openai ... (Inside response, request body, etc..) schema: $ref: '#/components/schemas/Pet' ... components: schemas: Pet: x-sfdc: agent: action: isDisplayable: true required: - name - photoUrls properties: id: type: integer format: int64 example: 10 name: type: string example: doggie status: type: string description: pet status in the store enum: - available - pending - sold ``` ## Topic and Agent Governance Rulesets To make sure your API is ready to generate agent actions and topics in Salesforce, the **SF API Topic and Action Enablement** centralized ruleset is added to your topic-enabled API project automatically. 1. Optionally, [add additional rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api#add-rulesets) that are required for your project. 2. [Validate the governance rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api). If you remove the `sf-api-catalog` and `sf-api-topic` tags from your API project, the topic and action rulesets are automatically removed. ## Publish the API spec to Exchange After you validate your API specification rulesets, [publish your API specification to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). After you publish your API to Exchange and create an active API instance in API Manager, it is available for use in API Catalog. For more information, see [API Catalog](https://help.salesforce.com/s/articleView?id=platform.api_catalog.htm). ## Disable the API Specification for Topics 1. In **Explorer**, right-click the API specification and select **API** > **Open API Project Properties**. 2. Deselect **Enable this API for Agent Topic and Actions**, and click **Apply**. The `sf-api-catalog` and `sf-api-topic` tags and the **SF API Topic and Action Enablement** ruleset are removed from the API project. ## See Also - [What are Agents](https://help.salesforce.com/s/articleView?id=sf.copilot_overview.htm&type=5) - [The Building Blocks of Agents](https://help.salesforce.com/s/articleView?id=sf.copilot_building_blocks.htm&type=5) - [Agent Topics](https://help.salesforce.com/s/articleView?id=sf.copilot_topics.htm&type=5) - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) - [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) --- product: Anypoint Code Builder version: master --- # Error Handler () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Catches an error thrown by the Mule application and routes it to the first On-Error component configuration that matches the error type. The Error Handler component has two child elements, On Error Continue and On Error Propagate, which enable you to configure routes that execute when the error raised in the application matches the type of error configured in the handler. Each handler has its own behavior and works relative to the component that contains it (a Flow or a Try scope): - On Error Continue (`on-error-continue`): executes and uses the result of the execution as the result of its container element (as if the container completed the execution successfully). Any transactions at this point commit successfully. - On Error Propagate (`on-error-propagate`): rolls back any transactions, executes, and uses that result to rethrow the existing error. In this case, the container element "fails" its execution. If there’s no error handling configuration that matches the error, the app follows a default error handling process. See [Using Default Error Handling for Messages](https://docs.mulesoft.com/mule-runtime/latest/error-handling#default_error_handling) for more information. ## Component XML This component supports the following XML structure: ```xml ``` Error Handler (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Error handler (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

The `` and `` child elements share the following attributes:
Attribute NameAttribute XMLDescription

When

when

A matching expression that defines the condition to trigger the execution of this on-error strategy. The expression must evaluate to a Boolean value (true or false).

Type

type

A comma-separated list of Mule error types that defines the errors this on-error strategy handles.

Log exception

logException

Specifies whether to log the error at level ERROR before this strategy handles it. Defaults to true.

Enable notifications

enableNotifications

Specifies if this strategy triggers a notification of type ExceptionNotification when an error occurs. Defaults to true.

## Error Handling Example The following example configures handlers to produce `{ "MyError": "value was expected to be null" }` for a `VALIDATION:NOT_NULL` error and `{ "messageANY" : "Some other error" }` for other error types. ```xml ``` ## See Also - [Mule Errors](https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept) - [Mule Runtime Engine Notifications](https://docs.mulesoft.com/mule-runtime/latest/mule-server-notifications) --- product: Anypoint Code Builder version: master --- # Exporting Mule Projects > For the full documentation index, see: https://docs.mulesoft.com/llms.txt A Mule application is an integration or implementation application that runs on Mule runtime engine. To share the application across different teams, or to deploy the application elsewhere, you can export and package a snapshot of Mule application resources. Additionally, you can publish a Mule project to Exchange as either a template or an example. ## Shareable JAR A shareable JAR file is lightweight, packaging only the source code of the application. The source code includes configuration files but not libraries or other dependencies required for your application to run and deploy successfully. The shareable JAR includes: - The configuration XML and other files in the `src` folder, including resource files - `mule-artifact.json` - `pom.xml` Anypoint Code Builder generates the dependencies automatically based on the settings in the POM file (`pom.xml`). You or your teammates can import the JAR file and continue developing in Anypoint Code Builder or Anypoint Studio (Studio). To import a shareable JAR, see [Import a Shareable Project JAR File into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#desktop-project-package). ## Deployable JAR A deployable JAR file contains the compiled code and all dependencies. For a deployable JAR, you can select **Include project sources** while exporting the project so the JAR can be opened in Anypoint Code Builder or Studio and also used for deployment. When this option is selected, the JAR also includes the configuration XML and other files in the `src` folder (including resource files), `mule-artifact.json`, and `pom.xml`, the same project sources as in a shareable JAR. You can deploy the JAR file to any supported environment, such as CloudHub or on-premises. You don’t need to create a deployable JAR file to deploy to CloudHub. \* To deploy an app directly from Anypoint Code Builder, see [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps). \* To deploy a JAR file to CloudHub, see [Deploy to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub). For more information on deployment options, see [Runtime Plane Hosting Options](https://docs.mulesoft.com/hosting-home/#runtime-plane-hosting-options.adoc) and [Deploy Mule Applications](https://docs.mulesoft.com/mule-runtime/latest/deploying). Because Anypoint Code Builder projects are standard Maven projects, you don’t have to export a JAR manually every time. A CI/CD pipeline can build and package the same project by running `mvn clean package` against the `pom.xml` file, then deploy the resulting JAR with the Mule Maven Plugin or Anypoint CLI, independent of the IDE. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create an integration](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ## Export Mule Project To create a deployable or shareable JAR file from your project: 1. Open the configuration XML file in a project for the Mule application to export. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Select the following command: ```command MuleSoft: Export Mule Project ``` 4. Alternatively, right-click the configuration XML file in the Explorer and select **Export Mule Project**. 5. In the Export Mule Project dialog, under **Select an Export Type**, choose one of the following: - **Deployable JAR** — Package the project for deployment to Mule runtime. You can select **Include Project Sources** to also include the configuration XML files, resource files, `mule-artifact.json`, and `pom.xml` in the JAR, making it possible to open the JAR in Anypoint Code Builder or Studio. - **Shareable JAR** — Package a lightweight version of the project for sharing. This option includes only the project source files, not compiled code or dependencies. 6. In **File Name**, enter a name for the exported file. 7. In **File Location**, enter or select the directory where you want to save the JAR file. 8. Click **Export**. 9. The terminal window opens automatically to provide the status of the packaging process, which includes execution of the export command, a scan for the project to export, and the packaging of the project snapshot into a JAR file. ### Find or download the JAR When packaging completes, find the JAR file by following the prompts that appear: - Click **Open Folder** to open the directory that contains the JAR file in the Explorer view. The terminal window also provides the path to the JAR, in the `/target` directory under your project folder. You can find the JAR file in the Explorer, under Java Projects: ![Deployable JAR file in the Java Projects folder](/mulesoft/current/en-us/anypoint-code-builder/_images/int-export-deployable.png) ## Publish a Mule Project to Exchange You can publish a project as either a template or an example. A _project template_ is a pre-configured, reusable project setup that serves as a starting point for developing Mule applications. These templates provide a structured framework that includes common configurations, example code, and best practices. A _project example_ is a sample application that demonstrates specific functionalities or use cases. These examples provide practical, real-world scenarios to help developers implement various features and integrations. To publish a Mule project to Exchange as either a template or an example: 1. In Anypoint Code Builder, on the Explorer view, right-click on your root XML file, for example, `/src/main/mule/flights-implementation.xml`. 2. Select **Publish Mule Project to Exchange** from the options menu. 3. In the **Publish to Exchange** form, select an **Asset Type**. Select either an **Example** or a **Template**. 4. Ensure that the following fields contain the correct values for your asset: ![Form for publishing a project to Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/publish-project-to-exchange-dialog.png)
Field NameField Value

Asset Name

Name that Exchange uses to identify the published project.

Version

Version number to display in the Version section of the page that Exchange creates for the asset.

Use semantic versioning (major.minor.patch), for example 1.0.0 for a first-time publish. Increase the major version for breaking changes, the minor version for backward-compatible new features, and the patch version for fixes, so consumers of your asset can decide when to adopt a new version based on the type of change.

If you are republishing the asset, Anypoint Code Builder automatically populates the Version field. You can change this number, but the republish fails if you use a version number that has already been used to publish a stable version of this asset.

Description

Optional description of your asset.

Business Group

Business unit in Anypoint Platform that the asset belongs to.

Group ID

ID of the business unit in Anypoint Platform that the asset belongs to.

Artifact ID

Unique ID that Exchange uses to identify the published asset. Use the default value unless a published asset has the same ID.

5. In **Advanced Options**, make sure that these fields contain the correct values for your asset: ![Form for publishing a project to Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/publish-project-to-exchange-advanced-dialog.png)
Field NameField Value

Tags

Descriptors that Exchange uses to search for assets.

Categories

Category that was previously added to Exchange. Refer to the Managing Categories documentation to learn how to create Categories for your organization.

6. In **Advanced Options**, select the **Keep your local and published project in sync** checkbox to sync your local project information with the data you entered. If deselected, your project deploys with the provided data, but your local project doesn’t include the updated information. 7. Click **Publish**. The publication of your project as a new asset begins. After publication succeeds, select **View Asset** to view the asset in Exchange. ## Publish Reusable Logic as a Dependency To prevent building the same logic across multiple projects, such as a common error handler, a logging framework, or a set of utility flows, package that logic as a Mule project and publish it to Exchange. Other projects can then add it as a [Maven dependency](https://docs.mulesoft.com/anypoint-code-builder/acb-external-libraries) instead of duplicating the flows. ## See Also - [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project) - [Package a Mule Application](https://docs.mulesoft.com/mule-runtime/latest/package-a-mule-application) - [Deploy to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub) - [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps) --- product: Anypoint Code Builder version: master --- # Extract Payload Information to Variables > For the full documentation index, see: https://docs.mulesoft.com/llms.txt This section of the tutorial teaches you how to extract information from the payload into different variables to refer to those values later in the flow. ## Before You Begin Complete these procedures: - [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api). - [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc). - Configure your Salesforce integration. ## Extract Values From the Payload 1. In Anypoint Code Builder, open your `new-case-salesforce.xml` file. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after the **On New Case** Salesforce component: ![A flow in the canvas UI with the \*Add Component\* button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-transform-from-canvas-slack.png) 3. Type `Transform` and select **Transform**. 4. Configure the Transform Message component to extract data from the payload to variables: ```XML (1) (2) (3) ```
1casestatus retrieves the Salesforce case status: New, Working, or Escalated.
2casenumber retrieves the case number created by Salesforce.
3Set the slackchannel to the channel name that you set earlier in the tutorial.
## Concatenate Your Values in The Payload Add a Set Payload component to concatenate the value of your variables in the resulting payload of your application: 1. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon after the Transform Message component: ![A flow in the canvas UI with the \*Add Component\* button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/add-set-payload-slack-case-canvas.png) 2. Type `set` and select **Set Payload**. 3. Configure the Set Payload component with the following code: ```XML ``` 4. Proceed to [Add a Condition to Your Flow Logic](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-add-condition-to-your-flow) to create a condition to send an email if the case is escalated or otherwise inform about the case in a Slack channel. [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc) [Add a Condition to Your Flow Logic](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-add-condition-to-your-flow) --- product: Anypoint Code Builder version: master --- # Filtering Search Results > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When implementing an API, use the advanced search filters to find API specifications in Exchange. To search for an API using the search filters: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Implement an API**: ![Implement an API in the Create menu](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-option-mat.png) 3. Select **Show Filters** to display the search filters: ![Implement API specification screen with the Show filters label highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-filters.png) Anypoint Code Builder supports the following filters for your API assets: - Tag Keyword or term that describes a specific search. - Type The list of asset types depends on which types are available in a business group, such as: - GraphQL API A schema definition that contains the object types and definitions used to interact with the API through the GraphQL specification. GraphQL enables you to query an API that supports this language in a much more flexible way than REST. - REST APIs RAML or OAS files that specify APIs referenced by an HTTP Request connector to expose metadata. - gRPC API Protocol Buffers (Protobuf) specifications that define gRPC services and methods. Select this type to narrow results when implementing a gRPC API from Exchange. - Category/Industry Specific groupings of assets set by the administrator of a business group or an organization owner. - Organization Business groups for which you have permission to view their assets. The search filters display the business group from which to retrieve your API in the **Organization** column: ![Implement API specification screen with the Organization column highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-business-group.png) 4. Click **Add Asset** to add the selected API specification to the Mule application project. --- product: Anypoint Code Builder version: master --- # First Successful () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Iterates through a list of configured processing routes until one of the routes executes successfully. If any processing route fails execution (throws an error), the router executes the next configured route. If none of the configured routes execute successfully, the First Successful router throws an error. ## Component XML This component supports the following XML structure: ```xml ``` First Successful (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

First successful (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

`` is a child element of First Successful.
Child ElementDescription

<route/>

Accepts one or more components as child elements. Multiple <route/> configurations are allowed.

## Example The following example shows a First Successful router configured with four processing routes: ```xml (1) (2) (3) (4) ```
1The first route executes and fails because it tries to read a file that does not exist.
2The second route fails because it tries to access a variable that does not exist.
3The third route executes successfully and sets variable successfulRoute with value 3.
4The fourth route is not executed because the First Successful router stops executing routes after one of them completes successfully.
## See Also - [Mule Errors](https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept) - [Error Handlers](https://docs.mulesoft.com/mule-runtime/latest/error-handling) --- product: Anypoint Code Builder version: master --- # Flow () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Group together a sequence of Core components and operations (provided by connectors and modules) inside a scope to help automate integration processes. Within a Mule application, a flow is a block of executable components, including any connector operations, that Mule runtime executes sequentially on a Mule event. A flow can also contain an event source, which triggers the creation of the event and the execution of the flow. You can create more than one flow in your Mule app. For a more in-depth discussion of uses, capabilities, and limits of flows and subflows, see [Flows and Subflows](https://docs.mulesoft.com/mule-runtime/latest/about-flows). Flows always function synchronously. To achieve asynchronous patterns, such as Fire-and-Forget, use the [Async Scope](https://docs.mulesoft.com/anypoint-code-builder/acb-component-async). ## Component XML This component supports the following XML structure: ```xml ``` Flow (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

name1 (default)

name

Editable name for the component to display in the canvas.

Initial state

initialState

Indicates whether the flow is active when you start the application. Accepted values are started and stopped. You can trigger flows in state started from an internal or external Mule event source within the flow (such as an HTTP listener or Scheduler), by a Flow Reference from another flow or subflow, or through a call to the lookup DataWeave function.

If you set the initial state to stopped, use Runtime Manager to activate the flow or reset the Flow configuration to Started. The console output for this state is: Flow flow_component_ex has not been started (initial state = 'stopped')

Defaults to started.

Max concurrency

maxConcurrency

Sets the maximum number of concurrent messages that the flow can process. If not set, the container thread pool determines the maximum number of threads the flow can use to optimize the performance when processing messages. While the flow is processing the maximum number of concurrent messages, it cannot receive additional requests.

Set maxConcurrency to 1 to cause the flow to process requests one at a time.

See Back-pressure for details about the behavior of Mule runtime after it reaches the maximum concurrency value.

N/A

tracking:enable-default-event

When set to true, enables business events for Mule apps that you deploy to CloudHub.

N/A

tracking:transaction-id

Specifies the transaction ID for the business event. Requires tracking:enable-default-event set to true.

## Find Flows That Reference This Flow To find every flow reference that calls a flow, right-click the flow in the canvas and select **Find References**. You can also press Shift+Alt+F12 (Windows and macOS). For more information, see [Find Flows That Reference a Subflow](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#find-referencing-flows). ## Example: Flow and Subflows The following example uses a Scheduler as a source to trigger the execution of the flow every 10 seconds and then connects to a subflow (``) through a Flow Ref (``) component. The subflow then connects to another subflow, also using a Flow Ref component. ```xml 9.99 53 398.99 ', 'application/xml') output application/xml --- myXml ]]> { (key) : { dollars: value, localCurrency: value * conversionRate, index_plus_1: index + 1, timer : currentMilliseconds() } }]]> ``` The example produces the following output: ```json { "priceList": { "basic": { "dollars": "9.99", "localCurrency": 129.87, "index_plus_1": 1, "timer": 1533024312658 }, "premium": { "dollars": "53", "localCurrency": 689, "index_plus_1": 2, "timer": 1533024312659 }, "vip": { "dollars": "398.99", "localCurrency": 5186.87, "index_plus_1": 3, "timer": 1533024312659 } } } ``` ## Error Handling You can add an [Error Handler](https://docs.mulesoft.com/anypoint-code-builder/acb-component-error-handler) component to the Flow. The following example sets the _myXML_ variable which contains an empty __ tag, then an `` returns an error because the DataWeave condition `isEmpty(payload.prices)` returns `true`. ```xml ', 'application/xml') output application/xml --- myXml ]]>
``` The resulting error message is as follows: ```text ERROR 2018-07-30 23:58:45,293 [[MuleRuntime].cpuLight.06: [flow_subflow].flow_subflowFlow.CPU_LITE @1b1529b2] [event: 0-2aba3280-948f-11e8-82d0-f45c898f2549] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: "An Error Occurred" ``` ## See Also - [Subflow](https://docs.mulesoft.com/anypoint-code-builder/acb-component-subflow) - [Back-Pressure and MaxConcurrency](https://docs.mulesoft.com/mule-runtime/latest/tuning-backpressure-maxconcurrency) --- product: Anypoint Code Builder version: master --- # Flow Reference () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Routes the Mule event to another flow or subflow, executes all processors in the referenced flow, and then routes the event back within the same Mule application. This process enables you to treat the entire referenced flow like a single component in your current flow. Flow Reference breaks the Mule application into discrete and reusable units. For example, a flow that lists files on a regular basis might reference another flow that processes the output of the List operation. Instead of appending all the processing steps to the flow that lists the files, you can append a Flow Reference that points to the processing flow. > [!WARNING] Use actual flow names to define the **Flow name** (`name`) attribute. Using dynamic > values (DataWeave expressions, variables) to specify the referenced flow negatively affects > performance. Also, MUnit tests and application analysis tools cannot work on dynamic references. ## Component XML This component supports the following XML structure: ```xml ``` Flow Reference () attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Name

name

The name of the flow that this component references.

N/A

doc:id

Automatically generated identifier for the component.

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

## Considerations when Using a Target Variable Setting the `target` variable in a Flow Reference component causes the original message to remain unchanged. This means that any modification to the payload or to the variables that occur in the referenced flow revert after the referenced flow finishes executing its processors, returning the payload and variables to their original values. Alternatively, if you do not define a `target` variable, any modification that occurs to the payload or to the variables in the referenced flow persist after the referenced flow finishes its execution, changing the original value of the payload or variables. ## Navigate to the Referenced Flow You can open the flow that a Flow Reference component points to directly from the canvas, without switching views manually. To open the referenced flow, right-click the Flow Reference component and select **Go to Flow**. You can also press Ctrl+Alt+g (Windows) or Cmd+Option+g (macOS). Anypoint Code Builder opens the target flow in the appropriate canvas: - In application flows, the referenced flow opens in the flow canvas. - In MUnit test flows, the referenced flow opens in the MUnit canvas if applicable. If the referenced flow is in an imported Mule project dependency, you can open it in a read-only canvas and view its read-only XML. You can inspect the flow and go to other flows in the dependency, but you can’t modify the dependency flow or its XML. This helps you trace and manage flow logic across modular designs, whether you’re building or testing your application. To find every flow that references a flow or subflow, see [Find Flows That Reference a Subflow](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#find-referencing-flows). ## Examples The following example configures an HTTP listener, updates the payload, sets a variable, and references another flow by adding the target variable `flowReferenceVar,` which stores the result of the secondary flow called by the Flow Reference component. This variable is then used in the main flow by logging `vars.flowReferenceVar`: ```xml ``` The following log represents the output of the example application after its execution: INFO LoggerMessageProcessor: Payload = Original payload INFO LoggerMessageProcessor: myVar = 1 INFO LoggerMessageProcessor: flowReferenceVar = Modified payload If you remove `target="flowReferenceVar"` from the Flow Reference component, the application returns the following output: INFO LoggerMessageProcessor: Payload = Modified payload INFO LoggerMessageProcessor: myVar = 2 INFO LoggerMessageProcessor: flowReferenceVar = null The logs are shortened to improve readability. ## Error Handling When an error occurs inside a flow that is referenced by a Flow Reference component, the execution of the referenced flow stops and the process transfers to the referenced flow’s error handler. If the referenced flow does not have a configured error handler, the error is propagated to the flow that contains the Flow Reference call so this flow’s configured Error Handler component processes the error. Target variables are not set when an error occurs because the execution of the flow stops and does not end successfully. ## See Also - [Mule Events](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event) - [Enrich Data with Target Variables](https://docs.mulesoft.com/mule-runtime/latest/target-variables) - [How Transactions Affect Scopes and Routers](https://docs.mulesoft.com/mule-runtime/latest/transaction-management#tx_scopes_routers) --- product: Anypoint Code Builder version: master --- # For Each () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Process input in a pattern similar to `for-each` or `for` loop in other programming languages. ## Component XML This component supports the following XML structure: ```xml ``` For Each (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Foreach (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Collection

collection

A DataWeave expression that returns a Java collection, object, array, map, or DOM nodes. For Each automatically splits the collection into elements, such as the highest-level objects in a JSON array of objects. Each element becomes the payload on which a processor within For Each acts. For Each accepts collections of any supported content type, such as application/json, application/java, or application/xml. Defaults to payload.

Batch size

batchSize

Number that the scope uses to partition the collected elements from the input into sub-collections of a specified size. For example, if input to For Each is an array of 199 elements and you set the batch size to 50, the scope produces three arrays of 50 elements each and one array of 49 elements. Defaults to 1.

Root message variable name

rootMessageVariableName

Configurable name of the variable that stores the complete, un-split Mule message from the original input to For Each. The message contains the payload and any attributes but does not contain any variables (vars), which are part of the Mule event that contains the Mule message. Within For Each, you can gain access to the value of the payload of the message with vars.rootMessage.payload and to attributes of the message with vars.rootMessage.attributes. For Each consumes this variable, so you can access it only from within the scope. Outside For Each, the variable returns null. Defaults to rootMessage.

Counter variable name

counterVariableName

Name of the variable that assigns a number to each iteration over a given element. The sequence starts with 1 and proceeds sequentially. Using the default name of this property (counter), you can access this number with vars.counter. For Each consumes this variable, so it is not available and returns null when used outside of the scope. Defaults to counter.

## Examples The following example collects and splits an array of objects that it receives into separate objects. Components within the scope select a portion of each object, write a portion of that selected content into separate files, and log the new `payload` that results within For Each. Assume that For Each receives its input from a scheduled HTTP request for this [JSON array of objects](https://jsonplaceholder.typicode.com/users). ```xml (1) (2) (3) (4) ``` For Each processes the input array:
1For Each (<foreach />) collects the entire input payload and splits it into the ten top-level JSON objects within it, such as this one:
{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "Sincere@april.biz",
  "address": {
    "street": "Kulas Light",
    "suite": "Apt. 556",
    "city": "Gwenborough",
    "zipcode": "92998-3874",
    "geo": {
      "lat": "-37.3159",
      "lng": "81.1496"
    }
  },
  "phone": "1-770-736-8031 x56442",
  "website": "hildegard.org",
  "company": {
    "name": "Romaguera-Crona",
    "catchPhrase": "Multi-layered client-server neural-net",
    "bs": "harness real-time e-markets"
  }
}
2As For Each iterates over each object, the DataWeave expression (payload.company) in the Transform component (<ee:transform />) uses DataWeave selectors to extract the value of each "company" key and transform the payload to the value of each of those keys. As in a Mule flow, the next component within For Each receives the transformed payload as its input.
3The File Write operation (<file:write />) uses payload.name within a larger DataWeave expression to select the name of each company from the transformed object. The name of each file follows the pattern specified in the expression, which hyphenates the extracted company name and appends a date-time stamp to make the file name unique. For example, the name of a file for Romaguera-Crona data looks like this:
Romaguera-Crona-20221007113314.json

By default, the operation also loads the payload received from Transform Message to each file.

4The logs print the following message for the first object from the input array:
{
  "name": "Romaguera-Crona",
  "catchPhrase": "Multi-layered client-server neural-net",
  "bs": "harness real-time e-markets"
}
When processing Mule variables, execution within For Each begins with the values of Mule variables from the previous execution. New Mule variables or modifications to the values of existing variables that take place when processing one element are accessible during the processing other elements. Changes to Mule variables continue to be available outside the For Each scope. ```xml ``` As the Choice router (``) executes the processors within each condition, the Logger (`Logger After Choice`) prints the following variable values: ```log // Condition: when payload == 'apple' .LoggerMessageProcessor: [var1-BeforeForEach, var2-newValue, var3-appleVal, null] // Condition: when payload == 'banana' .LoggerMessageProcessor: [var1-BeforeForEach, var2-newValue, var3-appleVal bananaVal, null] // Condition: otherwise .LoggerMessageProcessor: [var1-BeforeForEach, var2-newValue, var3-otherVal, var4-val4] ``` The last values are propagated outside of For Each. The logger (`Logger After For Each`) prints the same values as the ones printed after the final choice condition (`otherwise`). ```log [var1-BeforeForEach, var2-newValue, var3-otherVal, var4-val4] ``` ## Error Handling If one of the elements in a collection throws an exception, For Each stops processing that collection and invokes the error handler. ## See Also - [Transform Component](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform) - [Mule Event Structure](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event) - [Mule Message Structure](https://docs.mulesoft.com/mule-runtime/latest/about-mule-message) - [DataWeave Reference](https://docs.mulesoft.com/dataweave/2.4/dw-functions) --- product: Anypoint Code Builder version: master --- # Generative AI Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use these examples to help you get started with the generative AI feature and understand how to create messages for your own use cases. > [!NOTE] Generative support is currently limited to RAML 1.0, OAS 3.0, and OAS 3.1 specifications. ## Order Management Your company manages a growing e-commerce platform and needs a way to streamline the handling of customer orders. You want to build an API specification that allows your backend systems to create, retrieve, update, and delete orders, ensuring consistent data models and robust error handling across all operations. To generate a specification for this task, enter a message like: `Generate an API specification for an order management system for an e-commerce platform. The API should include endpoints to create, retrieve, update, and delete orders, along with detailed definitions for request and response payloads, versioning details, and error handling mechanisms.` This message generates an API specification using the same specification language as the file that was in focus: ```xml openapi: 3.0.0 info: title: Order Management API version: 1.0.0 description: API for managing orders in an e-commerce platform. servers: - url: https://api.ecommerce.com/v1 paths: /orders: post: (1) summary: Create a new order operationId: createOrder requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Order' responses: '201': description: Order created successfully '400': description: Bad request '401': description: Unauthorized '500': description: Internal server error security: - bearerAuth: [] get: (2) summary: Retrieve all orders operationId: getOrders responses: '200': description: A list of orders content: application/json: schema: type: array items: $ref: '#/components/schemas/Order' '401': description: Unauthorized '500': description: Internal server error security: - bearerAuth: [] /orders/{orderId}: (3) get: summary: Retrieve a specific order operationId: getOrder parameters: - name: orderId in: path required: true schema: type: string responses: '200': description: Order details '404': description: Order not found put: summary: Update an existing order operationId: updateOrder parameters: - name: orderId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Order' responses: '200': description: Order updated successfully '404': description: Order not found delete: summary: Delete an order operationId: deleteOrder parameters: - name: orderId in: path required: true schema: type: string responses: '204': description: Order deleted successfully '404': description: Order not found components: securitySchemes: (4) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (5) Order: type: object properties: id: type: string customerId: type: string items: type: array items: $ref: '#/components/schemas/OrderItem' totalAmount: type: number format: float status: type: string enum: [pending, processing, completed, cancelled] OrderItem: type: object properties: productId: type: string quantity: type: integer price: type: number format: float ```
1Creates a new order: The POST /orders operation accepts a JSON payload and returns a success or error response.
2Retrieves a list of all orders: The GET /orders operation returns an array of order objects.
3Handles operations for a specific order: Includes GET, PUT, and DELETE methods on /orders/{orderId} with path parameter validation.
4Uses bearer token authentication: The bearerAuth scheme is applied to secure all endpoints.
5Defines reusable data models: The Order and OrderItem schemas provide consistent structure for request and response payloads.
## Inventory Management Your business needs to track and manage product stock across multiple warehouses and storefronts. To ensure accurate inventory levels and prevent overselling, you want to generate an API specification that supports creating, updating, deleting, and listing products. The specification should include clear data models, input validation rules, and proper security mechanisms. To generate a specification for this task, enter a message like: `Generate an API specification for an inventory management system. The API should expose endpoints to manage products and stock levels, support operations to add, update, delete, and list products, and include clear definitions for data models, input validation rules, and security considerations.` ```xml openapi: 3.0.0 info: title: Inventory Management API version: 1.0.0 description: API for managing products and stock levels. servers: - url: https://api.inventory.com/v1 paths: /products: post: (1) summary: Add a new product operationId: addProduct requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Product' responses: '201': description: Product added successfully '400': description: Invalid input security: - bearerAuth: [] get: (2) summary: List all products operationId: listProducts responses: '200': description: A list of products content: application/json: schema: type: array items: $ref: '#/components/schemas/Product' '500': description: Internal server error security: - bearerAuth: [] /products/{productId}: (3) get: summary: Get product details operationId: getProduct parameters: - name: productId in: path required: true schema: type: string responses: '200': description: Product data '404': description: Product not found put: summary: Update a product operationId: updateProduct parameters: - name: productId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Product' responses: '200': description: Product updated '400': description: Invalid input '404': description: Product not found delete: summary: Delete a product operationId: deleteProduct parameters: - name: productId in: path required: true schema: type: string responses: '204': description: Product deleted '404': description: Product not found components: securitySchemes:(4) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (5) Product: type: object required: [id, name, quantity, price] properties: id: type: string name: type: string description: type: string quantity: type: integer minimum: 0 price: type: number format: float ```
1Creates a new product: The POST /products operation uses a JSON payload to define the product.
2Lists all products: The GET /products operation returns an array of products in stock.
3Manages individual products: Includes operations to retrieve, update, or delete a specific product using its ID.
4Secures endpoints with bearer authentication: The API uses bearerAuth to protect inventory operations.
5Includes a validated product schema: The Product schema enforces required fields and validation like minimum: 0 for quantity.
## User authentication and management Your application requires secure and reliable user authentication to protect user data and manage access to services. To support this, you want to generate an API specification that handles user registration, login, token management, and password resets. The specification should include proper input validation, error responses, and security best practices. To generate a specification for this task, enter a message like: `Generate an API specification for a user authentication and management service. The API should support endpoints for user registration, login, token management, and password resets, including thorough details on input validation, error responses, and necessary security protocols.` This message generates an API specification using the same specification language as the file that was in focus: ```xml openapi: 3.0.0 info: title: User Auth API version: 1.0.0 description: API for managing user authentication and credentials. servers: - url: https://api.example.com/v1 paths: /register: (1) post: summary: Register a new user operationId: registerUser requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegisterRequest' responses: '201': description: User created '400': description: Invalid input /login: (2) post: summary: Authenticate a user operationId: loginUser requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LoginRequest' responses: '200': description: Login successful '401': description: Unauthorized /token/refresh: (3) post: summary: Refresh an access token operationId: refreshToken requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RefreshRequest' responses: '200': description: Token refreshed '401': description: Invalid refresh token /reset-password: (4) post: summary: Request password reset operationId: resetPassword requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResetRequest' responses: '200': description: Password reset email sent '404': description: User not found components: securitySchemes: (5) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (6) RegisterRequest: type: object required: [email, password] properties: email: type: string format: email password: type: string minLength: 8 LoginRequest: type: object required: [email, password] properties: email: type: string password: type: string RefreshRequest: type: object required: [refreshToken] properties: refreshToken: type: string ResetRequest: type: object required: [email] properties: email: type: string ```
1Registers a new user: POST /register validates input and creates a new user account.
2Logs in a user: POST /login checks credentials and returns a token on success.
3Refreshes token: POST /token/refresh issues a new access token using a refresh token.
4Initiates password reset: POST /reset-password sends a reset email if the user exists.
5Secures endpoints: All protected routes use JWT bearer authentication.
6Defines schemas: UserRegistration and UserLogin schemas include input validation like minLength and format: email.
--- product: Anypoint Code Builder version: master --- # Generative Flow Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use these examples to help you get started with the generative flow feature and understand how to create messages for your own use cases. ## Implement a New Case Notification Your company receives numerous customer inquiries and support requests daily. You want to implement email notifications whenever a new case is created in Salesforce so you can respond quickly to customers and ensure timely case resolution to increase customer satisfaction. To generate a flow for this task, enter a message like: `Generate a flow that sends an email when a case is created in Salesforce`. This message generates XML code for the new flow, similar to this: ```xml (1) (2) (3) (4) New Case Created:"]]> ```
1This flow starts with a Salesforce Connector on-new-object-listener trigger so that when a new case is created, the flow is triggered.
2The payload for the new case is set in variables using a DataWeave script within the Transform component.
3The email is sent using the Email Connector Send operation with the configured SMTP settings.

The subject of the email is set to `New Case Created: ` followed by the case subject.

4The body of the email is set to HTML format and includes the case ID, subject, and description.
### Complete the Flow After reviewing and inserting the generated flow into your project: 1. Type the target email address to use in your use case, for example: `` 2. Add the target email, `${email.username}` to your [configuration properties file](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs#properties). 3. Optionally, enter a value for the scheduling strategy in the `fixed-frequency` attribute. The **Scheduler** initiates the flow to poll for new cases according to the value you set, for example: ```xml ``` This example flow is configured to poll for new cases every 5000 milliseconds. 4. Add the required configurations for your Salesforce instance and email inbox in the code editor. The following is an example of the completed flow: ```xml ``` ## Update a Phone Number Provide a streamlined process for Salesforce System Administrators by using an API call to efficiently and securely update a phone number. To generate a flow for this task, enter a message like: `Create a flow that listens for an API call and updates the phone number of a Salesforce Account object`. This message generates XML code for the new flow, similar to this: ```xml (1) (2) (3) #[payload] (4) ```
1The flow starts with an HTTP Listener that listens for an API call on the /updatePhoneNumber path.
2In the Transform component, the payload is set using the <ee:transform> operation to specify the account ID and phone number to update.
3The Salesforce Connector Update operation is used to update the Account object in Salesforce.

The type attribute is set to Account to specify the object type to update.

4The payload is passed as the records to update in Salesforce.
### Complete the Flow To run this flow, add the required configurations for your Salesforce instance in the code editor. The following is an example of the completed flow: ```xml ``` ## Synchronize Account Objects This flow enables real-time updates between Salesforce and your database to ensure the data is always current and accurate across both Salesforce and your database. As soon as the phone field changes in Salesforce, it updates immediately in the database and vice versa. To generate a flow for this task, enter a message like: `Create a flow that syncs the phone field of account objects between a Salesforce org and a database`. This message generates XML code for the new flow, similar to this: ```xml (1) (2) (3) (4) (5) (6) (7) (8) ```
1Configure the HTTP Listener operation to listen for a POST request on the /syncAccountPhone path.
2Extract the account ID from the payload and store it in a variable named accountId.
3Extract the phone number from the payload and store it in a variable named phone.
4The Database Connector Select operation retrieves the account record from the database based on the account ID.
5Use a DataWeave Transform operation to create the updated data for the Salesforce Account object.
6Use the Salesforce Connector Update operation to update the Salesforce account.
7The account information is also updated in the database using a Database Connector Update operation.
8The payload is set to Phone field synced successfully to indicate a successful sync.
### Complete the Flow After reviewing and inserting the generated flow into your project: 1. Update the name of the database table and fields to match what is configured in your MySQL database. 2. To run this flow, add the required configurations for your Salesforce instance in the code editor. The following is an example of a completed flow: ```xml ``` ## Automate New Record Notification Automate email notifications to users when a new database record is updated to minimize manual intervention, which improves efficiency and reduces the chances of errors or delays. To generate a flow for this task, enter a message like: `Generate a flow to send an email when a record is created in the database`. This generates XML code for the new flow, similar to this: ```xml (2) (1) (3) (4) (5) ```
1The flow starts with a Database Connector Listener component that listens for new records in the database record table.
2The scheduling strategy is set to trigger the flow at a fixed frequency of every one second.
3The payload of the listener is stored in a variable named record using the Set Variable operation.
4An email is sent from the address sender@example.com using the Email Send component.
5The email is sent to the address recipient@example.com.
### Complete the Flow After reviewing and inserting the generated flow into your project: 1. Update the sender email address, recipient email addresses, and email body for your specific use case. 2. Update the database table name so that it corresponds to the database table on which the flow listens for new records. 3. Update the `watermarkColumn` in the Database **Listener** to whichever database column is used to indicate new records. The values that are taken from this column are used to filter the contents of the next poll, so that only rows with a greater watermark value are processed. 4. To run this flow, add the required configurations for your database and email inbox in the code editor. The following is an example of the completed flow: ```xml ``` ## See Also - [Creating Integrations with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations) - [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference) - [Scheduler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scheduler) - [Set Payload ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-payload) - [Set Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-variable) - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) --- product: Anypoint Code Builder version: master --- # Getting Started with Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder is built from the Anypoint Extension Pack for Visual Studio Code. You must load the extension pack to your local Visual Studio Code installation. ## Set up Anypoint Code Builder The extensions in Anypoint Extension Pack are available from the Visual Studio Marketplace. - [Before You Begin Anypoint Code Builder Setup](#prereqs) - [Hardware and Storage Requirements](#hardware-storage-requirements) - [Install Anypoint Extension Pack](#install-pack) - [Install Anypoint Extension Pack in Cursor, Trae, or Devin](#install-other-ides) - [Update Anypoint Extension Pack](#update-pack) - [Uninstall Anypoint Extension Pack](#uninstall-pack) ## Before You Begin Anypoint Code Builder Setup Before installing the Anypoint Code Builder extensions to VS Code, make sure you have an Anypoint Platform account with the required permissions: - An administrator with an Anypoint Platform organization account must provide you with the necessary permissions. See [Configuring Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions). - Anypoint Platform requires a user account. You can use an existing account or create one from Anypoint Platform (see supported [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds)). For information about OS and system compatibility, see [Anypoint Code Builder Release Notes](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#compatibility). ## Hardware and Storage Requirements Anypoint Code Builder relies on Visual Studio Code (VS Code), Java, Node.js, Maven, and local build artifacts. To avoid timeouts, slow dependency resolution, and poor responsiveness, your environment must meet the following minimum specifications. Recommended values improve performance for larger workspaces and frequent local runs. For supported operating systems and extension compatibility, see [Anypoint Code Builder Release Notes](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#compatibility). To check whether your machine meets these specifications and apply available optimizations automatically, ask MuleSoft Vibes or Claude Code to run the `run-system-diagnostics` skill. ### Hardware Requirements
ComponentMinimumRecommended

CPU

8 cores or 8 vCPUs

More cores for parallel builds and multiple large projects

RAM

32 GB

Additional memory for multiple VS Code windows and heavy local testing

Primary storage type

NVMe SSD (PCIe 3.0 or higher)

Same; avoid network-only or heavily virtualized disks for the OS, user profile, and project roots

Free disk space

50 GB

100 GB

Network

1 Gbps

10 Gbps (for large dependency downloads and corporate artifact repositories)

### Storage Performance Local disks that can’t sustain the following metrics often show slow indexing, Maven repository access, and Mule application startup. Confirm values with your storage vendor or disk benchmark tooling on the volume that hosts your user profile, local Maven repository, VS Code data, and project directories. Consider input/output operations per second (IOPS) as well; higher IOPS generally improve responsiveness for random small-file access.
MetricMinimum Requirement

Random read IOPS (4 KB)

10,000 IOPS

Random write IOPS (4 KB)

8,000 IOPS

Sequential read

1,250 MB/s

Sequential write

1,000 MB/s

Antivirus, endpoint detection, and real-time scanning can reduce read and write speeds below these minimums. To reduce this impact, configure antivirus and endpoint protection exclusions. ### Configure Antivirus and Endpoint Protection Exclusions On managed devices, add exclusions for the processes and directories that Anypoint Code Builder and its toolchain use most intensively. Exclusions reduce file locking, false positives, and severe I/O latency during builds. Your organization’s security policy decides whether exclusions are allowed, so use the list with your security team. For the full list of processes and directories to exclude, see [Antivirus Exclusion Paths](https://docs.mulesoft.com/anypoint-code-builder/urls-to-allow#antivirus-exclusions). ### Windows Performance On Windows, avoid running projects from network-mapped drives, because remote file access adds latency to project loading and canvas responsiveness. Store projects on local storage that meets the requirements in [Storage Performance](#storage-performance), and keep Anypoint Extension Pack updated to the latest version to benefit from ongoing file read and write optimizations for Windows. ### Power Settings Power management can throttle CPU and disk performance during long builds or local runs. - Windows: Prefer a **High performance** or **Balanced** power plan while you work; avoid battery saver or aggressive power saving when the machine is on AC power. - macOS: On notebooks, reduce battery-focused throttling where your org allows it—for example, adjust **System Settings** under **Battery** or **Energy** when plugged in. For more information about hardware and storage requirements, see [Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements). ## Install, Update, or Uninstall Anypoint Extension Pack Use of Anypoint Code Builder in VS Code on your computer requires the Anypoint Extension Pack. - [Install Anypoint Extension Pack](#install-pack) - [Install Anypoint Extension Pack in Cursor, Trae, or Devin](#install-other-ides) - [Update Anypoint Extension Pack](#update-pack) - [Uninstall Anypoint Extension Pack](#uninstall-pack) ### Install Anypoint Extension Pack To install the Anypoint Extension Pack into VS Code: 1. Open VS Code. 2. Find **Anypoint Extension Pack** from within VS Code or from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=salesforce.mule-dx-extension-pack). > [!NOTE] To avoid installation errors: > > Do not install the individual Anypoint Code Builder extensions that are also available > separately from Anypoint Extension Pack in Visual Studio Marketplace. - To install from within VS Code, launch the Extensions menu by clicking the Extensions icon from the activity bar or pressing Cmd+Shift+x (Mac) or Ctrl+Shift+x (Windows), and search for the extension pack. Select **Install Release Version**. - To install from the Visual Studio Marketplace website, find the extension pack, and install: Select **Install Release Version**. For additional guidance, see the [Visual Studio Code website](https://code.visualstudio.com/learn/get-started/extensions). 3. Open the Extensions menu, and review the extensions in Anypoint Extension Pack: Anypoint Extension Pack contains these extensions: - Anypoint Code Builder - API Extension - Anypoint Code Builder - APIkit Extension - Anypoint Code Builder - DataWeave Extension - Anypoint Code Builder - Dependencies Extension - Anypoint Code Builder - Integration Extension - Anypoint Code Builder - MUnit Extension - Anypoint Code Builder - Platform Extension For versioning information about extensions in Anypoint Extension Pack, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog). 4. Recommended: Ensure that the Anypoint extensions update automatically by right-clicking each extension to see if **Auto Update All (From Publisher)** is checked. If it’s not, select **Auto Update** for each extension, for example: ![Setting an extension to auto-update](/mulesoft/current/en-us/anypoint-code-builder/_images/start-extensions-auto-update.png) Ensure this option is checked. 5. Click the MuleSoft icon in the activity bar to access and use Anypoint Code Builder features. ![MuleSoft icon for Anypoint Code Builder in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 6. Confirm that the [Anypoint Code Builder menu](#acb-menu) loads. 7. Disable other VS Code extensions that you don’t need for Mule development. Java-based extensions, such as a Java Language Server, Java debugger, or Spring Boot tools, run background processes that compete with Anypoint Code Builder for the same JVM resources, which can slow down canvas loading, DataSense resolution, and debugging. 8. If your Anypoint Platform account uses a control plane other than US Cloud, change the **Mule: Control Plane** setting. For guidance, see [Set Anypoint Code Builder to a Different Control Plane](#change-clouds). 9. Follow the steps in [Log in to Anypoint Platform](#login-ide). NOTE If an Anypoint Platform session is active in any of your browsers when you install Anypoint Extension Pack, the extension pack uses that session to sign in to Anypoint Platform. You can [log out](#logout-status-bar) or [sign in](#logout-status-bar) from the status bar. ### Install Anypoint Extension Pack in Cursor, Trae, or Devin Cursor, Trae, and Devin use the OpenVSX marketplace by default. Before you can search for and install Anypoint Extension Pack in these IDEs, configure Visual Studio Marketplace as the gallery service URL. Anypoint Extension Pack is also compatible with Windsurf. See [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server) for more about using the Anypoint Extension Pack, including MuleSoft MCP Servers, across compatible IDEs. - Cursor - Trae - Devin 1. Open Cursor. 2. Go to **Cursor** > **Preferences** > **VS Code Settings**. 3. Search for **Extensions › Gallery: Service Url**. 4. Replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 5. Restart Cursor to apply the change. 6. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. 7. Open Trae. 8. Go to **TRAE** > **Settings**. 9. Search for **Extension Market Url**. 10. Replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 11. Restart Trae to apply the change. 12. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. 13. Open Devin. 14. Go to **Devin** > **Devin Settings** > **Plugins**. 15. In the **Marketplace extension gallery service URL** field, replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 16. Restart Devin to apply the change. 17. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. ### Update Anypoint Extension Pack If Anypoint Extension Pack is installed, update to the latest version of the extension pack by following VS Code instructions in [Update an extension manually](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_update-an-extension-manually). ### Uninstall Anypoint Extension Pack Typically, it is unnecessary to uninstall the extension pack or individual Anypoint Code Builder extensions from VS Code. For example, you can update to a new version without uninstalling first. If you decide to uninstall Anypoint Extension Pack, follow the same procedure that you use for other VS Code extensions. Uninstalling the extension pack also uninstalls the individual Anypoint Code Builder extensions that are bundled within the extension pack, such as the DataWeave and APIkit extensions. To uninstall: 1. Open VS Code. 2. From the activity bar, open the Extensions panel. 3. Find and select Anypoint Extension Pack. 4. In the Anypoint Extension Pack tab that opens, click **Uninstall**. 5. To remove the Anypoint Code Builder extensions from the Extensions panel, click **Reload** on one of the extensions. For additional guidance, see the VS Code documentation, [Manage extensions](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_manage-extensions). You can reinstall at any time. ## Sign in to Anypoint Platform from Anypoint Code Builder Some Anypoint Code Builder features require you to sign in directly to Anypoint Platform. Anypoint Code Builder prompts you when login is necessary and guides you through the login process. However, it is a good practice to sign in after opening MuleSoft features. - An administrator with an Anypoint Platform organization account must provide you with the necessary permissions. See [Configuring Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions). - Anypoint Platform requires a user account. You can use an existing account or create one from Anypoint Platform (see supported [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds)). You can sign in from the status bar or through a command, and you can log out from the status bar: - [Sign in to Anypoint Platform from the Status Bar](#login-status-bar) - [Sign in to Anypoint Platform from the Command Palette](#login-command) - [Sign in to a Different Anypoint Platform Account from Anypoint Code Builder](#change-user-account) - [Log Out from Anypoint Platform from Anypoint Code Builder](#logout-status-bar) ### Sign in to Anypoint Platform from the Status Bar The status bar shows your login status: - **Not logged in to Anypoint Platform** indicates that you must sign in to perform tasks that require a connection to Anypoint Platform. ![Login status message in the status bar](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-not-logged-in.png) You can sign in by clicking this notification and following the prompts to sign in. - A link to your user name indicates that you are signed in. You can log out by clicking your user name and following the prompts. ### Sign in to Anypoint Platform from the Command Palette You can use the Command Palette to sign in to Anypoint Platform. To sign in from the Command Palette: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Select the following command: ```command MuleSoft: Login to Anypoint Platform ``` ![Login command within the Command Palette](/mulesoft/current/en-us/anypoint-code-builder/_images/login-to-anypoint-platform.png) > [!TIP] You can type `login` and use the filter in the results to select the command you want. 3. Select **Allow** when prompted to sign in to the platform. ![allow login to anypoint platform](/mulesoft/current/en-us/anypoint-code-builder/_images/allow-login-to-anypoint-platform.png) After logging you in, Anypoint Platform displays a **You can close this page now** message. 4. To verify your login, ensure that **** replaces **Not logged in to Anypoint Platform**. ### Log Out from Anypoint Platform from Anypoint Code Builder Log out by: 1. Clicking your username in the status bar 2. Clicking **Yes** when asked **Logout from Anypoint?** ### Sign in to a Different Anypoint Platform Account from Anypoint Code Builder To use a different Anypoint Platform user account: 1. Log out from the status bar. For guidance, see [Log Out from Anypoint Platform from Anypoint Code Builder](#logout-status-bar). 2. Sign in from the status bar. For more guidance, see [Sign in to Anypoint Platform from the Status Bar](#login-status-bar). ## Set Anypoint Code Builder to a Different Control Plane In Anypoint Code Builder, you can change your Anypoint Platform control plane to one of these options: - US Cloud (default) - EU Cloud - Canada Cloud - Japan Cloud - India Cloud - Australia Cloud - United Kingdom Cloud - Private Cloud Edition Anypoint Platform instances do not share user accounts, projects, or other data. For more information, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). Starting with Anypoint Code Builder 1.28.0, you can select **Private Cloud Edition** to connect to a Private Cloud Edition (PCE) 4.3.0 or later control plane that your organization hosts. To change the control plane: 1. If an API specification is open in the Explorer panel, close the project to avoid a synchronization error when you switch clouds. - Click **File** > **Close Folder**. 2. Open the **Settings** panel: ![Selecting the EU cloud from Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-activity-bar-select-cloud.png) Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 3. Scroll to **Mule: Control Plane**. 4. Select the desired control plane. 5. If you select **Private Cloud Edition**, set **Mule: Control Plane PCE Url** to the URL of your PCE control plane, for example `[https://pce.example.com](https://pce.example.com)`. Anypoint Code Builder uses this URL only when **Private Cloud Edition** is selected. Anypoint Code Builder imports custom SSL certificates for the PCE host automatically. 6. Restart Anypoint Code Builder to load all your changes. 7. Follow the steps in [Sign in to Anypoint Platform from Anypoint Code Builder](#login-ide). If you selected **Private Cloud Edition**, sign in from the Command Palette with this command: ```command MuleSoft: Login to Anypoint Platform ``` The command opens the PCE sign-in page. If you selected **Private Cloud Edition**, bundled Mule runtime versions are available, and you can add another Mule runtime version locally. See [Add a Mule Runtime Version Locally](#add-local-mule-runtime). ## Add a Mule Runtime Version Locally Starting with Anypoint Code Builder 1.28.0, you can add a Mule runtime version that Anypoint Code Builder does not include. Copy the Mule runtime directory into the `user-installed` folder. Anypoint Code Builder lists that version when you create a project and in **Project Properties**. Use this option when your environment requires a Mule runtime version that is not bundled with Anypoint Code Builder, such as a version for Private Cloud Edition (PCE). Bundled Mule runtime versions are also available when the control plane is Private Cloud Edition. See [Bundled Mule Runtime Versions](https://docs.mulesoft.com/anypoint-code-builder/int-versions#bundled-runtimes). To add a Mule runtime version: 1. Copy the Mule runtime directory into this folder: ```text ${user.home}/AnypointCodeBuilder/runtimes/user-installed ``` Create the `user-installed` folder if it does not exist. 2. Create a project, or open **Project Properties**. The Mule runtime version appears in the Mule runtime version menu. See [Select Mule and Java Versions for a Project](https://docs.mulesoft.com/anypoint-code-builder/int-versions#project-version-mule-java). > [!IMPORTANT] Anypoint Code Builder does not validate that a Mule runtime version is compatible > with your PCE environment. Confirm compatibility before you run or deploy your application. --- product: Anypoint Code Builder version: master --- # Hardware and Storage Requirements > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder relies on Visual Studio Code (VS Code), Java, Node.js, Maven, and local build artifacts. To avoid timeouts, slow dependency resolution, and poor responsiveness, your environment must meet the following minimum specifications. Recommended values improve performance for larger workspaces and frequent local runs. For supported operating systems and extension compatibility, see [Anypoint Code Builder Release Notes](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#compatibility). To check whether your machine meets these specifications and apply available optimizations automatically, ask MuleSoft Vibes or Claude Code to run the `run-system-diagnostics` skill. ## Hardware Requirements
ComponentMinimumRecommended

CPU

8 cores or 8 vCPUs

More cores for parallel builds and multiple large projects

RAM

32 GB

Additional memory for multiple VS Code windows and heavy local testing

Primary storage type

NVMe SSD (PCIe 3.0 or higher)

Same; avoid network-only or heavily virtualized disks for the OS, user profile, and project roots

Free disk space

50 GB

100 GB

Network

1 Gbps

10 Gbps (for large dependency downloads and corporate artifact repositories)

## Storage Performance Local disks that can’t sustain the following metrics often show slow indexing, Maven repository access, and Mule application startup. Confirm values with your storage vendor or disk benchmark tooling on the volume that hosts your user profile, local Maven repository, VS Code data, and project directories. Consider input/output operations per second (IOPS) as well; higher IOPS generally improve responsiveness for random small-file access.
MetricMinimum Requirement

Random read IOPS (4 KB)

10,000 IOPS

Random write IOPS (4 KB)

8,000 IOPS

Sequential read

1,250 MB/s

Sequential write

1,000 MB/s

Antivirus, endpoint detection, and real-time scanning can reduce read and write speeds below these minimums. To reduce this impact, configure antivirus and endpoint protection exclusions. ## Configure Antivirus and Endpoint Protection Exclusions On managed devices, add exclusions for the processes and directories that Anypoint Code Builder and its toolchain use most intensively. Exclusions reduce file locking, false positives, and severe I/O latency during builds. Your organization’s security policy decides whether exclusions are allowed, so use the list with your security team. For the full list of processes and directories to exclude, see [Antivirus Exclusion Paths](https://docs.mulesoft.com/anypoint-code-builder/urls-to-allow#antivirus-exclusions). ## Windows Performance On Windows, avoid running projects from network-mapped drives, because remote file access adds latency to project loading and canvas responsiveness. Store projects on local storage that meets the requirements in [Storage Performance](#storage-performance), and keep Anypoint Extension Pack updated to the latest version to benefit from ongoing file read and write optimizations for Windows. ## Power Settings Power management can throttle CPU and disk performance during long builds or local runs. - Windows: Prefer a **High performance** or **Balanced** power plan while you work; avoid battery saver or aggressive power saving when the machine is on AC power. - macOS: On notebooks, reduce battery-focused throttling where your org allows it—for example, adjust **System Settings** under **Battery** or **Energy** when plugged in. --- product: Anypoint Code Builder version: master --- # Idempotent Message Validator () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Ensure that only unique messages continue through a flow execution by checking the unique ID of the incoming message. You can use any incoming attribute of the Mule message as an ID, or you can compute the ID by configuring a DataWeave expression. You can also use the DataWeave `Crypto` functions to compute hashes (SHA, MD5) from the data. ## Component XML This component supports the following XML structure: ```xml ``` Idempotent Message Validator (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Idempotent message validator (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Value expression

valueExpression

N/A

Id expression

idExpression

The expression Mule uses to generate the ID. You can use a DataWeave function to calculate the ID, or you can extract the ID from any existing value of the Mule message.

Store prefix

storePrefix

N/A

Object store

objectStore

N/A

## Examples The examples show how to configure an Idempotent Message Validator to extract an ID from an HTTP request for use as a unique identifier and how to hash the payload using a DataWeave expression and use the message ID as the unique identifier. ### Example: Generate an ID from an HTTP Request The following example shows an Idempotent Message Validator configured to extract the query parameter ID from the HTTP request and use that value as a unique identifier to filter the message: ```xml ... ... ``` ### Example: Generate an ID by Hashing the Payload With DataWeave The following example shows an Idempotent Message Validator configured to hash the payload using a DataWeave expression, store the result in a persistent object store, and then use the processed message IDs as unique identifiers for filtering the message: ```xml ... ... ``` ## See Also - [Crypto (dw::Crypto)](https://docs.mulesoft.com/dataweave/2.4/dw-crypto) --- product: Anypoint Code Builder version: master --- # Implement a GraphQL API > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Publish a GraphQL API schema to Anypoint Exchange. Then use Anypoint Code Builder to import and scaffold the schema into a Mule application. Run and implement the interface. ## Before You Begin Complete these procedures: - Set up your MuleSoft environment. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. - Download the [**Books API** GraphQL schema](https://docs.mulesoft.com/anypoint-code-builder/_attachments/books-api.graphql). Alternatively, create a file named `books-api.graphql` with the following content: ```graphql schema { query: Query } type Query { bookById(id: ID): Book books: [Book] bestsellers: Bestsellers } type Book { id: ID! name: String pageCount: Int author: Author } type Author { id: ID! firstName: String lastName: String } type Bestsellers { books: [Book] authors: [Author] } ``` ## Publish the GraphQL API to Exchange To implement a GraphQL API, the API must first be manually published to Exchange: 1. Navigate to Anypoint Exchange, and sign in. Show me how - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) 2. Click **Publish new asset**. 3. For **Name**, type `books-api`. 4. For **Asset types**, select **GraphQL API**. 5. For **Method**, select **Upload a GraphQL API Schema**: ![A form for publishing a GraphQL API asset](/mulesoft/current/en-us/anypoint-code-builder/_images/upload-graphql-api-exchange-method-select.png) 6. For **File upload**, click **Choose file** and browse for your `books-api.graphql` schema file. 7. For **Lifecycle state**, select **Stable**. 8. Click **Publish**. ## Implement the GraphQL API Schema Use Anypoint Code Builder to retrieve the schema from Anypoint Exchange and scaffold the schema into an interface that you can implement. 1. Open Anypoint Code Builder. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Implement an API Specification ``` 4. If prompted to sign in to Anypoint Platform, click **Allow**, and follow the prompts to sign in. 5. Configure your project using the following values: ![A form for implementing a new API specification](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-configure-in-task.png) 1. **Project Name**: `books-implementation` 2. **Project Location**: click **Browse**, and then select your home directory. 3. Search for your **books-api** specification in Exchange by typing `books` and pressing Return to display the results. 4. In the search results, hover over **books-api**, and click the **Add Asset** button that appears: ![A table of available API specifications with the Add Asset button highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/select-books-graphql-api.png) 5. Provide **Mule runtime** and **Java** versions. 6. Click **Create Project**. 7. If prompted, trust the authors of the API specification. Trusting is required before you can work on the project. After you trust the authors, Anypoint Code Builder scaffolds your GraphQL API and creates a project with an empty flow for each type in your Books API GraphQL schema.
GraphQL SchemaMule Flow
type Query {
      bookById(id: ID): Book
      books: [Book]
      bestsellers: Bestsellers
    }

    type Book { id: ID! name: String pageCount: Int author: Author }

    type Author { id: ID! firstName: String lastName: String }

    type Bestsellers { books: [Book] authors: [Author]
    }
<flow
    name="Query.bookById"/> <flow name="Query.books"/> <flow
    name="Query.bestsellers"/> <flow name="Book.author"/> <flow
    name="Bestsellers.books"/> <flow
    name="Bestsellers.authors"/>
Each flow contains configurations for the elements ``, ``, and \` \`. The `` element serves as a trigger for a flow. See [Mapping a GraphQL API to Your Data Sources](https://docs.mulesoft.com/apikit/latest/apikit-graphql-api-mapping) for more information about data fetchers. 8. Proceed to [Test Your GraphQL Project](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-test-first-implementation) to run your application in Anypoint Code Builder and post GraphQL queries to your endpoint. [Test Your GraphQL Project](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-test-first-implementation) --- product: Anypoint Code Builder version: master --- # Implement the American Flights API > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After designing and publishing your API specification, you’re ready to implement it in Anypoint Code Builder. At this stage of the tutorial, you already have an API specification for the American Flights API published to Anypoint Exchange, and you’re working in the same workspace where you build the integration. To implement the API, you scaffold the API specification into an integration project. Scaffolding generates the API interface based on the specification, creating the flows and configuration that you then extend with application logic. ## Scaffold the American Flights API into an Integration Project Now that the American Flights API specification is available in Anypoint Exchange, scaffold it into a new integration project to generate the API interface. Use MuleSoft Vibes to scaffold the locally generated API Spec by sending the following message: ```command Scaffold the american-flights-api.yaml API spec. ``` ### Manually Scaffold the API Spec from Exchange If you prefer not to use MuleSoft Vibes, manually implement your published API spec from Exchange: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Create**, click **Implement an API**. ![The Anypoint Code Builder panel with the Create and Import options, including Implement an API](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-create-import-menu.png) 3. In the **Implement an API Specification** tab that opens: 1. Provide a new name for the implementation project. 2. Select or create a new project location. 3. In the search box, type `American Flights API`, or the name you used when creating the specification, and press Enter. 4. Find your API specification on Anypoint Exchange, and click **Add Asset** to insert the API name into the field. 5. Select an existing workspace, or create a new one by providing a name and a location. 6. Click **Create Project** to start scaffolding the specification into a new implementation project. 7. If you see this notification, trust your workspace by clicking **Manage** then **Trust**. ![The workspace trust notification with Manage and Trust options](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-restricted-banner.png) ### Verify the Scaffolded Project After scaffolding completes, confirm that the generated project contains listener configuration, APIKit router flows, flows associated with API methods, and error handlers. ![Flow list showing the scaffolded american-flights-api-main flow with a Listener and Router, alongside error handler flows](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-flow-list-view.png) ## Connect to a Database Using the Database Connector Add and configure a Database Select operation to retrieve flight data from a database. 1. Open the `get:\flights:american-flights-api-config` flow. If you don’t see the flow list, click **Show flow list** to display it. ![The Show flow list button in Anypoint Code Builder used to display the list of flows in the canvas](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-show-flow-list.png) 2. Click **Add Component** (**+**) before the existing **Transform Message** and select **Connectors > Database > Select**. If there’s no **Transform Message**, add the **Database - Select** component at the beginning of the flow. You add or configure the Transform Message component later in this section. 3. Click the **Select** component to open its properties panel. 4. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)), change it to `All Flights`, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). 5. In the **Select** component properties, click **Add New Connection** next to **Connection Config**. ![Database - Select properties panel with the Add New Connection link next to Connection Config](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-select-add-connection.png) 6. Set the connection to **MySQL Connection**. ![Connection Config dialog with Name set to Config and Connection set to MySQL Connection](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-mysql-connection.png) 7. Click **Configure library** next to **MySQL JDBC Driver**. ![Required Libraries section with the Configure library option next to MySQL JDBC Driver](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-configure-library.png) 8. In the **Select Library Source** drop-down menu, select **Maven Dependency**. ![Select Library Source drop-down menu set to Maven Dependency](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-library-source-maven.png) 9. Enter `mysql:` in the **Search Maven Central Repository** text field, and select **mysql:mysql-connector-java** in the results. ![Search Maven Central Repository results showing mysql:mysql-connector-java and other matches](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-maven-search-results.png) 10. Enter `8.0.30` in the **Version** text field, and click **Apply**. 11. Confirm that the MySQL JDBC Driver is set. ![Required Libraries section confirming MySQL JDBC Driver is set to mysql:mysql-connector-java:8.0.30](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-driver-configured.png) 12. Set the following configuration values:
Field NameField Value

Host

iltdb.mule-training.com

Port

3306

User

mule

Password

mule

Database

training

![Connection Config dialog with Host, Port, User, Password, and Database fields set](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-select-query.png) 13. Click **Test Connection** and confirm that you see a **Connection is valid** message. ![Connection is valid confirmation message](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-connection-valid.png) > [!TIP] If the test fails, verify the connection details and retry. If you are using a VPN, > confirm that it is not preventing the connection to the MySQL database. 14. Click **Apply** and close the **Database - Select** config tab. 15. In the **Database - Select** properties panel, add this query in the **SQL Query Text** field: ```sql SELECT * FROM american ``` ![Database - Select properties panel with the General tab showing the SQL Query Text field set to SELECT \* FROM american](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-connection-config.png) This query selects all records from the `american` table. 16. Locate the **Transform Message** component after the **All Flights** Database Select. If there’s no **Transform Message** component there, click **Add Component** (**+**) after **All Flights** and select **Core Processors > Components > Transform Message**. ![The get:\\flights:american-flights-api-config flow with an All Flights Database Select component followed by a Transform Message component](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-flow-overview.png) 17. Click the **Transform Message** component to open its properties panel. 18. In the **Inline Script** field, set the script to: ```dataweave %dw 2.0 output application/json --- payload ``` [Design and Publish the American Flights API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-design-api) [Validate Input Parameters and Transform Flight Data](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-validate-transform-data) --- product: Anypoint Code Builder version: master --- # Implementation Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You might encounter problems when implementing an API. ## Something Failed While Scaffolding an API Anypoint Code Builder supports scaffolding these schema fragment files if they’re referenced from API specs:
AvroJSONRAML

AsyncAPI

Yes

Yes

No

GraphQL

No

No

Yes

OData

No

No

Yes

REST

No

Yes

Yes

SOAP

No

No

Yes

If you add a fragment that isn’t supported, the scaffolder doesn’t add these fragments as project dependencies when you import the spec from Exchange. However, you can scaffold schemas that are specified inline within the spec. If you attempt to scaffold an API that references these types of fragments, you see a message like the following: **Something failed while scaffolding API** The scaffold fails and the flows and other elements aren’t created. To see scaffolding errors, select **Mule DX Server: Scaffolding** from the list in the output panel. If you use the iterative approach to scaffold the API (using [multi-root workspaces](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis#scaffold-spec-into-project)), the implementation project folder structure is not created. To work around this issue, before scaffolding the API: 1. Add the fragment directly to a folder in your API spec project, such as `fragments`: ![Fragment folder in the Explorer view](/mulesoft/current/en-us/anypoint-code-builder/_images/troubleshoot-imp-scaff.png) 2. Change the path to the fragment from Exchange to the local folder, for example: - Reference Local OAS Fragment - Reference OAS Fragment on Exchange ```YAML $ref: fragments/frag-defs.yaml#/components/examples/flightsList ``` ```YAML $ref: exchange_modules/e91cab06-650b-4634-9c6f-5bc4f4fc4d17/frag-defs/1.0.0/frag-defs.yaml#/components/examples/flightsList ``` 3. Re-scaffold the API. See [Create and Add a Fragment Directly in Your Spec](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments#create-add-fragment-directly). ## See Also - [Implementing OAS, RAML, AsyncAPI, and GraphQL APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs) - [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Implementing a gRPC API Specification with Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After you publish your gRPC API specification to Anypoint Exchange, use Anypoint Code Builder to scaffold it into a Mule implementation project. Scaffolding generates the routing logic and a flow for each RPC method defined in your `.proto` file so you can implement and run the gRPC service in a Mule application. Scaffolding is supported for gRPC API specifications that are published to Anypoint Exchange. Anypoint Code Builder uses the service and method definitions in your Protobuf specification to autogenerate an interface that includes: - A flow for each RPC method (unary, client streaming, server streaming, or bidirectional streaming) - A gRPC listener configuration for incoming requests You can scaffold a gRPC API specification from Exchange into a new project or into an existing integration project: - To scaffold a gRPC spec from Exchange into a new project, see [Scaffold a gRPC API into a New Project](#scaffold-new-grpc-project). - To scaffold a gRPC spec from Exchange into an existing project, see [Import a gRPC API Spec into an Existing Project](#import-grpc-spec-into-project). - To update your project with the latest changes to a gRPC spec in Exchange, see [Re-scaffold a gRPC API Specification into a Project](#re-scaffold-grpc-spec). After scaffolding, implement the business logic in each flow, then run and deploy your Mule app as described in [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations). ## Before You Begin - [Design a gRPC API specification](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec) in Anypoint Code Builder, then [publish it to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-grpc-api-to-exchange). Scaffolding is supported only for gRPC API specs published to Anypoint Exchange as a **gRPC API** asset. The specification must be available in Exchange before you can scaffold it into a project. - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Verify that your Mule runtime supports gRPC. gRPC uses HTTP/2; Mule runtime 4.11 or later is required. See [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create and test your API spec](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs). - [Publish your API spec to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). - Optionally, [create your integration project (Mule app)](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ## Scaffold a gRPC API into a New Project Use Anypoint Code Builder to scaffold a gRPC API specification from Exchange into a new Mule project: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Create**, click **Implement an API**: 3. Complete the **Implement an API Specification** form:
Field NameField Value

Project Name

Unique name for your implementation project.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

Search an API Specification from Exchange

Name of the gRPC API specification in Exchange.

Use search filters and select the Type that corresponds to gRPC API to narrow results to gRPC specifications.

Mule runtime

Mule runtime version 4.11 or later (required for gRPC).

Java Version

Java version compatible with your Mule runtime.

Add to workspace

Optionally select or deselect to add the new project to the current workspace. Deselect to create the project in the chosen location without opening it in the current workspace.

4. Search for the gRPC API spec, select it, and click **Add Asset** (or equivalent) to add the selected spec to the form. 5. Click **Create Project**. If prompted, trust the authors of the files in the folder. The scaffolding engine runs and generates the Mule project from the gRPC API specification. During this process, Anypoint Code Builder downloads and generates the compiled Protobuf descriptor file (`.protobin`) from the selected gRPC spec. The descriptor is stored in the `src/main/resources/grpc/` directory and is referenced by the gRPC server configuration and RPC operations in the Mule project. Once scaffolding completes, Anypoint Code Builder shows a notification such as **Scaffolding finished successfully** and the project reloads. When you create the project, Anypoint Code Builder: - Adds the gRPC API spec as a dependency in your project’s `pom.xml` file. - Adds the Mule and Java versions to the project’s `mule-artifact.json` file. - Scaffolds the gRPC specification into the new Mule project and opens the configuration XML file. The configuration XML file includes the interface for your implementation project. It also has a flow for each RPC method in the spec and a gRPC listener configuration. For streaming RPC patterns (server streaming or bidirectional streaming), additional server-side operations such as **Respond Server Stream** and **End Stream** are available to control how messages are sent and when the stream is closed. Add your business logic to each flow and run or deploy the application. ### Generate Project Structure After scaffolding finishes, the new Mule project contains: - **`flows.xml`** (in `src/main/mule/`)–Contains a flow for each RPC method defined in the gRPC service. Each flow includes a gRPC listener source and a logger. Update the logic in these flows to implement your use case. - **`global-configs.xml`** (in `src/main/mule/`)–Defines the HTTP Listener configuration and the gRPC server configuration (`grpc-server-config`). The gRPC server config references the generated Protobin descriptor so the run-time can serve the gRPC API. - **`grpc-properties.properties`** (in `src/main/resources/`)–Properties for the gRPC server, such as `grpc.server.host`, `grpc.server.port`, and `grpc.server.descriptorFile`. - **`src/main/resources/grpc/`**–Folder containing the generated `.protobin` descriptor file used by the gRPC connector at run time. The descriptor is stored in a subfolder organized by the asset’s unique ID and version (for example, `src/main/resources/grpc///.protobin`). You can confirm successful generation by opening this folder in the project explorer. ## Import a gRPC API Spec into an Existing Project If you [created an integration project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations), you can scaffold a gRPC API specification from Exchange into that project using the same **MuleSoft: Import Asset from Exchange** command. For gRPC API assets, Anypoint Code Builder automatically generates the Protobuf descriptor file (`.protobin`) as part of the import and scaffolding flow. Anypoint Code Builder creates a separate configuration XML file for the gRPC interface in your integration project. 1. In Anypoint Code Builder, open your integration project in the Explorer view. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 4. Depending on the language of your API spec, select one of these options: - **Rest API** for OAS or RAML - **GraphQL API** 5. If prompted, click **Allow** to allow sign in using Anypoint Platform and select the business group. 6. Type the name of the API spec, and press Enter. 7. Wait for Anypoint Code Builder to load a list of matches to the name. 8. From the list of asset types, select **gRPC API**. ![Assets from Exchange dropdown](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-assets-from-exchange.png) 9. Select the gRPC API specification to import. 10. At the prompt, select the version of the gRPC API spec (for example, `1.0.0`). 11. When prompted to scaffold the API dependency, select **Yes**. When you scaffold the gRPC API dependency, Anypoint Code Builder: - Adds the gRPC API spec as a dependency in your project’s `pom.xml` file. - Adds a new configuration XML file for the gRPC interface to the project. The new configuration XML file includes flows for each RPC method in the spec and a gRPC listener configuration. Implement the business logic in each flow within the Mule app. ## Re-scaffold a gRPC API Specification into a Project Re-scaffolding updates your implementation or integration project with the latest changes and version of a gRPC API specification in Anypoint Exchange. Re-scaffolding updates the configuration XML and dependencies in your project. 1. In Anypoint Code Builder, open your implementation or integration project in the Explorer view. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 4. Depending on the language of your API spec, select one of these options: - **Rest API** for OAS or RAML - **GraphQL API** 5. If prompted, click **Allow** to allow sign in using Anypoint Platform and select the business group. 6. Type the name of the API spec, and press Enter. 7. Wait for Anypoint Code Builder to load a list of matches to the name. 8. From the list of asset types, select **gRPC API**. ![Assets from Exchange dropdown](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-assets-from-exchange-multiversion.png) 9. Select the same gRPC API specification (or the updated asset). 10. At the prompt, select the newer version of the gRPC API spec (for example, `2.0.0`). 11. When prompted to scaffold the API dependency, select **Yes**. Anypoint Code Builder updates the project with the new flows and configuration. Review the configuration XML and adjust your business logic as needed. ## See Also - [Designing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec) - [Publishing Your gRPC API to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-grpc-api-to-exchange) - [Implementing APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implementing-apis) - [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis) - [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations) - [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions) --- product: Anypoint Code Builder version: master --- # Implementing APIs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use Anypoint Code Builder to start an API implementation by importing and scaffolding an API spec into an interface that you implement and integrate within a Mule app. Anypoint Code Builder supports automated scaffolding of OAS, RAML, AsyncAPI, GraphQL, and gRPC APIs, _except for_ APIs that reference OAS or JSON schema fragment dependencies from Exchange. The methods for implementing APIs using Anypoint Code Builder are: - [Scaffold an API from a spec in Exchange](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs#scaffold-new-integration) and create a new implementation project. - [Import an API spec](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs#import-spec-into-project) from Exchange to scaffold the API in an existing integration project. - [Implement a gRPC API spec](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-grpc-api-spec) by scaffolding a gRPC (Protobuf) specification from Exchange or a local design project. - [Scaffold an API](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis) into an implementation project without first publishing it to Anypoint Exchange, enabling iterative design and implementation. After scaffolding an API specification into an interface, you are ready to develop, test, and deploy your Mule app as described in [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations). For the ordered topics from API design through deployment, see [Take Your API Specification from Design Through Deployment](https://docs.mulesoft.com/anypoint-code-builder/tutorials#modular-learning-paths). ## Source Control for Implementation Projects Use source control management (SCM) to store and share your design, integration, and implementation projects. For source control options, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). --- product: Anypoint Code Builder version: master --- # Implementing AsyncAPI Specifications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder supports the implementation of AsyncAPI 2.6 and 2.0 specifications in projects running on Mule runtime version 4.6 or later. When creating an implementation project, Anypoint Code Builder imports and scaffolds an AsyncAPI specification hosted on Anypoint Exchange into an implementation project that you can develop further according to your business needs. Async APIs rely on message brokers to send and receive messages between different services or components in a decoupled manner. The services can send and receive messages without knowing the specific details of the recipient or sender, thus enabling asynchronous communication. For communicating with the recipient and sender, the message brokers use specific protocols. See [Supported Message Brokers](https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-module-reference#supported-message-brokers) in APIkit for AsyncAPI Module Reference. ## Before You Begin - If you don’t yet have access to Anypoint Code Builder, follow the procedures in [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Review important information about the scaffolding process for AsyncAPI specifications in [Scaffolding Fundamentals](#scaffolding). - You must have access to a supported AsyncAPI specification that is hosted on Anypoint Exchange: If your AsyncAPI specification isn’t published to Exchange, see [Creating and Importing AsyncAPI Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-asyncapi-api-specs). ## Scaffolding Fundamentals Before you implement an AsyncAPI specification with Anypoint Code Builder, it’s important to understand the scaffolding process at a high level. When scaffolding an AsyncAPI specification into a Mule project (implementation or integration), Anypoint Code Builder: - Introspects the AsyncAPI specification - Considers one specification at a time - Treats the imported specification as a modification of an existing specification and evaluates it for rescaffolding - Creates a new Mule project with a separate flow for each **publish** operation in the specification See [Example: Scaffolded Flows](#ex-flows-scaffolded). - Generates an empty XML file with the name of your Mule project if the AsyncAPI spec doesn’t include a **publish** operation - Produces the configuration properties file `dev-properties.properties` file in the `src/main/resources` directory of your Mule project See [Example: Configuration Properties File](#ex-config-properties). - Makes the APIkit for AsyncAPI Module (AsyncAPI Module) available for use in the project The module provides the following operations: - **Subscribe** (``): AsyncAPI **subscribe** operations in the specification are available for configuration as AsyncAPI **Publish** operations. See the [implemented example](#ex-flows-implemented) in Example: Scaffolded Flows. - **Message Listener** (``): AsyncAPI **publish** operations in the specification are configurable as **Message Listener** operations. The system publishes messages to a channel, and the Mule application listens for these messages. See examples in [Example: Scaffolded Flows](#ex-flows-scaffolded). The scaffolder transforms each **publish** operation into a **Message Listener** operation allowing the Mule application to read from the specified channel and process the published messages. - Generates a `global-configs.xml` file with connection configurations for **Message Listener** and **Publish** operations in the AsyncAPI Module and for any connectors that module depends on See [Example: Connection Configurations](#ex-connection-configs-scaffolded). Errors can occur during the scaffolding process: - If no channels are defined in the specification - For unsupported message broker protocols For _supported_ protocols, see [Supported Message Brokers](https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-module-reference#supported-message-brokers) in APIkit for AsyncAPI Module Reference. Anypoint Code Builder supports scaffolding these schema fragment files if they’re referenced from API specs:
AvroJSONRAML

AsyncAPI

Yes

Yes

No

GraphQL

No

No

Yes

OData

No

No

Yes

REST

No

Yes

Yes

SOAP

No

No

Yes

If you add a fragment that isn’t supported, the scaffolder doesn’t add these fragments as project dependencies when you import the spec from Exchange. However, you can scaffold schemas that are specified inline within the spec. ## Scaffold an AsyncAPI Specification into a Mule Project You can scaffold an AsyncAPI specification into a new or existing Mule project: - To scaffold an AsyncAPI specification into a new implementation project, follow the procedure in [Scaffold an AsyncAPI Specification into a New Project](#scaffold-new). - To scaffold or re-scaffold an AsyncAPI specification into an existing Mule project (implementation or integration), see [Scaffold or Re-Scaffold an AsyncAPI Specification into an Existing Project](#scaffold-existing). Re-scaffolding can be useful when the specification version is updated to introduce a new operation or server. If the specification contains a new server, the scaffolder adds a new configuration for it to the Mule project. > [!IMPORTANT] When re-scaffolding, the scaffolder acts on new combinations of channel, server, > and **publish** and **subscribe** operations groupings in the specification and doesn’t > re-scaffold combinations that aren’t new. ### Scaffold an AsyncAPI Specification into a New Project Create an implementation project from an AsyncAPI specification that is hosted on Anypoint Exchange. When creating the project, Anypoint Code Builder scaffolds the specification into an interface that you can implement as a Mule app. 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 3. From **Create**, click **Implement an API**: ![Implement an API link highlighted in the Getting Started section](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-option-mat.png) 4. Complete the **Implement an API Specification** form: ![Form for starting an implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-configure-in-task.png)
Field NameField Value

Project Name

Unique name for your project.

This name is used as the title and name of the project file. For example, if the project name is My Project, the project file name is my-project.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

Search an API Specification from Exchange

Name of the specification in Exchange. Search results can include OAS, RAML, AsyncAPI, and GraphQL specifications. Activate Show filters to narrow your search results. See Filtering Search Results for more information. To implement a gRPC API spec, see Implementing a gRPC API Specification with Anypoint Code Builder.

Mule runtime

Mule runtime version to use for your project.

Java Version

Java version to use for Mule.

You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. 5. Search for an API spec on Exchange: 1. Start typing the name of an API spec. 2. Press Enter to display a list of search results. 3. Click **Add Asset** to add the selected API spec: Only supported versions of the AsyncAPI specifications in Exchange are available for scaffolding. Unsupported versions don’t appear in the search results. ![List of AsyncAPI specification assets found in Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-search-async.png) 6. Click **Create Project**. When you create the project, Anypoint Code Builder: - Scaffolds your API specification into the new Mule project that opens to a configuration XML file with scaffolded flows (`flows.xml`), for example: ![AsyncAPI implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-asyncapi-project-ex.png) The configuration XML file includes the interface for your implementation project, with flows that contain Message Listener (``) configurations for each `publish` operation in the specification. - Adds the API specification as a dependency in your project’s `pom.xml` file, for example: ```xml e21dd38b-8231-45bf-aaa7-abde2072d538 my-asyncapi-example 1.0.0 evented-api zip ``` - Adds the Mule and Java versions to the project’s `mule-artifact.json` file, for example: ```json { "minMuleVersion": "4.7.0", "javaSpecificationVersions": ["17"] } ``` 7. Provide business logic to implement this interface within the Mule app: Define your business logic by configuring connector operations and processing components, as needed for your use cases. Provide configuration property values to the `dev-properties.properties` file. Optionally, create and configure additional flows or subflows for your processing requirements. To find guidance on configuring components, debugging, performing unit testing on your application, and other tasks, see [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations). For information about connectors and processors for configuring your business logic, see [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference). For an example of an AsyncAPI specification, the scaffolded interface, and business logic for processing some orders within a Mule application, see [Examples](#examples). ### Scaffold or Re-Scaffold an AsyncAPI Specification into an Existing Project Scaffold or re-scaffold an AsyncAPI specification from Exchange into an existing project in Anypoint Code Builder. Before re-scaffolding, review the [important note](#important-rescaffold) about which new configurations are scaffolded into your project. 1. Meet the prerequisites in [Before You Begin](#prereqs). Use of AsyncAPI features requires enablement by an Anypoint Platform organization administrator. 2. In Anypoint Code Builder, open your project. 3. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 4. Provide this command: ```command MuleSoft: Import Asset from Exchange ``` 5. Select **AsyncAPI** from the list of assets. 6. If prompted, log in to Anypoint Platform, allowing the extension to sign in and open an external web site and to open Visual Studio Code. 7. Type the full name or partially matching name of your specification, for example: My AsyncAPI Spec 8. Wait for Anypoint Code Builder to load a list of matches to the name, and then select your AsyncAPI specification. Only supported versions of the AsyncAPI specifications in Exchange are available for scaffolding. Unsupported versions don’t appear in the search results. 9. When prompted for a version, select the version of the API to import, such as `_1.0.0_` or `_2.0.0_`. 10. Select **Yes** when prompted to scaffold the API dependency. When the scaffolding process is complete, Anypoint Code Builder opens to a configuration XML file that contains the scaffolded flows (`flows.xml`). If you re-scaffolded the specification, see the [important note](#important-rescaffold) about which new configurations are scaffolded into your project. 11. Provide business logic to implement this interface within the Mule app: Define your business logic by configuring connector operations and processing components, as needed for your use cases. Provide configuration property values to the `dev-properties.properties` file. Optionally, create and configure additional flows or subflows for your processing requirements. To find guidance on configuring components, debugging, performing unit testing on your application, and other tasks, see [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations). For information about connectors and processors for configuring your business logic, see [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference). For an example of an AsyncAPI specification, the scaffolded interface, and business logic for processing some orders within a Mule application, see [Examples](#examples). ## Deploy an Implementation Deploy the implementation to CloudHub and CloudHub 2.0 or to another host. You can deploy to CloudHub or CloudHub 2.0 from [Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps). For other deployment options, see [Deployment Options](https://docs.mulesoft.com/runtime-manager/deployment-strategies). ## Examples The examples describe an API specification and implementation for processing orders and sending order status notifications by email and Slack. - [Example: AsyncAPI 2.6 Specification](#ex-asyncapi-spec) The AsyncAPI specification defines an order processing API that uses Anypoint MQ and Kafka protocols. - [Example: Scaffolded Flows](#ex-flows-scaffolded) The scaffolder generates a `flow.xml` file with a flow for each **publish** operation in the AsyncAPI specification (for re-scaffolding behavior, see [Scaffold an AsyncAPI Specification into a Mule Project](#scaffold-procedures)). The example describes the generated flows and configures components that provide order-processing logic to some of the flows. - [Example: Connection Configurations](#ex-connection-configs-scaffolded) The scaffolder generates a `global-configs.xml` file that contains connection configurations for the **Message Listener** and **Publish** operations in the flow and for connectors, such as Anypoint Connector for Apache Kafka (Apache Kafka Connector) and Anypoint Connector for Anypoint MQ (Anypoint MQ Connector) . The example describes the contents of the file and adds connection configurations for the Email and Slack connector operations. - [Example: Configuration Properties File](#ex-config-properties) The scaffolder generates a `dev-properties.properties` file in the `src/main/resources` directory of your Mule project. The example describes the generated file and adds configuration properties used in the email and Slack notifications to the file. - [Example: Notification Subflow](#ex-flows-notification) The subflow (``) in `notifications.xml` uses [Anypoint Connector for Email (Email Connector)](https://docs.mulesoft.com/email-connector/latest/) and [Anypoint Connector for Slack (Slack Connector)](https://docs.mulesoft.com/slack-connector/latest/) to implement the business logic for sending order confirmation messages by email and Slack. ### Example: AsyncAPI 2.6 Specification The following example defines an API specification that uses Anypoint MQ and Kafka protocols. The specification defines [channels](https://www.asyncapi.com/docs/concepts/channel) for orders (new, confirmed, and cancelled orders) that use Anypoint MQ, and it defines a channel that uses Kafka for backorders (items that aren’t in stock). Each channel includes a **publish** and **subscribe** operation. The [server](https://www.asyncapi.com/docs/concepts/server) settings in the specification define message brokers that determine the connectors to use (_indirectly_) when publishing events or subscribing to events through operations in the AsyncAPI module. ```yaml asyncapi: '2.6.0' info: title: Async-AMQ-Kafka-Orders version: '1.0.0' description: Orders API license: name: Anypoint MQ url: https://license.com contact: name: Max Muley email: max@salesforce.com url: http://www.salesforce.com defaultContentType: application/json tags: - name: Orders API description: API for orders servers: AMQ-prod: (1) url: https:://your_MQ_server_URL_here protocol: anypointmq protocolVersion: v1 description: Anypoint MQ broker Kafka-prod: (2) url: localhost:9092 protocol: kafka description: kafka broker channels: order-placed: (3) description: new orders channel servers: - AMQ-prod publish: operationId: listen-order-placed description: listen for new order events summary: Order Placed Event message: $ref: '#/components/messages/OrderPlaced' subscribe: operationId: publish-order-placed description: publish new order events summary: Order Placed Event message: $ref: '#/components/messages/OrderPlaced' order-cancelled: description: orders cancelled channel servers: - AMQ-prod publish: operationId: listen-order-cancellations description: listen for order cancellation events summary: Order Cancelled Event message: $ref: '#/components/messages/OrderCancelled' subscribe: operationId: publish-order-cancellations description: publish order cancellation events summary: Order Cancelled Event message: $ref: '#/components/messages/OrderCancelled' order-confirmed: description: orders confirmed channel servers: - AMQ-prod publish: operationId: listen-order-confirmations description: listen for order confirmation events summary: Order Confirmed Event message: $ref: '#/components/messages/OrderConfirmed' subscribe: operationId: publish-order-confirmations description: publish order confirmation events summary: Order Confirmed Event message: $ref: '#/components/messages/OrderConfirmed' order-backordered: (4) servers: - Kafka-prod description: orders backordered channel publish: operationId: listen-order-backordered description: listen for backorder events summary: Backorder Event message: $ref: '#/components/messages/BackOrder' subscribe: operationId: publish-order-backordered description: publish backorder events summary: Backorder Event message: $ref: '#/components/messages/BackOrder' components: (5) messages: OrderPlaced: payload: type: object properties: orderId: type: string customerName: type: string email: type: string items: type: array items: type: object properties: productId: type: string productName: type: string quantity: type: integer price: type: number OrderConfirmed: payload: type: object properties: orderId: type: string email: type: string OrderCancelled: payload: type: object properties: orderId: type: string email: type: string reason: type: string BackOrder: payload: type: object properties: orderId: type: string email: type: string ```
1AMQ-prod configures an Anypoint MQ broker.

You can discover the URL for an MQ broker from the region that you select when creating the queue. See the copy button in Create a Queue, and see Configuring Client Apps.

2Kafka-prod configures a locally hosted Kafka broker.
3order-placed configures an Anypoint MQ channel for publishing (listening for) and subscribing to (publishing) orders. Similarly configured channels are order-cancelled and order-confirmed.
4order-backordered configures a Kafka channel for publishing (listening for) and subscribing to (publishing) backorders.
5components defines the structure of messages for the different types of orders, which include OrderPlaced, OrderCancelled, OrderConfirmed, and BackOrder.
### Example: Scaffolded Flows When scaffolding the specification into an implementation project, Anypoint Code Builder creates a flow (``) for each **publish** operation and transforms the **publish** operation into a **Message Listener** source from the AsyncAPI module for APIkit (``). Each flow also includes a **Logger** component. For more information about the module, see [APIkit for AsyncAPI Module Reference](https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-module-reference). The scaffolder generates a `flow.xml` file from the specification. The scaffolder generates the following XML from the [AsyncAPI specification example](#ex-asyncapi-spec): ```xml (1) (2) ```
1AMQ-prod in <apikit-asyncapi:server value="AMQ-prod" /> identifies an Anypoint MQ server connection. For more information, see Example: Connection Configurations.
2Kafka-prod in <apikit-asyncapi:server value="Kafka-prod" /> identifies a Kafka server connection. For more information, see Example: Connection Configurations.
The following example adds business logic to the scaffolded flows: - `LISTEN:listen-order-placed` listens for orders and, when triggered, uses a DataWeave expression to check for sufficient inventory. If enough items exist in the inventory, the flow configures a **Publish** operation to publish order data to the `order-confirmed` channel, which triggers the `LISTEN:listen-order-confirmations` flow. If not, the flow adds a **Publish** operation to publish order data to a `order-backordered` channel, which triggers the `LISTEN:listen-order-backordered` flow. - `LISTEN:listen-order-confirmations` listens for order confirmations and, when triggered, sends order information to the `notification-flow` subflow, which sends confirmation notices through Slack and email (see [Example: Notification Subflow](#ex-flows-notification)). ```xml (1) (2) (3) (4) ```
1After the Message Listener in flow LISTEN:listen-order-placed is triggered by an order, an HTTP request operation (<http:request/>) requests and stores inventory data in the target variable inventory.
2The Choice component (<choice/>) checks the availableStock value in the target variable (vars.inventory.stockDetails.availableStock) against a quantity value from the order payload (payload.items.quantity[0]). The quantity value comes from an OrderPlaced message that triggers the flow.

If sufficient stock is available, a Set Payload component (<set-payload/>) configures a confirmation message that the Publish operation (<apikit-asyncapi:publish/>) submits to the order-confirmed channel, which triggers the LISTEN:listen-order-confirmations flow. If not, the flow publishes a message to the order-backordered channel, which triggers the flow LISTEN:listen-order-backordered.

3The Message Listener in flow LISTEN:listen-order-confirmations listens for activity on the Anypoint MQ channel order-confirmed. When triggered, the flow configures its <set-payload/> component to create an order confirmation message. The Flow Reference (<flow-ref/>) sends this message for processing within the notification-flow subflow.
4The flow LISTEN:listen-order-backordered is triggered by LISTEN:listen-order-placed when inventory is insufficient.
### Example: Connection Configurations The scaffolding process generates `global-configs.xml` for server connection configurations defined in the specification. The connection configuration for the AsyncAPI module within `` references the connection configurations for Kafka and Anypoint MQ connectors. The scaffolding process adds the connectors to the project based on the [server](https://www.asyncapi.com/docs/concepts/server) and [channel](https://www.asyncapi.com/docs/concepts/channel) configurations in the AsyncAPI specification. - In flows, **Publish** operations (``) use the connection configurations when publishing to specified channel and server combinations. The flows publish to Kafka and Anypoint MQ channels on `Kafka-prod` or `AMQ-prod` servers. - In flows, **Message Listener** operations (``) are automatically configured to listen on a specific channel based on a server `value` setting (`Kafka-prod` or `AMQ-prod`). This value matches one of the `serverKey` settings in the AsyncAPI connection configuration (``). ```xml ``` When adding business logic to your scaffolded project, you can add other connection configurations to `global-configs.xml`, including any connector operations you add to your flows or subflows in the application. The following example adds connection configurations for [HTTP](https://docs.mulesoft.com/http-connector/latest/http-connector-config-acb), [Email](https://docs.mulesoft.com/email-connector/latest/), and [Slack](https://docs.mulesoft.com/slack-connector/latest/) connector operations. You can define configuration properties for these, such as `${email.password}` in a [properties file](#ex-config-properties). ```xml (1) (2) (3) (4) ```
1HTTP Request connection configuration example
2HTTP Listener connection configuration example
3Email SMTP connection configuration example
4Slack connection configuration example
### Example: Configuration Properties File Anypoint Code Builder generates a `dev-properties.properties` file in the `src/main/resources` directory of your implementation project. The [specification example](#ex-asyncapi-spec) defines server settings for an Anypoint MQ broker. To listen for and publish messages to an Anypoint MQ queue, you must supply a `clientAppId` and `clientSecret` for an [MQ client app](https://docs.mulesoft.com/mq/mq-client-apps). The associated `api-path` setting is generated automatically during the scaffolding process. ```properties #Fri Jun 07 09:32:50 PDT 2024 anypointmq.server.AMQ-prod.clientAppId= anypointmq.server.AMQ-prod.clientSecret= api.path=resource\:\:e21dd38b-8231-45bf-aaa7-abde2072d538\:my-asyncapi-example\:1.0.0\:evented-api\:zip\:anypointmq-kafka-orders-demo-final.yaml ``` You can add additional properties to this file. The `email` and `slack` examples are for Email and Slack connector operations in the [notifications subflow](#ex-flows-notification). ```properties #Fri Jun 07 17:05:33 PDT 2024 anypointmq.server.AMQ-prod.clientAppId=my_client_app_id_here anypointmq.server.AMQ-prod.clientSecret=my_client_app_secret_here slack.token=my_slack_token_here email.host=smtp.gmail.com email.username=me@gmail.com email.password=my_gmail_password_here api.path=resource\:\:8dbc2756-83d6-4a1c-91c4-6eafbe7d7ae0\:async-amq-kafka-orders\:1.0.2\:evented-api\:zip\:anypointmq-kafka-orders-demo-compliant.yaml ``` For help with configuration properties, including secure properties for passwords and other sensitive data, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ### Example: Notification Subflow The subflow (``) in `notifications.xml` implements the business logic for sending order confirmation messages by email and Slack. This file isn’t generated by the scaffolder. When triggered by the Flow Reference component (``) in the `LISTEN:listen-order-confirmations` flow, the notifications subflow sends order confirmation messages. **(1)** **(2)** **(3)**
1Transforms payload output from the LISTEN:listen-order-confirmations flow into Mule variables that capture confirmation message data
2Posts the Slack confirmation message by using the <slack:post-message/>`* operation from Slack Connector
3Emails the confirmation message by using the <email:send/> operation from Email Connector
## See Also - [Built-In Connectors](https://docs.mulesoft.com/anypoint-code-builder/ref-connectors) - [Core Processors](https://docs.mulesoft.com/anypoint-code-builder/ref-components) - [DataWeave Overview](https://docs.mulesoft.com/dataweave/latest/) - [AsyncAPI JSON Schema Validation](https://docs.mulesoft.com/apikit/latest/apikit-asyncapi-module-reference#validation-of-messages) --- product: Anypoint Code Builder version: master --- # Implementing OAS, RAML, AsyncAPI, and GraphQL APIs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After you create your API spec, use Anypoint Code Builder to scaffold your API into a Mule project for your implementation or integration. Anypoint Code Builder supports scaffolding these schema fragment files if they’re referenced from API specs:
AvroJSONRAML

AsyncAPI

Yes

Yes

No

GraphQL

No

No

Yes

OData

No

No

Yes

REST

No

Yes

Yes

SOAP

No

No

Yes

If you add a fragment that isn’t supported, the scaffolder doesn’t add these fragments as project dependencies when you import the spec from Exchange. However, you can scaffold schemas that are specified inline within the spec. For OAS and JSON schema, you can also specify fragment files that you create manually within the implementation or integration project directory. Anypoint Code Builder uses the configuration defined in the spec to autogenerate a basic interface in your implementation project. This interface includes flows for each endpoint or operation, a built-in XML-based router, and error handlers, which you then implement within a Mule application. The process you use to implement your API depends on whether you already created a project for your integration or implementation, or published the spec to Exchange: - To scaffold an API using a spec from Exchange into: - A new project, see [Scaffold an API into a New Project](#scaffold-new-integration). - An existing project, see [Import an API Spec into a Project](#import-spec-into-project). - To update your project with the latest changes to a spec in Exchange, see [Re-scaffold an API Specification into a Project](#re-scaffold-spec). - To scaffold and re-scaffold an API into a project without publishing the spec to Exchange, see [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create and test your API spec](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs). - [Publish your API spec to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange). - Optionally, [create your integration project (Mule app)](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). - If your API spec is OAS 3.1, make sure your project uses Mule runtime 4.13 or later and APIkit for Mule 4 1.13.2 or later. ## Scaffold an API into a New Project If you have not already created a project, use Anypoint Code Builder to scaffold the API in a new Mule project: 1. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon. ![Anypoint Code Builder icon highlighted in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 2. From **Create**, click **Implement an API**: ![Implement an API link highlighted in the Getting Started section](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-option-mat.png) 3. Complete the **Implement an API Specification** form: ![Form for starting an implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/implement-api-configure-in-task.png)
Field NameField Value

Project Name

Unique name for your project.

This name is used as the title and name of the project file. For example, if the project name is My Project, the project file name is my-project.

Project Location

Your home directory or another directory you create.

Don’t create the project within another project directory.

Search an API Specification from Exchange

Name of the specification in Exchange. Search results can include OAS, RAML, AsyncAPI, and GraphQL specifications. Activate Show filters to narrow your search results. See Filtering Search Results for more information. To implement a gRPC API spec, see Implementing a gRPC API Specification with Anypoint Code Builder.

Mule runtime

Mule runtime version to use for your project.

Java Version

Java version to use for Mule.

You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. ![Search an API from Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-search.png) The form shows the selected API spec, for example: ![OAS Example API selected in the Implement an API Specification form](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-selected.png) 4. Click **Create Project**. When you create the project, Anypoint Code Builder: - Adds the API spec as a dependency in your project’s `pom.xml` file: ```XML e91cab06-650b-4634-9c6f-5bc4f4fc4d17 OAS-Example 1.0.1 oas zip ``` - Adds the Mule and Java versions to the project’s `mule-artifact.json` file. - Scaffolds your API into the new Mule project and opens the configuration XML file. The configuration XML file includes the interface for your implementation project, with flows for each endpoint in the spec, error handlers, and a built-in router, for example: ![OAS Example Integration in Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-scaffolded.png) This example includes: - The main flow - An HTTP Listener with a built-in router - Several error handlers For GraphQL APIs, Anypoint Code Builder also creates a data fetcher (``) as a source for each Mule flow. See the [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api) tutorial for an example GraphQL API and [Mapping a GraphQL API to Your Data Sources](https://docs.mulesoft.com/apikit/latest/apikit-graphql-api-mapping) for more information about data fetchers. You can now implement the interface within the Mule app. ## Import an API Spec into a Project If you have [created an integration project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations), you can scaffold an interface into the project by importing an API spec from Exchange. In this case, Anypoint Code Builder creates a separate configuration XML file for the interface in your integration project. 1. In Anypoint Code Builder, open your integration project in the Explorer view, for example, `my-project-name`. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 4. Depending on the language of your API spec, select one of these options: - **Rest API** for OAS or RAML - **GraphQL API** 5. If prompted, click **Allow** to allow sign in using Anypoint Platform and select the business group. 6. Type the name of the API spec, and press Enter. 7. Wait for Anypoint Code Builder to load a list of matches to the name. ![Assets from Exchange dropdown](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-assets-from-exchange.png) 8. Select the API spec to import. 9. At the prompt, select the version of the API spec, such as `v1.0.1`. 10. When prompted to scaffold the API dependency, select **Yes**. When you scaffold the API dependency, Anypoint Code Builder: - Adds the API spec as a dependency in your project’s `pom.xml` file: ```XML e91cab06-650b-4634-9c6f-5bc4f4fc4d17 OAS-Example 1.0.1 oas zip ``` - Adds the Mule and Java versions to the `mule-artifact.json` file: ```XML { "minMuleVersion": "4.6.2", "javaSpecificationVersions": [ "11" ] } ``` - Adds a new configuration XML file, such as `oas-example.xml`, to the project: ![New configuration file in the Explorer view](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-new-config-file.png) The new configuration XML file includes the interface for your integration project, with flows for each endpoint in the spec, error handlers, and a built-in router, for example: ![OAS Example Integration in Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-api-imported.png) This example includes: - The main flow - An HTTP Listener with a built-in router - Several error handlers For GraphQL APIs, Anypoint Code Builder also creates a data fetcher (``) as a source for each Mule flow. See the [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api) tutorial for an example GraphQL API and [Mapping a GraphQL API to Your Data Sources](https://docs.mulesoft.com/apikit/latest/apikit-graphql-api-mapping) for more information about data fetchers. You can now implement the interface within the Mule app. ## Re-scaffold an API Specification into a Project Re-scaffolding enables you to update a project with the latest changes and version of an API spec in Anypoint Exchange. Re-scaffolding updates the configuration XML and `pom.xml` in your project. To re-scaffold a spec defined in a local API design project that is not published to Exchange, see [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis), instead. This procedure assumes that an updated version of the spec is available from Exchange, for example, a 2.0.0 version: ![Selecting a new version of an API spec from Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-assets-from-exchange-multiversion.png) 1. In Anypoint Code Builder, open your implementation project in the Explorer view, for example, `my-implementation-project`. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 4. Depending on the language of your API spec, select one of these options: - **Rest API** for OAS or RAML - **GraphQL API** 5. If prompted, click **Allow** to allow sign in using Anypoint Platform and select the business group. 6. Type the name of the API spec, and press Enter. 7. Wait for Anypoint Code Builder to load a list of matches to the name. ![Assets from Exchange dropdown](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-assets-from-exchange-multiversion.png) 8. At the prompt, select the version of the API spec, such as `v2.0.0`. 9. When prompted to scaffold the API dependency, select **Yes**. When you scaffold the API dependency, Anypoint Code Builder: - Adds the API spec as a dependency in your project’s `pom.xml` file: ```XML e91cab06-650b-4634-9c6f-5bc4f4fc4d17 phoneSync1005 2.0.0 oas zip ``` - Updates the configuration XML file that contains the interface for your project with the changes to the imported spec. 10. Check for the changes to your implementation project. For example, if the updated spec adds a new endpoint, the configuration XML for the implementation project has a new flow for the endpoint. 11. If the spec introduced a new version number, open the `pom.xml`, and search for the new version of the dependency for the `artifactID` of the re-scaffolded spec. ## Tour the Interface File After you scaffold your API spec into an interface, examine the scaffolded flows and error handlers for your interface in the UI canvas and code editor. ![Scaffolded flows in the Canvas](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-scaffolded-flow-canvas.png) 1. In the Explorer view, open the configuration XML file for your interface. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) icon in the activity bar to open the canvas if it doesn’t open automatically. 3. Click **Flow List** to navigate through flows: ![Flow List example](/mulesoft/current/en-us/anypoint-code-builder/_images/int-flow-list.png) 4. In the code editor, locate the flows created for the endpoints in your API spec. Example Flow ```xml #[vars.outboundHeaders default {}] #[payload] #[vars.outboundHeaders default {}] 404 ``` 5. Review the automatically generated Error Handler components. Example Error Handler Component ```xml 404 ``` ## Name Your Interface and Implementation Files When you import an API spec into an existing integration, Anypoint Code Builder automatically names the configuration XML file based on the API spec name. You can change the file names to something more descriptive, such as based on their function, for example: - `interface.xml` receives all incoming requests to your application and scaffolded flows validate and route requests. - `implementation.xml` provides the backend logic for calls to the interface. To rename a file, right-click on the file, select **Rename**, and provide a new name. ## See Also - [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) - [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis) - [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api) --- product: Anypoint Code Builder version: master --- # Import a DataWeave Library > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder enables you to import DataWeave libraries from Exchange into your Mule application. A DataWeave library is a reusable package of DataWeave modules and mapping files, and resource files, such as JSON, XML, and CSV. You can import a DataWeave library the same way you import any other asset from Exchange: 1. In Anypoint Code Builder, open the Command Palette by pressing Ctrl+Shift+p (Windows) or Cmd+Shift+p (Mac), and provide the following command: ```command MuleSoft: Import Asset from Exchange ``` ![The command is highlighted in the Command Palette search results](/mulesoft/current/en-us/anypoint-code-builder/_images/import-asset-exchange-implementation.png) 2. Select **DataWeave Library**. ![The DataWeave Library option is highlighted in a list of asset types](/mulesoft/current/en-us/anypoint-code-builder/_images/add-dw-library-from-exchange.png) 3. Start typing the name of the DataWeave library you need, and press Enter for Anypoint Code Builder to suggest the assets that match your search, such as **DataWeave**: ![The DataWeave JWT Library is highlighted in a list of available DataWeave libraries](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-dw-libraries.png) 4. Select the DataWeave library. 5. Select the version of the DataWeave library to import. Anypoint Code Builder displays a message indicating that the dependency was successfully added. ## See Also - [Sharing and Reusing Custom DataWeave Modules and Mappings](https://beta.docs.mulesoft.com/beta-dataweave/dataweave/2.4/dataweave-share-reuse) - [Mock Data Using a DataWeave Library](https://docs.mulesoft.com/anypoint-code-builder/mock-data-using-dw-library) --- product: Anypoint Code Builder version: master --- # Importing a Connector from Exchange > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connectors provide operations for retrieving, modifying, and sending data to and from systems. In addition to the [built-in connectors](https://docs.mulesoft.com/anypoint-code-builder/acb-reference#builtin-connectors) that Anypoint Code Builder provides, you can download many other connectors from Anypoint Exchange. Exchange lookups in Anypoint Code Builder use platform search components, which provide a more consistent asset discovery and selection experience across supported Exchange flows. - [Import a Connector from the Canvas](#import-canvas) - [Import a Connector with a Command](#import-command) ## Import a Connector from the Canvas To import a connector from Exchange and add it to your configuration: 1. {open-config-xml}, such as `my-project-name.xml`. 2. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) in the activity bar to open the UI canvas if it doesn’t open automatically. 3. Add the connector the same way you added other components from the canvas: 1. In the canvas, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, click **Connectors**. 3. Click the connector name and then click the operation to add, such as **Publish**: ![Add Publish operation from the Anypoint MQ Connector](/mulesoft/current/en-us/anypoint-code-builder/_images/int-add-connector-operation.png) 4. If the connector is not available locally, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png) (**Search in Exchange**) toggle: ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png)
1Search locally
2Search in Exchange
5. Select the connector to add to your project. You can select from connector versions that are compatible with your Mule runtime and Java version set in Project Properties. 6. Select the operation from the **Add Component** panel. ## Import a Connector with a Command To import a connector from Exchange to use later in your project: 1. {open-config-xml}, such as `my-project-name.xml`. 2. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) in the activity bar to open the canvas if it doesn’t open automatically. 3. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 4. Select the following command: ```command MuleSoft: Import Asset from Exchange ``` 5. Select **Connector**. 6. Search for the connector name to import, such as "MQ," for example: !["Import Anypoint MQ Connector from Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/int-import-connect-exchange.png) 7. Select the connector. 8. At the prompt, select the version of the connector to import, such as `v4.0.3`. Anypoint Code Builder imports the connector and makes it available in the Components list. To change or upgrade connector versions later, see [Select Connector Versions for a Project](https://docs.mulesoft.com/anypoint-code-builder/int-versions#project-versions-connectors). For more information about the connectors available on Exchange, see [Connectors](https://docs.mulesoft.com/connectors/). For more information about Exchange, see [Exchange (US)](https://anypoint.mulesoft.com/exchange/) or [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) and [Anypoint Exchange Overview](https://docs.mulesoft.com/exchange/). --- product: Anypoint Code Builder version: master --- # Importing Projects into Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Import a project JAR file or folder into a workspace. A project directory contains a Mule application for an integration or implementation. You can also import a Maven multi-module project and apply the properties, dependencies, and versions from a Maven parent POM file to the `pom.xml` file of each child module. For more information about the Maven parent POM file, see [Maven Project Parent POM](https://maven.apache.org/pom/maven/index.html). If you encounter an import issue, check for workarounds in [Known Issues](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#import-issues) in the Anypoint Code Builder Release Notes or in [Troubleshooting](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting). To _export_ a JAR file that packages a project with resources from your application, see [Exporting Mule Projects](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Close any open project. Show me how - Select **File** > **Close Folder**. > [!IMPORTANT] Never open or unpack a project folder within another project folder. ## Import and Open a Project in Anypoint Code Builder Use Anypoint Code Builder to upload a project directory or shareable JAR file into a project workspace. - [Import a Shareable Project JAR File into Anypoint Code Builder](#desktop-project-package) - [Import a Project Folder into Anypoint Code Builder](#desktop-project-folder) - [Open a Project Folder](#both-open-project-folder) ### Import a Shareable Project JAR File into Anypoint Code Builder Import a shareable JAR file for a snapshot of a Mule project into Anypoint Code Builder. To create a shareable JAR, see [Export Mule Project](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project#export-mule-project). The contents are lightweight because they don’t include dependencies. Anypoint Code Builder generates the dependencies configured in the `pom.xml` for the project. To import a shareable JAR file in Anypoint Code Builder: 1. Ensure that no project is open. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import a Mule Project ``` 4. Navigate to the shareable JAR file to import, and click **Select jar file to import**. 5. Navigate to a folder to which to unpack the JAR file, such as your home directory or any folder _outside_ of a Mule project folder. 6. Click **Select project folder**. Anypoint Code Builder unpacks the shareable JAR file for your project into the selected folder. 7. If your Mule project folder is closed, [open a workspace](#both-open-project-folder) for the project at the project’s _root_ directory. In addition to loading the graphical canvas, Anypoint Code Builder also loads dependencies defined in the `pom.xml` for the project. If a Mule runtime or Java configuration is missing, set the versions to use from the canvas. Libraries load to the `target/repositories` directory within the project folder. 8. Test your project: 1. In the open project, check for errors and make sure that the canvas and code editor load correctly, which indicates that component dependencies resolved. 2. Check for any configurations to modify, such as ports or file paths in the configuration XML. 3. Run and debug your project: For guidance, see [Run Your Application in Debug Mode](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#run-debug-mode). ### Import a Project Folder into Anypoint Code Builder Although it is more common to import a shareable JAR file or to open a project workspace from file directory, you can also drag a Mule project folder into the Explorer view and open the project in a VS Code workspace. Open any valid project folder, including a project from Anypoint Studio (Studio) that’s stored on your desktop. Alternatively, use the procedure in [Open a Project Folder](#both-open-project-folder) to open the project from your file directory instead of dragging and dropping the folder into Anypoint Code Builder. To import a project folder into Anypoint Code Builder: 1. Ensure that no project is open. 2. Navigate to a location for your project folder: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder ``` 3. Navigate to and select a folder for your imported project, such as your home directory or any folder _outside_ of a Mule project folder, and then click **Open**. 3. Drag your project directory from your computer to the Explorer view in VS Code, for example: ![Drag project folder to Explorer view](/mulesoft/current/en-us/anypoint-code-builder/_images/int-drag-folder.png) 4. Select **Copy Folder**. If you instead select **Add Folder to Workspace**, you can start over by selecting the project in the Explorer, right clicking, and then selecting **Remove Folder from Workspace**. After removing, drag and copy the project folder to the Explorer without adding it to a workspace. 5. If your Mule project folder is closed, [open a workspace](#both-open-project-folder) for the project at the project’s _root_ directory. In addition to loading the graphical canvas, Anypoint Code Builder also loads dependencies defined in the `pom.xml` for the project. If a Mule runtime or Java configuration is missing, set the versions to use from the canvas. Libraries load to the `target/repositories` directory within the project folder. 6. If prompted, click **Set Version** to set a supported Mule runtime or Java version in the **Project Properties** tab. 7. Test your project: 1. In the open project, check for errors and make sure that the canvas and code editor load correctly, which indicates that component dependencies resolved. 2. Check for any configurations to modify, such as ports or file paths in the configuration XML. 3. Run and debug your project: For guidance, see [Run Your Application in Debug Mode](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#run-debug-mode). ## Open a Project Folder Open or reopen a project workspace folder for your application. This procedure works for projects built in Anypoint Code Builder and for projects stored on your desktop that are built in Anypoint Studio (Studio). 1. If your Mule project folder is closed, open the project at its _root_ directory: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to and select the _root_ folder for your project, for example: - Integration or Implementation Example - Design Project Example Example of a root folder and subdirectories of an integration or implementation project in Anypoint Code Builder: ![Project folder for an integration or implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root.png) VS Code treats the root as a workspace, which enables the canvas to load properly. Example of the root directory for an API design project in Anypoint Code Builder: ![Project folder for a design project](/mulesoft/current/en-us/anypoint-code-builder/_images/int-open-root-design.png) The root of a project is the top-level folder that Anypoint Code Builder generates when you create a project. Do not navigate to the project root’s parent or ancestor directory or to one of its child or descendant directories. 2. Click a configuration XML file for your project if it doesn’t open automatically. 3. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) icon in the activity bar to open the canvas if it doesn’t open automatically. 4. To monitor progress as the project loads, open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 5. Select **Mule DX Server** from the dropdown list. To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. 6. Test your project: 1. In the open project, check for errors and make sure that the canvas and code editor load correctly, which indicates that component dependencies resolved. 2. Check for any configurations to modify, such as ports or file paths in the configuration XML. 3. Run and debug your project: For guidance, see [Run Your Application in Debug Mode](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#run-debug-mode). ## See Also - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Exporting Mule Projects](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project) --- product: Anypoint Code Builder version: master --- # Integrate Salesforce Data into Slack and Email Notifications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Create an integration that notifies you through email or Slack when a new case is created in Salesforce. The integration that you build contains a flow with the following logic: - The creation of a new case in Salesforce triggers your flow. - If the case is escalated, your application sends an email to the regional leader including the case number, origin, reason, priority, and status. - If the case is not escalated, your application sends a message to a Slack channel with the same information. ## Before You Begin Before you begin, ensure you: - Set up your MuleSoft environment. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. - Set up a Salesforce demo environment. - [Sign up for a developer organization](https://www.salesforce.com/products/free-trial/developer/). - [Create a developer security token](https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&type=5). - Have a personal or business Gmail account. - Have a personal or business Slack account. ### Set Up Your Slack Workspace 1. Navigate to [Slack](https://slack.com/) and log in using your organization credentials. If your work organization restricts users from creating new workspaces, log in using your personal email account. 2. Create a new Workspace called **Integration Test**. 3. Skip the step to invite new users and type a brief description of your Workspace, for example, **This is a test Workspace**. 4. Navigate to [Your Apps](https://api.slack.com/apps) and click **Create an App**: ![Create an App in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-create-app.png) 5. Select **From scratch**. 6. Name your app **OAuth for Anypoint Code Builder**, and select your **Integration Test** workspace. 7. Click **Generate**: ![Generate a configuration token in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/generate-token.png) 8. Click **Create App**: ![Name your app and select a workspace in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-create-app-workspace.png) 9. Click **Install App**: ![Install an app in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-install-app.png) 10. Click **Permission scope**: ![Click permission scope in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-install-permission-scope.png) 11. Scroll down to the **Scopes** section and, under **Bot Token Scopes**, select **Add an OAuth Scope**, and select **chat:write.public**: ![Add OAuth scope in Slack](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-bot-permissions-chat-write.png) 12. Select **Add scopes** when prompted to add other necessary scopes for `chat:write.public`. 13. Scroll up to the **OAuth Tokens for Your Workspace** and select **Install to Workspace**. 14. Click **Allow**: ![Allow OAuth access to workspace](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-allow-install-app-workspace.png) 15. Under **Bot User OAuth Token**, click **Copy** and save it on a safe location. ![Copy OAuth token for Bot User](/mulesoft/current/en-us/anypoint-code-builder/_images/slack-copy-oauth-token.png) You use this token to connect to your Slack workspace from Anypoint Code Builder: 16. Create a new public channel called "this-is-a-test" in your **Integration Test** workspace. 17. Add the OAuth for Anypoint Code Builder app to the `this-is-a-test` channel. ### Set up an App Password for Your Email Later in this tutorial, you configure the Email Connector to send emails to your configured email account. To avoid using your email password, follow [Google instructions](https://support.google.com/accounts/answer/185833?visit_id=637917932546436561-2352829986&p=InvalidSecondFactor&rd=1) to configure an App password. > [!IMPORTANT] The Gmail account must have 2-factor authentication enabled to configure an App > password. ## Create an Integration 1. Navigate to Anypoint Code Builder. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Develop an Integration ``` 4. Provide integration project properties to the **Develop an Integration** form: ![Develop an Integration form](/mulesoft/current/en-us/anypoint-code-builder/_images/int-create-integration-scratch.png) 1. Under **Project Name**, provide the name **New Case Salesforce**. 2. Under **Project Location**, click **Browse**, and then select your home directory. 3. Under **Create**, select **Empty Project**. 4. Select a **Mule runtime** and **Java** version. You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. For information about version support and automated Mule patch updates, see [Mule and Java version support](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#versions-mule-jdk). To set default Mule runtime and Java versions for the projects you create, see [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). 5. Click **Create Project**. Projects open instantly using the bundled Mule runtime versions. Anypoint Code Builder provides a notification only if you must download a specific Mule runtime version or Java version for running or debugging your application. The Mule runtime versions download to `${user.home}/AnypointCodeBuilder/runtimes`, and the selected Java version downloads to `${user.home}/AnypointCodeBuilder/java`. 6. Proceed to [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc) to create configuration files for connectors. [Create a Configuration File for Slack and Salesforce](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-config-files-sfdc) --- product: Anypoint Code Builder version: master --- # Invalidate Cache () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Invalidate the complete cache in the referenced caching strategy. Invalidate cache entries when you want the Cache Scope to recalculate the value for those cache entries. Alternatively, you can configure the caching strategy to invalidate entries automatically based on time by setting the `entryTtl` parameter in the defined custom object store. ## Component XML This component supports the following XML structure: ```xml ``` Invalidate Cache (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Invalidate cache (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Cachingstrategy ref

cachingStrategy-ref

Reference to the caching strategy for the cache to invalidate.

## Examples The following examples show how to manually invalidate a cache and how to set automatic invalidation for a caching strategy. ### Example: Invalidating a Cache The following example invalidates the complete cache in the referenced caching strategy. ```xml ``` ### Example: Setting Automatic Invalidation for a Caching Strategy The following example configures a caching strategy with a custom object store that automatically invalidate cache entries. ```xml ``` ## See Also - [Object Store Configuration](https://docs.mulesoft.com/mule-runtime/latest/mule-object-stores#object-store-config) - [Invalidate Key](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-key) --- product: Anypoint Code Builder version: master --- # Invalidate Key () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Invalidate a single cache key in the referenced caching strategy. ## Component XML This component supports the following XML structure: ```xml ``` Invalidate Key (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Invalidate key (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Cachingstrategy ref

cachingStrategy-ref

Reference to the caching strategy for the cache key to invalidate.

Key generation expression

keyGenerationExpression

Optional. A DataWeave expression to generate the key to invalidate. Use the same expression configured in the caching strategy that generated the key.

Keygenerator ref

keyGenerator-ref

N/A

## Examples The following example invalidates a cache key: ```xml ``` ## See Also - [Cache Scope](https://docs.mulesoft.com/anypoint-code-builder/acb-component-cache) - [Invalidate Cache](https://docs.mulesoft.com/anypoint-code-builder/acb-component-invalidate-cache) --- product: Anypoint Code Builder version: master --- # Iteratively Design and Implement an API Specification > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Scaffold a REST API specification into an implementation project, and sync changes to the specification with the interface without first publishing to Anypoint Exchange. For example, after adding a new endpoint to your API specification, you can re-scaffold the change into the interface to add a flow for that endpoint to the interface’s configuration XML file. The interface XML is automatically created in a Mule project during the scaffolding process. You define an API in a specification file within an API Design project. Iterative API design and implementation takes place in a _multi-root workspace_ in VS Code. To map project folders for your API specification and implementation projects into a multi-root workspace, VS Code uses a file with the extension `.code-workspace`. For your projects to work properly, this file _must not reside within_ either project folder. In addition, Anypoint Code Builder permits only one pair of iterative design and implementation project folders per multi-root workspace. The procedures for creating the specification and implementation projects are designed to meet these requirements. For information in the VS Code documentation, see [Multi-root Workspaces](https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces). ## Before You Begin - Set up your MuleSoft environment. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API spec to Exchange, Anypoint Code Builder requests the name of the business group. ## Create an API Specification 1. Open a new window in VS Code by pressing Cmd+Shift+n (Mac) or Ctrl+Shift+n (Windows). This step helps prevent the possibility of creating an API specification in a multi-root workspace that already contains iterative design and implementation projects and ensures that the command required in the next procedure, [Scaffold the Local REST API Specification into an Interface](#scaffold), is available. 2. In the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-ms-logo.png) (**Anypoint Code Builder**) icon to open Anypoint Code Builder. 3. Start an API specification by clicking the quick action **Design an API**. Alternatively, open the Command Palette by pressing Ctrl+Shift+p (Mac) or Cmd+Shift+p (Windows), and provide this command: ```command MuleSoft: Design an API ``` 4. If prompted, sign in to Anypoint Platform, and follow all the prompts to reopen Anypoint Code Builder. 5. Complete the **API Specification** form:
Field NameField Value

Project Name

Retrieve Users API
Alternatively, provide a similar name of your choice. The name must be unique. The name of the project and specification file is based on the name you provide.

Project Location

Your home directory or another directory you create (see Adding Folders to Your Home Directory).

API Type

REST API
Anypoint Code Builder supports the REST API type for iterative design.

API Specification Language

RAML 1.0
Anypoint Code Builder supports OAS (JSON), OAS (YAML), and RAML.

6. Click **Create Project**. This process creates a project that contains your API specification within your workspace. 7. Open your API specification file, `retrieve-users-api.raml`. 8. To track the progress of internal processing, open the **Output** panel to the **Mule DX Server**. To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. Show me how 1. Press Cmd+Shift+u (Mac) or Ctrl+Shift+u (Windows) to open the Output panel. 2. Select **Mule DX Server** from the dropdown list in the panel. To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. For more guidance, see [Viewing Logs and Errors](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel). 9. In the editor for your API specification, add this example to `retrieve-users-api.raml`: ```raml #%RAML 1.0 title: Retrieve Users API version: 1.0.development /users: get: description: Retrieve a list of all the users responses: 200: body: application/json: example: | [{ "id": 1, "name": "Leanne Graham", "username": "Bret", "email": "Sincere@april.biz", "address": { "street": "Kulas Light", "suite": "Apt. 556", "city": "Gwenborough", "zipcode": "92998-3874", "geo": { "lat": "-37.3159", "lng": "81.1496" } }, "phone": "1-770-736-8031 x56442", "website": "hildegard.org", "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net", "bs": "harness real-time e-markets" } }] ``` 10. Proceed to [Scaffold the Local REST API Specification into an Interface](#scaffold). ## Scaffold the Local REST API Specification into an Interface Scaffold your local REST API specification into a local implementation project. The scaffolding process creates a configuration XML for your implementation. Local projects reside in Anypoint Code Builder. To scaffold your local API specification: 1. With `retrieve-users-api.raml` open, prepare to scaffold the specification into a Mule project: 1. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-implement-api.png) (**Implement this local API**) icon in the activity bar: ![UI with the X-shaped icon for the command Implement this Local API](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-local-spec-implement.png) Alternatively, open the Command Palette by pressing Cmd+Shift+p (Mac) or Ctrl+Shift+p (Windows), and provide this command: ```command MuleSoft: Implement this Local API ``` Do not select the command `MuleSoft: Implement an API Specification`, which is for implementing a specification that is published on Anypoint Exchange and not for implementing a local API specification. 2. Click **OK** when the UI displays the message **We’ll create a workspace to keep your API specification and Mule project in sync.** > [!IMPORTANT] At the prompt to save a file with the extension `.code-workspace` for a > multi-root workspace, do not save this file within your API specification project folder. > Proceed to the next step, instead. 3. Navigate up to the parent folder you created for your workspace, and save the `.code-workspace` file. 4. Make sure that your **Mule DX Server** output is available for tracking the progress of internal processes in the **Output** panel. To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. The UI displays a message: **Implementing local API implementation, please wait.** As you monitor output, wait for the field with placeholder text `_Mule project name_` to appear in the UI, for example: ![Provide name of scaffolded implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-api-create-project.png) 2. Start the scaffolding process by entering a name for your Mule implementation project, such as `retrieve-users-implementation`: ![Provide name of scaffolded implementation project](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-api-create-project-retrieve-users.png) 3. When prompted, click **Select target folder**. The target folder is the project folder where you created your API specification. The UI provides updates while the scaffolding process takes place: - **Executing scaffolding operation, please wait** - **Scaffolding process ended. You can now start iterating over your local API and implementation project** 4. From your multi-root workspace in the Explorer, Anypoint Code Builder opens the scaffolded specification in your new Mule project. The configuration XML file for the implementation (`retrieve-users-implementation.xml`) is located in an implementation project directory similar to this one: ```implementation retrieve-users-implementation/src/main/mule/retrieve-users-implementation.xml ``` - The canvas for this Mule project contains a Router component and several error handlers. APIkit automatically creates these components during the scaffolding process. - In the implementation XML, the flow `` contains an `` element with your example: ```XML ``` 5. Proceed to [Update the API Specification and Re-scaffold the Implementation XML](#update-api-spec). ## Update the API Specification and Re-scaffold the Implementation XML Add an endpoint to your specification file and re-scaffold: 1. In the Explorer, navigate to the specification file `retrieve-users-api.raml` in the **Retrieve Users API** directory. 2. Append the following `/userbyid` endpoint configuration to your RAML file: ```raml #%RAML 1.0 title: Retrieve User version: 1.0.development /users: get: description: Retrieve a list of all the users responses: 200: body: application/json: example: | [{ "id": 1, "name": "Leanne Graham", "username": "Bret", "email": "Sincere@april.biz", "address": { "street": "Kulas Light", "suite": "Apt. 556", "city": "Gwenborough", "zipcode": "92998-3874", "geo": { "lat": "-37.3159", "lng": "81.1496" } }, "phone": "1-770-736-8031 x56442", "website": "hildegard.org", "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net", "bs": "harness real-time e-markets" } }] /userbyid: get: description: Get information about a particular user queryParameters: id: description: Specify the id of the user you want to retrieve type: integer required: false example: 3 responses: 200: body: application/json: example: | [{ "id": 3, "name": "Clementine Bauch", "username": "Samantha", "email": "Nathan@yesenia.net", "address": { "street": "Douglas Extension", "suite": "Suite 847", "city": "McKenziehaven", "zipcode": "59590-4157", "geo": { "lat": "-68.6102", "lng": "-47.0653" } }, "phone": "1-463-123-4447", "website": "ramiro.info", "company": { "name": "Romaguera-Jacobson", "catchPhrase": "Face to face bifurcated interface", "bs": "e-enable strategic applications" } }] ``` 3. Re-scaffold the API specification to update your Mule project: 1. Open the Command Palette by pressing Cmd+Shift+p (Mac) or Ctrl+Shift+p (Windows), and provide this command: ```command MuleSoft: Re-scaffold this local API ``` > [!NOTE] This command is available only for API specifications that have not been published > to Anypoint Exchange. If you publish the spec to Exchange, re-scaffolding is no longer > available for that asset. 2. After receiving a message that your project **has been rescaffolded successfully**, navigate to your implementation XML file, and notice the new flow (``) for the `userbyid` endpoint: ```XML ... ``` 4. Proceed to [Publish the API Specification to Exchange](#publish). ## Publish the API Specification to Exchange Publish the API specification to Anypoint Exchange to make the specification discoverable by your team members. 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command MuleSoft: Publish API Project to Exchange ``` 3. If prompted, click **Allow**, and follow the prompts to sign in to Anypoint Platform. 4. In **Select a Business Group**, find and select your business group for the project. For more information, see [Before You Begin](#prereqs). 5. Type a project name: **Retrieve Users API**. ![Publish Retrieve Users API](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-api-publish.png) 6. Confirm the artifact ID: **Retrieve-Users-API**. 7. Confirm the asset version: **1.0.0**. 8. Confirm the API version: **v1**. The status bar provides progress-related messages before Anypoint Code Builder updates your Mule project POM file to point to `v1.0.0` of your API specification: - **Publishing API Specification to Exchange** - _Project_ **has been successfully published to Exchange** The specification is now available on [Anypoint Exchange](https://anypoint.mulesoft.com/exchange/?show=org&sort=last) for team members in your business group to scaffold into their projects and implement. See [Scaffold the API Specification from Exchange](#scaffold-from-exchange). ## Scaffold the API Specification from Exchange Team members in your business group can import your API specification from Exchange: 1. Open a new VS Code instance. 2. Import version 1.0.0 of your API from MuleSoft VCS: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command MuleSoft: Implement an API Specification ``` 3. In the **Implement an API Specification** tab that opens: - Provide a new name for the implementation. - Select or create a new project location. - Find your API specification on Anypoint Exchange, and click **Add** to insert the API name into the field. 4. Click **Create Project** to start scaffolding the specification into a new implementation. 3. Implement the scaffolded specification. ## Close a Multi-Root Workspace Close a multi-root workspace with the command `Workspaces: Close Workspace`. After closing, you can reopen a synchronized project from the workspace that you create when implementing the API. ## Open a Multi-Root Workspace Open a multi-root workspace from the `.code-workspace` file, such as `Retrieve Users API.code-workspace`, for the projects in the workspace. 1. Open VS Code. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide this command: ```command File: Open Workspace from File... ``` 4. Navigate to and double-click the `.code-workspace` file for projects in the workspace. The projects open in the Explorer view, and the heading for the multi-root-workspace appends a **(WORKSPACE)** identifier, for example: ![A multi-root workspace in the Explorer](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-api-multiroot-workspace.png) --- product: Anypoint Code Builder version: master --- # Iteratively Design and Implement APIs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Using Anypoint Code Builder, you can scaffold an API specification into a new integration project without first publishing the API to Anypoint Exchange. As you make changes, you sync changes in the project by re-scaffolding the spec. For example, after adding a new endpoint to your API spec, you re-scaffold to add a new flow for that endpoint to the configuration XML file. Anypoint Code Builder supports scaffolding these schema fragment files if they’re referenced from API specs:
AvroJSONRAML

AsyncAPI

Yes

Yes

No

GraphQL

No

No

Yes

OData

No

No

Yes

REST

No

Yes

Yes

SOAP

No

No

Yes

If you add a fragment that isn’t supported, the scaffolder doesn’t add these fragments as project dependencies when you import the spec from Exchange. However, you can scaffold schemas that are specified inline within the spec. For AsyncAPI specifications, iterative design and implementation is not supported at this time. After syncing the API spec and related Mule project, you can modify the API specification and implement changes simultaneously. By using this method to implement the API, you reflect your changes to your API design directly into the interface in your Mule project. Iterating between API design and implementation tasks speeds up the development process. When you’re ready, publish your API specification to Exchange and deploy your Mule project. When you scaffold your API specification into a new integration project, Anypoint Code Builder creates a configuration XML for your implementation. ## Multi-Root Workspace Considerations When you scaffold an API, Anypoint Code Builder creates a _multi-root workspace_ in VS Code with both the API spec and integration projects and keeps them synchronized. VS Code uses a file with the extension `.code-workspace` to store your multi-root workspace. This file maps the folders for your API spec and implementation projects. > [!IMPORTANT] For your projects to work properly, the `.code-workspace` file _must not reside_ > within either project folder. In addition, Anypoint Code Builder permits only one pair of iterative design and implementation project folders per multi-root workspace. For general information about using workspaces in Anypoint Code Builder, see [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). For more information, see [Multi-root Workspaces](https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces) in the VS Code documentation. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create and test your API specification](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs). ## Scaffold an API Spec into a New Implementation Project To scaffold the current API spec into a new implementation project: 1. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-implement-api.png) (**Implement this local API**) icon in the activity bar: ![Implement this local API icon in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-local-api.png) Alternatively, use the Command Palette. Show me how 1. Open the Command Palette - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Select the following command: ```command MuleSoft: Implement this Local API ``` 2. At the prompt, click **OK**: ![Prompt: \*We’ll create a workspace to keep your API specification and Mule project in sync.\*](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-local-workspace-prompt.png) After the workspace is created, Anypoint Code Builder builds and packages the API specification, and publishes it to a local Maven repository as a snapshot. 3. Navigate to a directory for your new project, and click **Save**. Anypoint Code Builder starts creating a multi-root workspace with your API specification and Mule project. In the multi-root workspace, you can work with both your API specification and Mule project folders at the same time. > [!IMPORTANT] Do not accept the default location. > > Save your `.code-workspace` file in a directory outside of your project folder, _not_ within > your API spec folder. 4. When prompted, provide project configuration details: 1. Provide a name for your Mule project. 2. Navigate to a folder for your Mule project, and click **Select target folder**. 3. Select a Mule runtime version for the project. 4. Select a Java version for the project. Anypoint Code Builder scaffolds your local API specification into a new Mule project and displays a message when complete: ![Scaffolding process ended message](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-local-api-scaffolded.png) Both the API spec and the Mule project open, for example: ![API spec and implementation project in Explorer view](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-local-api-workspace.png)
1API spec
2Implementation project
5. In the Explorer view, open the configuration XML file for your interface. 6. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show canvas UI**) icon in the activity bar to open the canvas if it doesn’t open automatically. Notice that the new Mule project includes flows for each endpoint, a built-in XML-based router, and error handlers, which you then implement within a Mule application. You can switch between the spec and the implementation project in the Explorer view. To close or reopen your workspace later, see [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). ## Re-Scaffold the API Spec After making changes to your API spec, such as adding a new endpoint, re-scaffold the spec to update your Mule project: 1. In the Explorer view, navigate to the API spec file. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Select the following command: ```command MuleSoft: Re-scaffold this local API ``` > [!NOTE] This command is available only for API specifications that haven’t been published to > Anypoint Exchange. If you publish the spec to Exchange, re-scaffolding is no longer available > for that asset. After you see the message that your project was rescaffolded successfully, navigate to your implementation XML file, and notice the new flow was added. ## See Also - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Iteratively Design and Implement an API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-local-api-specification) Tutorial --- product: Anypoint Code Builder version: master --- # Launch Configuration Properties Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure how Mule applications run and debug locally in Anypoint Code Builder by editing the `launch.json` file in your project’s `.vscode` folder. Use `launch.json` configurations to: - Pass runtime arguments (encryption keys, environment variables, JVM properties) - Change the debug port to avoid conflicts when running multiple applications - Create multiple run profiles for different environments (Development, QA, Production) - Run multiple Mule applications concurrently in the same workspace - Test the same application with different property values without editing code ## Configuration Properties Reference This table lists some common properties for launch configurations.
PropertyRequiredDescription

type

Yes

Specifies the debugger type. Must be "mule-xml-debugger" for Mule applications or "munit-xml-debugger" for MUnit tests.

request

Yes

Specifies the launch type. Must be "launch" to start a new debug session.

name

Yes

Display name for this configuration. Appears in the Run and Debug view dropdown menu. Use descriptive names like "Debug - Development" or "Run QA Environment".

mule.project

No

Path to a single Mule project. Use "${workspaceFolder}" for the current project. For multiple projects, use mule.projects instead.
Either mule.project or mule.projects must be specified, but not both.

mule.projects

No

Array of project paths for running multiple Mule applications concurrently. Example: ["${workspaceFolder:project1}", "${workspaceFolder:project2}"]. See Running Multiple Mule Applications Concurrently.
Either mule.project or mule.projects must be specified, but not both.

mule.home

No

Path to the Mule runtime home directory. Use "${config:mule.homeDirectory}" to reference the configured Mule installation. Typically not needed as it defaults to the configured runtime.

mule.runtime.args

No

Command-line arguments passed to the Mule runtime JVM. Use the -M-D prefix for system properties and the -M-X prefix for JVM tuning flags.

Examples:
-M-Dencryption.key=myKey (encryption key)
-M-Denv=dev (environment selector)
-M-Dhttp.port=8082 (HTTP listener port)
-M-Xmx2g (maximum JVM heap size)
-M-Xms512m -M-Xmx2g (initial and maximum JVM heap size)

For more information, see Pass Runtime Properties and Arguments to Mule Applications and Defining and Securing Properties for a Mule Application.

mule.debug.port

No

Port number for the Mule debugger. Default: 6666. Change this value when running multiple applications concurrently to avoid port conflicts. Example: 6667, 6668.

noDebug

No

Set to true to run the application without attaching the debugger. Useful for performance testing or when you don’t need breakpoint debugging. Default: false.

Either `mule.project` or `mule.projects` must be specified, but not both. ## Creating Multiple Configuration Profiles Create multiple launch configurations to test different environments without modifying your application code. Each configuration can have different runtime arguments, debug ports, and environment settings. This example shows three configurations for Local Development, QA, and a Mocked environment: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug - Local Dev", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=dev -M-Dencryption.key=devKey123", "mule.debug.port": 6666 }, { "type": "mule-xml-debugger", "request": "launch", "name": "Debug - QA Environment", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=qa -M-Dencryption.key=qaKey456", "mule.debug.port": 6667 }, { "type": "mule-xml-debugger", "request": "launch", "name": "Run - Mocked Services", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=mock -M-Dmock.services=true", "mule.debug.port": 6666, "noDebug": true } ] } ``` ### Switch Between Configurations To switch between run configurations: 1. Open the **Run and Debug** view from the activity bar (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png)). 2. Click the configuration dropdown in the debug panel. 3. Select the configuration to use. (for example, **Debug - QA Environment**). 4. Click **Start** (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png)) or press **F5** to launch. The selected configuration remains active until you select a different one. ## Configuring the Debug Port The default debug port for Anypoint Code Builder is `6666`. Change this port when: - Running multiple Mule applications concurrently in the same workspace - The default port conflicts with another service on your system - Testing port-specific debugging scenarios ### Change the Debug Port Add or modify the `mule.debug.port` property in your launch configuration: ```json { "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug on Port 6667", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments}", "mule.debug.port": 6667 } ] } ``` Each concurrent application must use a unique debug port. For example, if running three applications simultaneously, configure them with ports `6666`, `6667`, and `6668`. ## Common Configuration Examples These are some configuration examples for common scenarios. ### Pass Encryption Keys for Secure Properties ```json { "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Encryption Key", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=mySecretKey" } ] } ``` For more information, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ### Switch Between Environment Property Files ```json { "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Development Environment", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=dev" }, { "type": "mule-xml-debugger", "request": "launch", "name": "Production Environment", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=prod" } ] } ``` This configuration works with property files named `dev.secure.yaml` and `prod.secure.yaml` that use the `$site` variable in your Mule configuration XML. ### Run Multiple Applications Concurrently ```json { "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Run Multiple Apps", "noDebug": true, "mule.projects": [ "${workspaceFolder:salesforce-integration}", "${workspaceFolder:database-service}", "${workspaceFolder:api-gateway}" ], "mule.runtime.args": "${config:mule.runtime.defaultArguments}" } ] } ``` For more information, see [Running Multiple Mule Applications Concurrently](https://docs.mulesoft.com/anypoint-code-builder/int-run-multiple-mule-apps). ### Use Environment Variables Reference OS environment variables using the `${env:VARIABLE_NAME}` syntax: ```json { "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Env Variables", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=${env:MULE_ENCRYPTION_KEY} -M-Denv=${env:MULE_ENV}" } ] } ``` ## Create or Open launch.json To create or open the `launch.json` file: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Enter and select `Open 'launch.json'`. If the file doesn’t exist, Anypoint Code Builder creates it in the `.vscode` folder of your project. 3. Edit the configuration properties as needed. 4. Save the file. The new or updated configuration appears in the **Run and Debug** view dropdown. ## See Also - [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties) - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Running Multiple Mule Applications Concurrently](https://docs.mulesoft.com/anypoint-code-builder/int-run-multiple-mule-apps) - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) - [Testing Projects with MUnit](https://docs.mulesoft.com/anypoint-code-builder/int-test-munit) - [Migrating Mule Projects from Anypoint Studio to Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-migrate-studio-to-acb) - [MuleSoft Settings](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings) --- product: Anypoint Code Builder version: master --- # Logger Component () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure messages for logs anywhere in a Mule flow. Mule applications print the messages when the Logger executes. ## Component XML This component supports the following XML structure: ```xml ``` Logger (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Logger (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Message

message

A string in double or single quotation marks, a DataWeave expression, a Mule variable, or a concatenated combination of supported values that serve as the message. When this field is empty, the Logger produces the following message:

{
  payload=<not set>
  mediaType=*/*
  attributes=<not set>
  attributesMediaType=*/*
}

Level

level

Options are DEBUG, ERROR, INFO (default), TRACE, WARN. In the console, the logger message begins with the level.

Category

category

Optional string that describes the logger in a way that helps you distinguish it from other loggers in your flow. In the console, the logger replaces the generic processor name with your category.

## Examples The following example sets a string as the message: ```xml ``` When the application with this configuration runs, an entry like this one prints to the console: INFO 2023-06-09 23:18:03,390 \[\[MuleRuntime\].uber.24: \[my-app-1.0.0-SNAPSHOT-mule-application\].my-appFlow.BLOCKING @55f71e0b\] \[processor: my-appFlow/processors/3; event: 8e0db930-0756-11ee-8aae-147ddaaf4f97\] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: hello world The following example sets a category and uses DataWeave to concatenate a field in the message payload to the a string. Notice the `#[]` indicates that the message contains an expression or variable. ```xml ``` If you assume that the payload is `{"id" : 12345, "message" : "hello!"}`, an entry like this one prints to the console: INFO 2023-06-09 23:18:03,390 \[\[MuleRuntime\].uber.24: \[my-app-1.0.0-SNAPSHOT-mule-application\].my-appFlow.BLOCKING @55f71e0b\] \[processor: my-appFlow/processors/3; event: 8e0db930-0756-11ee-8aae-147ddaaf4f97\] MY PAYLOAD: 12345 is the ID of this payload. ## See Also - [Predefined Mule Variables](https://docs.mulesoft.com/dataweave/2.4/dataweave-variables-context) - [DataWeave Reference](https://docs.mulesoft.com/dataweave/2.4/dw-functions) - [DataWeave Tutorial and Playground](https://dataweave.mulesoft.com) --- product: Anypoint Code Builder version: master --- # Manage, Secure, and Monitor the American Flights API > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After deploying your American Flights API to CloudHub 2.0, register it with API Manager to apply governance policies, secure it with a policy, and monitor its performance and health with Runtime Manager. ## Create an API Instance and Link it with Your Application Use [API Manager](https://docs.mulesoft.com/api-manager/latest/api-instance-landing-page) to manage, monitor, and secure your APIs. After deploying your application to CloudHub 2.0, configure autodiscover to register it with API Manager to apply governance policies, track usage, and control access. ### Step 1: Navigate to API Manager 1. Sign in to Anypoint Platform. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) 2. From the Anypoint Platform home page, click **Agents & Tools** > **API Manager** in the navigation menu. 3. Ensure you are working on the same environment where you deployed your application (for example, Sandbox). ### Step 2: Create an API Instance Create an API instance that links your deployed application to the API specification you published earlier. 1. In API Manager, click **Add** and select **Add new API**. 2. In the runtime section, select **Mule Gateway** and click **Next**. 3. In the **API** section: 1. Click **Select API from Exchange**. 2. Search for "American Flights API" (the API specification you published earlier). 3. Select your API and click **Next**. 4. In the **Downstream** section, click **Next**. 5. In the **Upstream** section, set the Upstream URL to your application’s public endpoint (the one you see in **Runtime Manager**). For example: `[https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/](https://american-flights-api-implementation-ij0c18.5sc6y6-3.usa-e2.cloudhub.io/)`. Click **Next**. 6. In the **Review** section, click **Save** to create the API instance. Verify that your API status now shows **Active**. 7. Copy your API Instance ID for use in the next step while configuring API Autodiscovery. ### Step 3: Configure API Autodiscovery API Autodiscovery links your running application to the API instance you created in the previous step, so API Manager and Runtime Manager can report accurate status and enforce policies against the correct application. 1. Open your project in Anypoint Code Builder. 2. Open MuleSoft Vibes. 3. Send this message: ```command Enable API autodiscovery for my current project with this info: - API Instance ID: {your_api_instance_id} - Environment: {environment} ``` > [!NOTE] Replace `{your_api_instance_id}` with the ID you copied in the previous step, and > `{environment}` with the environment you used to deploy your application (for example, > Sandbox). 4. Save your project and deploy a new version from Anypoint Code Builder. You need to deploy a new version because you updated the project’s code. When prompted for the asset version, specify `1.0.1` so you can identify the updated deployment when monitoring it in Runtime Manager. ### Step 4: Configure Business Group Credentials Your application needs valid Business Group credentials to connect to the API instance for autodiscovery and policy enforcement. Configure these credentials as properties in Runtime Manager. 1. Sign in to Anypoint Platform. 2. Click **Access Management** in the navigation menu. 3. Click **Business Groups** in the sidebar. 4. Click your business group (the same one you used throughout this tutorial). 5. Copy the **Client ID** and **Client Secret**. 6. Open **Runtime Manager** and select your deployed application. 7. On the side panel, click **Settings**. 8. Ensure your application is **Stopped**. 9. Add these properties:
Property KeyProperty Value

anypoint.platform.client_id

{your_client_id}

anypoint.platform.client_secret

{your_client_secret}

Replace `{your_client_id}` and `{your_client_secret}` with the values you copied. 10. Click **Apply Changes**. After setting the properties and restarting your application with API Autodiscovery configured, confirm that the API status shows **Active** in API Manager. > [!TIP] If the status doesn’t show **Active** right away, wait a few minutes, verify the properties > are configured correctly in Runtime Manager, and check the status again. Your API is now registered with API Manager and ready for policy configuration. ## Secure the API with a Policy Policies in API Manager let you enforce security, compliance, and governance rules on your API without modifying application code. In this section, you apply a Client ID Enforcement policy to secure your API. Common policies include: - **Client ID Enforcement**: Requires client applications to authenticate using a client ID and secret. - **Rate Limiting**: Controls the number of requests allowed per time period. - **IP Whitelist/Blacklist**: Restricts access based on IP addresses. - **CORS**: Configures Cross-Origin Resource Sharing headers. - **OAuth 2.0**: Implements OAuth 2.0 authentication and authorization. For this tutorial, you apply the Client ID Enforcement policy to require API consumers to register their applications. ### Step 1: Apply the Client ID Enforcement Policy 1. In API Manager, navigate to your American Flights API instance. 2. Click the **Policies** tab. 3. Click **Add Policy**. 4. Search for **Client ID Enforcement**, select it, and click **Next**. 5. Set the following values:
Field NameField Value

Credentials origin

Select customExpression.

Client ID Expression

#[attributes.headers['client_id']]

Client Secret Expression

#[attributes.headers['client_secret']]

> [!NOTE] This configuration requires clients to pass their credentials in HTTP headers. > Alternative configurations can extract credentials from query parameters or custom locations. 6. Click **Apply** to activate the policy. ### Step 2: Test the Policy After applying the policy, verify that unauthenticated requests are rejected. 1. In your REST client, send a request **without** client credentials: ```command GET http://american-flights-api-implementation{your_app_id}{region}.cloudhub.io/api/flights ``` Replace this URL with your application’s actual endpoint URL. 2. Verify that you receive a `401 Unauthorized` response. Then, create a test client application to obtain credentials: 1. In Anypoint Platform, navigate to Exchange. 2. Search for your "American Flights API". 3. Click **Request Access**. 4. In **API Instance**, select your instance. 5. In **Application**, select **Create a new application**. 6. Provide an application name and click **Create**. 7. Click **Request Access**. 8. Copy the **Client ID** and **Client Secret** provided. 9. Test with credentials. In your REST client, add headers and resend the request: ```command GET http://american-flights-api-implementation{your_app_id}us-e2.cloudhub.io/api/flights Headers: client_id: client_secret: ``` Replace this URL with your application’s actual endpoint URL. 10. Verify that you receive a `200 OK` response with flight data. Your API is now secured and requires authenticated clients to access it. ### Policy Best Practices When applying policies: - **Start with client authentication**: Always require client identification before exposing APIs externally. - **Apply rate limiting**: Protect your API from abuse by limiting request rates. - **Use layered security**: Combine multiple policies (authentication + rate limiting + IP filtering). - **Test thoroughly**: Verify both authorized and unauthorized access scenarios. - **Document requirements**: Inform API consumers about authentication requirements and rate limits. ## Monitor and Manage Your Application with Runtime Manager [Runtime Manager](https://docs.mulesoft.com/runtime-manager/) is Anypoint Platform’s operational dashboard for deployed applications. It provides real-time monitoring, log access, and management capabilities for applications running on CloudHub 2.0. Runtime Manager provides: - **Application Status**: Real-time status of deployed applications. - **Performance Metrics**: CPU, memory, and network usage. - **Logs**: Application logs and system logs. - **Alerts**: Configurable notifications for application issues. - **Application Management**: Start, stop, restart, and redeploy applications. - **Scaling**: Adjust worker size and count. ### Step 1: Review Application Status 1. From Anypoint Platform, click **Agents & Tools > Runtime Manager** in the navigation menu. 2. In the **Applications** list, locate your application (for example, `american-flights-api-yourname`). 3. Click the application name. 4. On the side panel, click **Dashboard** to review key information: - **Status**: Shows whether the application is running, starting, or stopped. A green indicator with "Running" confirms your application is healthy. - **Replicas**: Number of replicas and vCores assigned. - **Last Updated**: When the application was last deployed or updated. - **URL**: The application’s public URL. ### Step 2: View Application Logs Logs help you troubleshoot issues and monitor application behavior. 1. In the side panel, click **Logs**. 2. View recent log entries: - **Log Level**: Filter by INFO, WARN, ERROR, or DEBUG. - **Search**: Search for specific log messages or error codes. - **Time Range**: Adjust the time range to view historical logs. > [!TIP] If you don’t see any entries, select a previously used Config from the dropdown menu. 3. Example log entries: ```command [INFO] Application started successfully [INFO] HTTP Listener on 0.0.0.0:8081 [INFO] Deployed application: american-flights-api ``` 4. Search for specific events: - Search for "ERROR" to find errors. - Search for "flights" to see API-related logs. - Search for "Database" to see database operations. ### Step 3: Monitor Performance Metrics Monitor your application’s resource usage to ensure it runs efficiently. 1. In the side panel, select **Dashboard**. 2. Select the **Performance** tab. 3. Review performance metrics such as average inbound and outbound response times. 4. Select the **Infrastructure** tab. 5. Review metrics such as CPU % and memory usage. ### Step 4: Manage Your Application Use Runtime Manager to control your application’s lifecycle. From the application dashboard, you can: - **Stop**: Click **Stop** to stop the application. The application remains deployed but stops serving requests. - **Start**: Click **Start** to start a stopped application. - **Delete**: Click **Delete** to remove the application from CloudHub. This action is permanent and cannot be undone. - **Update Configurations**: Click **Apply Changes** after changing configurations such as properties, to restart the application without redeploying. ### Step 5: Scale Your Application As your API usage grows, scale your application by adjusting worker size or count. 1. From the application dashboard, click **Settings**. 2. In the **Deployment Target** section: - **Replica Count**: Increase the number of workers for horizontal scaling. - **Replica Size**: Change the worker size (for example, from 0.1 to 0.2 vCores). 3. Click **Apply Changes**. 4. CloudHub redeploys your application with the new configuration. > [!NOTE] Scaling changes the resources allocated to your application and may affect your CloudHub > costs. Monitor performance metrics before scaling to ensure it’s necessary. ## Stop Your Application When you finish the tutorial, stop the application so it doesn’t keep consuming resources. 1. In Runtime Manager, open your application settings. 2. Click **Stop**. ![The Runtime Manager UI showing the Stop button in the settings page of a deployed application.](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-stop-application.png) This concludes the American Flights API tutorial series. You designed an API specification, implemented it as an integration, validated and transformed data, debugged and tested your application, deployed it to CloudHub 2.0, and secured and monitored it in production. [Deploy the American Flights API to CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-deploy-api) --- product: Anypoint Code Builder version: master --- # Managing API Spec Versions > For the full documentation index, see: https://docs.mulesoft.com/llms.txt View and change the version of an API specification linked to your Mule project from the **API Specs** tab in **Project Properties**. When you apply a version change, Anypoint Code Builder fetches the selected spec version from Anypoint Exchange, updates the `pom.xml` file, and re-scaffolds the project. New endpoints from the updated spec are added as flows. Existing flows are not modified. You can also manage API spec versions using MuleSoft Vibes. See [Managing API Spec Versions with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-manage-api-spec-versions). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Make sure you have the [required Anypoint Code Builder permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). - Have an implementation or integration project that includes an API spec dependency published to Anypoint Exchange. ## View Your API Spec Details Access **Project Properties** to see the API specs linked to your project and their current versions: 1. In the **Explorer**, right-click the Mule configuration XML file for your project. 2. Select **Mule** > **Manage API Specs**. Alternatively, select **Mule** > **Open Mule Project Properties** and then click **API Specs** in the left menu. The **API Specs** tab opens and lists each API spec linked to the project. For each spec, the tab shows: - **Asset Version**: The version currently set in the project’s `pom.xml` file. - **API Type**: The API format, such as REST. - **Asset ID**: The identifier for the API spec asset in Anypoint Exchange. - **Business Group**: The business group that owns the asset in Anypoint Exchange. ## Change the API Spec Version Change the version of an API spec to update your project with a different published version from Anypoint Exchange: 1. Open **Project Properties** > **API Specs**. See [View Your API Spec Details](#view-api-spec). 2. Expand the API spec you want to update. 3. Click the **Asset Version** dropdown and select a version. The dropdown lists all published versions available for that asset in Anypoint Exchange. > [!NOTE] A message below the dropdown indicates that applying changes triggers a re-scaffold of > the project. New endpoints are added as flows. No changes are applied to existing flows. 4. Click **Apply**. When you apply the version change, Anypoint Code Builder: - Updates the version property for the API spec in the `pom.xml` file. For example, changing from version 1.0.0 to 3.0.0 updates: ```XML 3.0.0 ``` - Re-scaffolds the project using the selected version of the spec fetched from Anypoint Exchange. - Adds flows for any new endpoints introduced in the selected version. > [!NOTE] If you manually edit the version in `pom.xml` to a value that does not correspond to a > published Exchange asset, re-scaffolding fails. Use the **Asset Version** dropdown to select only > valid published versions. --- product: Anypoint Code Builder version: master --- # Managing API Spec Versions with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use MuleSoft Vibes to view and change the version of an API specification in your Mule project using natural language. MuleSoft Vibes reads your project’s `pom.xml` file to identify API spec dependencies, retrieves available versions from Anypoint Exchange, and applies the version change by updating `pom.xml` and re-scaffolding the project. To manage API spec versions using the **Project Properties** UI instead, see [Managing API Spec Versions](https://docs.mulesoft.com/anypoint-code-builder/imp-manage-api-spec-versions). ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Set up MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) and confirm you have the required permissions. - Have an implementation or integration project that includes an API spec dependency published to Anypoint Exchange. - Open the project folder so that the `pom.xml` file is accessible. ## Change an API Spec Version To change the version of an API spec using MuleSoft Vibes: 1. Open MuleSoft Vibes. 2. Enter a prompt that describes the version change you want to make. Example prompts: - `I want to change the API version in my project.` - `Update the API spec to the latest version.` - `Check if there are newer API spec versions available.` MuleSoft Vibes loads the `manage-api-version` skill and reads the `pom.xml` file to identify API spec dependencies. 3. Review the dependency information that MuleSoft Vibes returns, including the asset ID and current version. 4. Wait while MuleSoft Vibes fetches the available versions for the spec from Anypoint Exchange. 5. Select a version from the options MuleSoft Vibes presents. If your project has multiple API spec dependencies, MuleSoft Vibes handles each one separately and prompts you for each version. 6. Confirm the change when prompted. MuleSoft Vibes updates the version property in the `pom.xml` file and re-scaffolds the project by running a build. When the process completes, MuleSoft Vibes returns a summary, for example: API version updated and project rescaffolded successfully. Updated in pom.xml: covid19-data-tracking-api.version: 1.0.0 → 3.0.0 Build result: BUILD SUCCESS — APIkit pulled in the updated spec version 3.0.0 and the project packaged cleanly. New endpoints introduced in the selected version are added as flows. Existing flows are not modified. 7. Optionally, click **View Changes** to review the updated `pom.xml` in the editor. --- product: Anypoint Code Builder version: master --- # Managing Custom Metadata > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Define and assign custom metadata to accurately represent your organization’s unique data structures within your integration projects. Create metadata for inputs and outputs using common formats so your data transformations stay accurate. Custom metadata connects your visual development tools to your data requirements, facilitating easier testing and workflow creation. ![Custom Metadata tab on the Project Properties page](/mulesoft/current/en-us/anypoint-code-builder/_images/int-custom-metadata-project-prop.png) ## Supported Metadata Types Anypoint Code Builder supports these metadata types: - CSV - Copybook - Excel - Fixed Width - Flat File - JSON - Object - Simple type - XML ## Create Custom Metadata To create custom metadata: 1. Click **Create New**. 2. Enter a unique name for the metadata. 3. Select the metadata type, such as CSV, JSON, or XML. 4. Add additional required details for the metadata, depending on the type selected, such as the definition or source type, schema, and class. You must also upload a sample file for some metadata types. 5. Select to wrap the element in a collection, which converts the custom metadata into an array. The enrichment element in the `application-types.xml` file is updated automatically with the conversion. 6. Click **Save and Close**. The custom metadata is stored in the `application-types.xml` file in your project’s resources folder. Sample files and custom metadata created in Anypoint Code Builder are compatible with Anypoint Studio and vice versa. ![int application types file](/mulesoft/current/en-us/anypoint-code-builder/_images/int-application-types-file.png) > [!NOTE] To apply custom metadata to a component, add or open the component in the canvas and then > apply the metadata using the custom metadata options from the Metadata tab, **Expression > Builder**, or **Transformation Builder**. For more information, see > [Set Custom Metadata on the Metadata or Data Tab](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-component-custom-metadata-on-metadata-or-data-tab) > and see > [Set Custom Metadata in Transformation Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-custom-metadata-in-transformation-builder). ## Edit Custom Metadata To edit custom metadata, click the three dots next to the source file and then click **Edit**. Make your changes and then click **Save and Close**. The changes are applied to all components that use the custom metadata. ## Preview Custom Metadata To preview custom metadata, click the name of the metadata. The preview shows the metadata in the selected format. ## Delete Custom Metadata To delete custom metadata from the **Custom Metadata** tab, click the three dots next to the source file and then click **Delete**. The metadata is deleted from all components that use it. You can also delete custom metadata when editing by clicking **Delete Custom Metadata** from the three dots menu. ## Custom Metadata in MuleSoft Vibes MuleSoft Vibes provides full support to create, delete, fetch, or edit custom metadata for CSV, Copybook, Excel, fixed width, flat file, JSON, Java, simple type, and XML metadata types. ## See Also - [Set Component Custom Metadata on the Metadata or Data Tab](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-component-custom-metadata-on-metadata-or-data-tab) - [Set Custom Metadata in Transformation Builder](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions#set-custom-metadata-in-transformation-builder) --- product: Anypoint Code Builder version: master --- # Managing Global Configuration Elements > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Add, edit, and delete global configurations in Anypoint Code Builder from **Global Elements**. Create connector configurations, TLS contexts, object stores, caching strategies, API Autodiscovery, global error handlers, import project references, and properties files. Manage the same configurations in **Global Elements**, through MuleSoft Vibes, or in the source editor. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create an integration project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations). ## Open Global Elements Open **Global Elements** from **Project Properties** to view and manage the global configurations defined in your project. 1. Use one of these options: - In the canvas toolbar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-manage-global-elements.png) (**Manage Global Elements**) icon to open **Project Properties** with the **Global Elements** tab selected. - In the Explorer, right-click your project and select **Mule** > **Manage Global Elements**. Alternatively, select **Mule** > **Open Mule Project Properties** and then click **Global Elements** from the menu. **Global Elements** shows a searchable table with the **Type**, **Name**, and **Notes** for each element. 2. In **Selected File**, select a configuration file and view its elements. 3. After you select a file, select **New Configuration** to create a configuration, or use MuleSoft Vibes. The table updates in real-time as you make changes. ## Add a Global Configuration Add connector configurations and other global configuration types from **Global Elements**. To add a global configuration: 1. Open [**Global Elements**](#open-global-elements-panel). 2. Select a configuration file from **Selected File**. 3. Click **New Configuration**. 4. In **Select configuration type**, search for or browse to the type you want. Types are grouped by category: - **Component Configurations** - **Global Configurations** - **Connector Configurations** - **Caching Strategies** 5. Select a type. A form opens, scoped to the file you selected. 6. Complete the required fields and save. The new element appears in the **Configured Elements** table and is written to the selected configuration file. You can also add global configurations through MuleSoft Vibes using natural language. The element is created with the correct structure and placed in the right file automatically. For example: - _"Add a Salesforce connector config"_ - _"Register a new properties file"_ - _"Create an HTTP Listener global config on port 8081"_ For more details on using Vibes to manage global elements, see [Use MuleSoft Vibes to Manage Global Configurations](#vibes-manage-global-configs). ## Edit a Global Configuration To edit an existing element, use one of these methods: - **Form editor** — Click the **More actions** (**…​**) menu next to the element and select **Edit**. A form-driven editor opens with field validation so you can update the configuration. Form editing is available for connector configurations and for these global configuration types: - TLS Context - Object Store - Caching Strategy - API Autodiscovery - Global Error Handler - Import Project Reference - Properties - **Source editor** — Click **More actions** (**…​**) > **Go to Source** to jump directly to the element’s location in the XML file and edit it in context. Use this option for elements that don’t open in the form editor. - **MuleSoft Vibes** — Describe your change conversationally and Vibes applies it for you. ## Remove a Global Configuration Delete connector configurations and other global configuration elements from **Global Elements**. To delete a global configuration: 1. Open [**Global Elements**](#open-global-elements-panel). 2. In the **Configured Elements** table, click the **More actions** (**…​**) menu next to the element. 3. Select **Delete**. 4. Confirm the deletion when the dialog names the element. The element is removed from the configuration file, and the list refreshes. You can also remove a global configuration through MuleSoft Vibes. For example: - _"Remove the Salesforce connector config"_ - _"Delete the HTTP Listener global config"_ Before removing an element, Vibes identifies any flows that reference it and warns you of the impact before making any changes. ## Consolidate Global Configurations If global elements are scattered across multiple configuration files, consolidate them into a single `global-configs.xml` file. To consolidate from **Global Elements**: 1. Open [**Global Elements**](#open-global-elements-panel). 2. Click **Consolidate**. Anypoint Code Builder combines global configurations from all project files into `global-configs.xml` and updates flow file references. To consolidate through MuleSoft Vibes, see [Centralize Configurations from Studio Projects](#centralize-studio-projects). ## Manage Configuration Properties Files When you create a new project, Anypoint Code Builder automatically generates a `global-configs.xml` file for storing configuration properties separately from flow definitions. If you open a project migrated from Studio, Anypoint Code Builder preserves the existing project structure. ### Register a Properties File To register a `.yaml` or `.properties` file as a configuration source, click **New Configuration** in **Global Elements** and select the configuration properties type. You can also use MuleSoft Vibes. For example: - _"Register a new properties file"_ - _"Add config.yaml as a configuration properties file"_ Anypoint Code Builder adds a `` element to your global config XML and the file appears in **Global Elements**, under **Configuration Properties**. ### Add Inline Global Properties To add `` key-value pairs, click **New Configuration** in **Global Elements** and select the global property type. You can also use MuleSoft Vibes. For example: - _"Add a global property named env with value dev"_ All inline properties are stored in `global-configs.xml` instead of individual application XML files. ## Set Up Multi-Environment Configuration Anypoint Code Builder supports the `$site.yaml` file pattern for environment-specific property files. If your project contains files such as `dev.yaml`, `qa.yaml`, and `prod.yaml`, they appear in the **Environments** section of **Global Elements**. To set the default environment, use MuleSoft Vibes. For example: - _"Set the default environment to dev"_ - _"Set up multi-environment configuration for dev, QA, and prod"_ Vibes adds a corresponding `` element to your global configuration file, for example: ``. Use **Preview Mode** to switch the active environment and verify that property placeholders resolve correctly before you deploy. ## Work with Secure Properties Anypoint Code Builder supports the Mule Secure Properties module: - Generate encrypted property values from Anypoint Code Builder. - Anypoint Code Builder warns you when a properties file contains unencrypted credentials. For information about encrypting values and referencing them in your Mule application, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). To edit a secure properties configuration from **Global Elements**, see [int-create-secure-configs.adoc#edit-via-ui](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs#edit-via-ui). ## Global Element Types In addition to connector configurations, you can add, edit, and delete these global configuration types from **Global Elements**:
ComponentWhat It Does

Global Error Handler

Set any error handler as the application-wide default. You can also reference handlers from imported projects for consistent exception management across teams.

API Autodiscovery

Configure your Mule application for API Manager auto-discovery at deployment time. Select from the flows defined in your application when configuring the auto-discovery settings.

TLS Context

Set up Trust Store and Key Store configurations once, then reference them from any connector that supports TLS.

Import Project Reference

Import a JAR containing a shared Mule project. Use its flows, error handlers, and connection configurations. Anypoint Code Builder handles POM dependency management. When you import from a project dependency, specify the Mule configuration file to import.

Caching Strategy

Define a centralized caching strategy that you can reference from Cache scopes across the project.

Object Store

Create an object store to use with a caching strategy or other components that persist data.

Configuration Properties

Register a .yaml or .properties file, or add inline global properties, so your application can resolve placeholders consistently.

For API Autodiscovery configuration details, see [Configure API Autodiscovery for Local Testing](https://docs.mulesoft.com/anypoint-code-builder/int-configure-api-autodiscovery-local) and [Tracking Requests with Autodiscovery](https://docs.mulesoft.com/anypoint-code-builder/int-autodiscovery-config). ## Use MuleSoft Vibes to Manage Global Configurations You can use MuleSoft Vibes to create and update global elements by using natural language prompts. ### Automatic Generation When Vibes generates a flow that uses a connector, it also generates the corresponding global configuration element. Credentials are stored as property placeholders, and a sample properties file is created for the generated configuration. ### Natural Language Examples You can ask Vibes things like: - _"Create an HTTP Listener global config on port 8081"_ - _"Set up multi-environment configuration for dev, QA, and prod"_ - _"Centralize all global configs into the global-configs.xml file"_ - _"What global elements are defined in this project?"_ - _"Validate my property placeholders"_ ### Centralize Configurations from Studio Projects If your project has global elements scattered across multiple config files (common in projects migrated from Studio), ask Vibes to consolidate them: _"Move all global configs into global-configs.xml"_ Vibes identifies every global element across your config files, moves them to `global-configs.xml`, and updates all flow file references automatically. You can also click **Consolidate** in **Global Elements**. See [Consolidate Global Configurations](#consolidate-global-configs). The `manage-global-configurations` skill powers these operations. For more on skills in MuleSoft Vibes, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). ## See Also - [Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components) - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Configure API Autodiscovery for Local Testing](https://docs.mulesoft.com/anypoint-code-builder/int-configure-api-autodiscovery-local) - [Tracking Requests with Autodiscovery](https://docs.mulesoft.com/anypoint-code-builder/int-autodiscovery-config) - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) --- product: Anypoint Code Builder version: master --- # Maven Settings in Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder uses Apache Maven to build and manage your Mule projects (implementation and integration projects) and API specifications in design projects. All Maven configurations, such as custom repositories, proxies, and server credentials, are managed through a central `settings.xml` file. For information about the Maven file `settings.xml`, see the [Maven documentation](https://maven.apache.org/settings.html). Maintain the `pom.xml` file to ensure build reproducibility and pipeline stability: pin fixed dependency versions instead of using dynamic ranges, avoid `SNAPSHOT` dependencies within release branches, and execute `mvn clean package` to validate the build locally before pushing changes. ## Maven Settings File in Anypoint Code Builder Use the Apache Maven file `settings.xml` to configure the Maven settings, such as repositories, proxy settings, and credentials. For detailed information, see [Settings Reference](https://maven.apache.org/settings.html) in the Apache Maven documentation. If `settings.xml` isn’t found in that path, Anypoint Code Builder creates an empty `settings.xml` file in the default location, `${user.home}/.m2/repository`. ## User and Internal Maven Settings in Anypoint Code Builder Anypoint Code Builder reads its configuration from your Maven `settings.xml` file. To configure Maven, for example, to add repositories, proxies, or credentials, edit your `settings.xml` file, usually located in your `~/.m2/` directory. If you troubleshoot a project in Anypoint Code Builder, export the file with any sensitive information, such as passwords, obfuscated. See [Export Troubleshooting Information](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#export-troubleshooting-info) for instructions. ## Authenticating to MuleSoft Repositories When you open a MuleSoft project that uses dependencies from the MuleSoft Enterprise Repository, Maven requires authentication to download the artifacts. If authentication is not configured, you receive a 401 Unauthorized error. To configure authentication: 1. If you don’t already have Nexus enterprise credentials, contact [MuleSoft Support](https://help.mulesoft.com) to request them. 2. Optionally, encrypt your credentials. For instructions on encrypting your credentials to avoid storing passwords in plain text, see [Password Encryption](https://maven.apache.org/guides/mini/guide-encryption.html) in the Apache Maven documentation. 3. Add your credentials in the `` section of your Maven `settings.xml` file. For detailed instructions on configuring the `settings.xml` file, see [Configure Maven to Access MuleSoft Enterprise Repository](https://docs.mulesoft.com/mule-runtime/latest/maven-reference#configure-maven-to-access-mulesoft-enterprise-repository). ## See Also - [Export Troubleshooting Information](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#export-troubleshooting-info) --- product: Anypoint Code Builder version: master --- # MCP Server Issues > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When using the MuleSoft MCP Server in Anypoint Code Builder, you might encounter issues that prevent the server from functioning correctly. Follow these troubleshooting steps to diagnose and resolve common MCP server problems. ## Verify the MCP Server Is Running If MuleSoft Vibes isn’t responding to commands or tools aren’t available, verify that the MuleSoft MCP Server is running: 1. Open the MuleSoft Vibes panel in Anypoint Code Builder. 2. Click **Manage MCP Servers**. 3. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gear.png) (Settings) to open the MCP Server settings. 4. In the **Installed** tab, verify that the MuleSoft MCP Server is enabled (toggled on and marked in green). If the server is disabled, toggle it on to enable it. ![The MCP server panel showing the Settings icon and the Enable toggle.](/mulesoft/current/en-us/anypoint-code-builder/_images/mcp-server-settings.png) ## Verify MuleSoft MCP Server Tools in GitHub Copilot When you install Anypoint Code Builder, the MuleSoft MCP Server tools are automatically registered in VS Code. To confirm the tools are available in GitHub Copilot: 1. Make sure GitHub Copilot is set up and you are logged in. For setup instructions, see [Use MuleSoft MCP Server Tools with GitHub Copilot](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server#use-mcp-tools-copilot). 2. Follow the VS Code instructions to [use MCP tools in agent mode](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_use-mcp-tools-in-agent-mode) and confirm that the MuleSoft tools appear in the tools list. > [!NOTE] The tools are registered directly in VS Code using the Language Model API. No manual > configuration is required. ## Check MCP Server Logs When the MCP server isn’t working as expected, check the logs to identify the cause: 1. Open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 2. From the dropdown list in the Output panel, select **Anypoint Code Builder - MCP Server**. ![The outputs panel showing the MCP Server selected in the dropdown menu.](/mulesoft/current/en-us/anypoint-code-builder/_images/mcp-server-output-dropdown.png) 3. Review the logged information for errors or warnings. The logs provide details about server operations, tool executions, and any errors that occur. You can also check the **Tasks** section in the Output panel for additional errors or warnings related to MCP server operations. ## Restart the MCP Server If the MCP server stops responding or behaves unexpectedly, restart it: 1. Open the MuleSoft Vibes panel in Anypoint Code Builder. 2. Click **Manage MCP Servers**. 3. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gear.png) (Settings) to open the MCP Server settings. 4. In the **Installed** tab, locate the MuleSoft MCP Server. 5. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-restart-mcp-server.png) (Restart Server). When the server restarts successfully, you see a confirmation message in the Output panel. If restarting doesn’t resolve the issue, try disabling and then re-enabling the server. ## Validate MCP Server Configuration You can validate whether the MCP server is running correctly by using third-party tools: 1. In the MCP Server settings, select **Configure MCP Servers** to view the server configuration. 2. Use an API client like Postman to send test requests to the MCP server endpoint. 3. Verify that the server responds correctly to your requests. If the server doesn’t respond, check that the configuration in the `a4d_mcp_settings.json` file is correct. ## MCP Server Tools Are Unavailable If MCP server tools aren’t appearing or aren’t responding: 1. Verify that the MuleSoft MCP Server is enabled in the **Installed** tab of the MCP Server settings. 2. Check that the tools are enabled for the server: 1. In the **Installed** tab, select the MuleSoft MCP Server to expand its details. 2. Verify that the required tools are listed and enabled. 3. Restart the MCP server. 4. If the issue persists, check the MCP server logs for errors. ## MCP Server Request Timeout If requests to the MCP server are timing out: 1. Open the MCP Server settings. 2. In the **Installed** tab, select the MuleSoft MCP Server. 3. Locate the **Request Timeout** setting. 4. Increase the timeout value to allow more time for the server to respond. For complex operations, a longer timeout might be required. ## See Also - [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server) - [Troubleshooting](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting) - [Troubleshooting AI Features in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-generative-ai) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Migrating Mule Projects from Anypoint Studio to Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Migrate your Mule projects from Anypoint Studio to Anypoint Code Builder to unlock a modern development experience with advantages like faster startup times, streamlined collaboration, and the integration of MuleSoft for Agentforce: Topic Center to enable API specifications for topics and agents. ## Choose a Migration Approach Anypoint Code Builder provides three ways to bring your Studio projects over.
ApproachWhen to Use It

Import a Studio workspace

Bring over an existing Studio workspace and keep working against the same project files. Anypoint Code Builder creates a workspace that references your Studio projects, and changes stay in sync. See Import an Anypoint Studio Workspace.

Export and import a JAR file

Package a single Mule project as a sharable JAR file in Studio and import it into Anypoint Code Builder by following the steps on this page.

Open the project folder directly

Open an existing Studio project folder in Anypoint Code Builder without packaging it, which is the fastest path when the project is already on your machine. See Importing Projects into Anypoint Code Builder.

## Set Run and Debug Configurations In Anypoint Studio, you configure run and debug settings through the UI with tabs for arguments, environment, and other settings. In Anypoint Code Builder, you manage these configurations by editing the `launch.json` file in your project’s `.vscode` folder.
Studio UIAnypoint Code Builder

Run Configurations > Arguments tab > VM arguments

mule.runtime.args property in launch.json

Run Configurations > Environment tab

Environment variables passed via mule.runtime.args (e.g., -M-Denv=dev)

Run Configurations > Port settings (if available)

mule.debug.port property in launch.json

Configuration dropdown in toolbar

Configuration dropdown in Run and Debug view

For a reference of `launch.json` properties, see [Launch Configuration Properties Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-launch-json-properties). ## Export Your Mule Project to a Sharable JAR File in Anypoint Studio 1. Open the project to export in Anypoint Studio. 2. Select **Export** from the **File** menu. 3. Click to expand the Mule folder. 4. Select **Anypoint Studio Project to Mule Deployable Archive (includes Studio metadata)** and click **Next**. 5. Select the project to export and click **Next**. 6. In the **JAR file** menu, click the ellipses (…​) button to explore your local drive, and select the folder to which you want to export your deployable JAR file. 7. Click **Finish**. ### Exporting Considerations - Select **Attach Project Sources** to include the project metadata if you plan to: - Reimport the deployable file as an open Mule project into your workspace - Import the JAR file into Anypoint Code Builder - Import the JAR file back into the same Studio workspace > [!NOTE] Selecting **Attach Project Sources** flags the `-DattachMuleSources` parameter as if you > would pack your Mule project with Mule Maven Plugin. - Select **Include project module and dependencies** if you plan to deploy your exported Mule project to CloudHub. ## Import a Mule Project from a Sharable JAR File in Anypoint Code Builder Import a shareable JAR file for a snapshot of a Mule project into Anypoint Code Builder. To create a shareable JAR, see [Export Mule Project](https://docs.mulesoft.com/anypoint-code-builder/int-export-mule-project#export-mule-project). To import a shareable JAR file into Anypoint Code Builder: 1. Make sure that no project is open. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Provide the following command: ```command MuleSoft: Import a Mule Project ``` 4. Navigate to the shareable JAR file to import, and click **Select jar file to import**. 5. Navigate to a folder to which to unpack the JAR file, such as your home directory or any folder _outside_ of a Mule project folder. 6. Click **Select project folder**. Anypoint Code Builder unpacks the shareable JAR file for your project into the selected folder. 7. If your Mule project folder is closed, [open a workspace](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#both-open-project-folder) for the project at the project’s _root_ directory. In addition to loading the graphical canvas, Anypoint Code Builder also loads dependencies defined in the `pom.xml` for the project. If a Mule runtime or Java configuration is missing, set the versions to use from the canvas. Libraries load to the `target/repositories` directory within the project folder. 8. Test your project: 1. In the open project, check for errors and make sure that the canvas and code editor load correctly, which indicates that component dependencies resolved. 2. Check for any configurations to modify, such as ports or file paths in the configuration XML. 3. Run and debug your project: For guidance, see [Run Your Application in Debug Mode](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#run-debug-mode). ## Set Up Your Development Environment After your project is in Anypoint Code Builder, set up your development environment: - Organize your projects in a workspace so that all Anypoint Code Builder features work correctly. See [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). - Manage the folders that store your projects. See [Adding Folders to Your Home Directory](https://docs.mulesoft.com/anypoint-code-builder/start-add-folders). - Connect your project to a Git repository for source control. See [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). You don’t need to restructure a migrated project all at the same time. Confirm that the project opens and runs first, then adopt Anypoint Code Builder conventions over time, for example, by centralizing global elements that are scattered across flow files into `global-config.xml`, moving from `.properties` files to environment-specific property files such as `config-dev.yaml` and `config-prod.yaml`, and introducing MuleSoft Vibes for new work while leaving existing flows as they are. If multiple developers work on the same set of projects, migrate one project at a time rather than switching everyone over at the same time. Anypoint Studio and Anypoint Code Builder both produce standard Mule artifacts, so you can run them side by side during the transition without affecting CI/CD pipelines, deployments, or runtime behavior. ## See Also - [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project) - [Launch Configuration Properties Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-launch-json-properties) --- product: Anypoint Code Builder version: master --- # Missing or Disabled Features > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Some Anypoint Code Builder features can be disabled or hidden based on your settings. For any features that aren’t working as expected, first [check for problems and issues](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#check-logs). ## MuleSoft Icon Missing from the Activity Bar If the MuleSoft icon (see [Discovering the UI](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui)) is missing from the Activity Bar, check for and address common causes. - [Enable Anypoint Code Builder in the Activity Bar](#enable-icon) - [Check for Restricted Mode](#check-trusted) - [Modify Trust Settings](#modify-trust-settings) ### Enable Anypoint Code Builder in the Activity Bar Use the Activity Bar to enable or disable icons. 1. Right-click the Activity Bar. 2. Check for **Anypoint Code Builder**: - If **Anypoint Code Builder** is disabled, click **Anypoint Code Builder** to add the icon to the Activity Bar. - If **Anypoint Code Builder** is not present, see [Check for Anypoint Extension Pack Installation](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#check-extension-pack). If the Anypoint Extension Pack is installed, [Check for Restricted Mode](#check-trusted). ### Check for Restricted Mode If your project or workspace is in restricted mode, the MuleSoft icon does not appear in the Activity Bar. To determine whether your project or workspace is trusted or in restricted mode: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide the following command to launch the **Workspace Trust** tab: ```command Workspace: Manage Workspace Trust ``` If the **Workspace Trust** tab says **You are in Restricted Mode**, you can click **Trust** or **Trust Parent**. ![VS Code indicating that a project or workspace is in restricted mode](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-restricted-mode.png) 3. After trusting, check for the MuleSoft icon in the Activity Bar. For more information about trust settings, see [Trusting a workspace](https://code.visualstudio.com/docs/editing/workspaces/workspace-trust) in the VS Code documentation. ### Modify Trust Settings To modify your trust settings: 1. Provide the following command to launch the **Workspace Trust** tab: ```command Workspace: Configure Workspace Trust Settings ``` 2. Review and adjust the workspace settings, as needed. ## Incomplete Flow or Corrupted XML If a flow lacks a component or contains only a trigger, such as an HTTP Listener operation or the Scheduler, an error similar to the following appears in the **Problems** panel and from the code editor: The content of element 'flow' is not complete. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.(cvc-complex-type.2.4.b) To address this issue, add processing components or connector operations to your flow, such as a Logger or HTTP Request operation. For reference documentation on specific connector and component configurations, see [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference). This error can also occur if XML tags in the configuration file are corrupted or not properly closed. If you’ve already added components and the error persists, check the configuration XML for unclosed tags. To prevent XML corruption, save your work frequently and use source control management (SCM) to back up your projects. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Mock Data Using a DataWeave Library > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following tutorial shows you how to develop an integration, import the [Mock Data Generators Library](https://anypoint.mulesoft.com/exchange/68ef9520-24e9-4cf2-b2f5-620025690913/data-weave-mock-data-generators-library/minor/1.0/) from Exchange, and use the custom library to return a random value from the library. ## Before You Begin Before getting started, ensure you: - Set up your MuleSoft environment. See [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb) for more information. ## Create a Mule Application 1. In Anypoint Code Builder, open the Command Palette by pressing Ctrl+shift+p (Mac) or Cmd+shift+p (Windows), and type `MuleSoft: Develop an Integration`. 2. Select the command. 3. Configure your integration using the following values: ![Develop an Integration form, with Empty Project selected](/mulesoft/current/en-us/anypoint-code-builder/_images/int-create-integration-scratch.png) 1. Under **Project Name**, provide the name \*mock-dw-library. 2. Under **Project Location**, click **Browse**, and then select your home directory. 3. Under **Create**, select **Empty Project**. 4. Select a **Mule runtime** and **Java** version. You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. For information about version support and automated Mule patch updates, see [Mule and Java version support](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#versions-mule-jdk). To set default Mule runtime and Java versions for the projects you create, see [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). 4. Click **Create Project**. ## Create a Flow Start by configuring a flow with an HTTP listener that exposes a root path (`/`): 1. Between the `` and `` elements, create an HTTP Listener global configuration: ```XML ``` 2. After the `
` element, add a flow and an HTTP Listener element: ```XML ``` ## Import the DataWeave Library 1. Open the Command Palette by pressing Ctrl+Shift+p (Windows) or Cmd+Shift+p (Mac), and provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 2. Select **DataWeave Library**. 3. Start typing _DataWeave_, and press Return to list assets that match your search. 4. Select **DataWeave Mock Data Generators Library**. 5. Select version **1.0.0**. Anypoint Code Builder displays a message indicating that the dependency was successfully added. ## Use the DataWeave Library 1. After the `` element, add a new line and create a Set Payload processor: ```XML ``` 2. Add the following DataWeave script inside the `value` element of the `set-payload` element: ```dataweave %dw 2.0 output application/json import * from mocks::DataGenerators --- mocks::DataGenerators::randomCity() ``` Review your XML code: ```XML ``` ## Import the HTTP Connector Library 1. Open the Command Palette by pressing Ctrl+Shift+p (Windows) or Cmd+Shift+p (Mac), and provide the following command: ```command MuleSoft: Import Asset from Exchange ``` 2. Select **Connector**. 3. Start typing _HTTP_, and press Return to list assets that match your search. 4. Select **HTTP Connector - Mule 4**. 5. Select the latest version. Anypoint Code Builder displays a message indicating that the dependency was successfully added. ## Deploy the Application 1. Open the Command Palette by pressing Ctrl+Shift+p (Windows) or Cmd+Shift+p (Mac), and provide the following command: ```command MuleSoft: Deploy to CloudHub ``` 2. Anypoint Code Builder prompts that a deployment configuration file has been created and opens it for you to review: ```json { "runtime": "4.4.0", (1) "workerSize": 0.1, "applicationName": "mock-dw-library", (2) "workers": 1, "autoStart": true } ```
1The runtime version is the Mule runtime version you select when creating the integration.

For information about version support and automated Mule patch updates, see Mule and Java version support.

2The applicationName property defines the part of the URL that you use to access your application on CloudHub.

The name must be unique across all applications deployed to CloudHub.

3. After reviewing the deployment configuration, select **Deploy** to deploy the application to CloudHub. 4. Select your preferred environment. Anypoint Code Builder packages the application and deploys it to CloudHub. 5. After deployment completes, select **Open in Runtime Manager**. 6. Select your application from the application list. The domain name of the application varies, but it follows a similar structure such as: `mock-dw-library.eu-s1.cloudhub.io`. 7. Open your preferred REST client and make a GET request to the domain name as displayed in **Runtime Manager**. 8. Your application now returns a random city every time you reach the endpoint. --- product: Anypoint Code Builder version: master --- # Mule Runtime Issues and Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder includes bundled Mule runtime versions that enable instant project opening and design. When you run or debug applications, Anypoint Code Builder checks for the exact runtime version specified in your project. If the exact version isn’t available locally, error dialogs appear to help you resolve the issue. Don’t change the default locations of Mule. If you receive an error that Mule isn’t found or installed, configure the Mule Home path. When you configure Mule runtime, ensure you define the `mule.homeDirectory` property. > [!NOTE] The `mule.runtime.muleRuntimesDirectory` and `mule.runtime.muleHome` properties are legacy > configurations no longer used. - **Mule runtime versions**: The Mule runtime versions are located in the `{yourACBHome}/runtimes` directory. Default value: `/Users/{user}/AnypointCodeBuilder/runtime`. - **Mule Home**: The full path that points to the root files of the Mule instance. Default value: `/Users//AnypointCodeBuilder/runtime/` ## Mule Runtime Is Not Installed The error **Mule Runtime Is Not Installed, You Must Configure a Mule Runtime to Enable This Feature** occurs if **Mule Home** is misconfigured or empty and a feature requires a running Mule instance. For example, auto completion and debugging features require Mule to run. To troubleshoot this issue, use this procedure: 1. Locate the **Mule > Runtime: Mule Home** property: ![The Settings gear icon highlighted in the Anypoint Code Builder menu panel](/mulesoft/current/en-us/anypoint-code-builder/_images/open-settings.png) 2. Provide the full path to the folder that contains Mule runtime. This field must not be empty. ![Settings dialog showing Mule Home configuration field with default path](/mulesoft/current/en-us/anypoint-code-builder/_images/mule-runtimes-settings.png) ## No Mule Runtime Found The warning **No Mule runtime found. To perform this action, you must have Mule runtime configured.** occurs if: - Mule isn’t configured properly when you open Anypoint Code Builder - The **Mule Home** field is misconfigured or empty To troubleshoot this issue, use this procedure: 1. Go to your Anypoint Code Builder view, and select **Open ACB Settings**. ![The Settings gear icon highlighted in the Anypoint Code Builder menu panel](/mulesoft/current/en-us/anypoint-code-builder/_images/open-settings.png) 2. Locate the **Mule > Runtime: Mule Home** property: ![Settings dialog showing Mule Home configuration field with default path](/mulesoft/current/en-us/anypoint-code-builder/_images/mule-runtimes-settings.png) 3. Provide the full path to the folder that contains Mule runtime. This field must not be empty. ## Please Download and Install a JDK to Compile Your Project This request is _not_ from MuleSoft or Anypoint Code Builder: ![Notification showing a request to download and install a JDK to compile a project](/mulesoft/current/en-us/anypoint-code-builder/_images/troubleshoot-download-java-notification.png) For supported Mule workflows, Anypoint Code Builder resolves Java from the JDK packaged under your `AnypointCodeBuilder` directory. Using that local JDK source helps avoid machine-specific Java setup issues and improves project startup reliability. Instead of using this feature, you can use the command **Download Mule Runtime and Java Versions**. See [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions). ## Mule Runtime Version Not Defined The error **Mule runtime version not defined** occurs when your project doesn’t specify a Mule runtime version in the project’s `mule-artifact.json` file. To resolve this issue: 1. Click **Open Project Properties** in the error dialog, or run the command `MuleSoft: Open Mule Project Properties`. 2. In **Project Properties**, select a Mule runtime version. 3. Click **Apply**. ## Java Version Not Defined The error **Java version not defined** occurs when your project doesn’t specify a Java version in the project’s `mule-artifact.json` file. To resolve this issue: 1. Click **Open Project Properties** in the error dialog, or run the command `MuleSoft: Open Mule Project Properties`. 2. In **Project Properties**, select a Java version. 3. Click **Apply**. ## Mule Runtime Version Not Found (Compatible Version Available) The error **Mule runtime \[version\] not found** occurs when you try to run or debug an application, but the exact Mule runtime version specified in your project isn’t available locally. However, a compatible local version is available. To resolve this issue, you have two options: - **Continue with compatible version**: Click **Continue** to use the latest local compatible version. The dialog shows which version to use. - **Select a different version**: Click **Open Project Properties** to select a different local Mule runtime version or install the exact version using the `MuleSoft: Install Runtime` command. ## Mule Runtime Version Not Found (No Compatible Version) The error **Mule runtime \[version\] not found** occurs when you try to run or debug an application, but the exact Mule runtime version specified in your project isn’t available locally, and no compatible version is available. To resolve this issue: 1. Click **Open Project Properties** in the error dialog. 2. In **Project Properties**, either: - Select a locally available Mule runtime version from the dropdown, or - Use the `MuleSoft: Install Runtime` command to download the required version. 3. Click **Apply**. ## Java Version Not Found The error **Java \[version\] not found** occurs when you try to run or debug an application, but the Java version specified in your project isn’t available locally. To resolve this issue: 1. Click **Open Project Properties** in the error dialog. 2. In **Project Properties**, either: - Select Java 17 (or another available version) from the dropdown, or - Use the `MuleSoft: Download Mule Runtime and Java Versions` command to download the required Java version. 3. Click **Apply**. ## Mule Runtime and Java Version Not Found The error **Mule runtime \[version\] and Java \[version\] not found** occurs when you try to run or debug an application, but both the Mule runtime and Java versions specified in your project aren’t available locally. To resolve this issue: 1. Click **Open Project Properties** in the error dialog. 2. In **Project Properties**: - Select a locally available Mule runtime version and Java 17 (or another compatible version) from the dropdowns, or - Use the `MuleSoft: Install Runtime` command to download the required Mule runtime version, and use the `MuleSoft: Download Mule Runtime and Java Versions` command to download the required Java version. 3. Click **Apply**. ## Reinstall Mule Runtime If your Mule runtime installation becomes corrupted, you can force a reinstallation: 1. Close Anypoint Code Builder. 2. Navigate to your Mule runtime directory: `${user.home}/AnypointCodeBuilder/runtimes`. 3. Remove or rename the folder for the runtime version you want to reinstall (for example, `mule-4.6.0`). 4. Open Anypoint Code Builder. 5. Select the Mule runtime version from **Project Properties**. Anypoint Code Builder downloads and reinstalls the selected version. For details on selecting versions, see [Select Mule and Java Versions for a Project](https://docs.mulesoft.com/anypoint-code-builder/int-versions#project-version-mule-java). > [!NOTE] Your projects and other installed Mule runtime versions are not affected. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # MuleSoft Settings > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder provides configurable settings that apply across all your Anypoint Code Builder projects. Many of the default settings are suitable for most users. However, if you use the EU cloud or Private Cloud Edition, it is important to change the default US cloud setting. To open the settings: 1. If an API specification is open in the Explorer panel, close the project to avoid a synchronization error when you switch clouds. - Click **File** > **Close Folder**. 2. Open the **Settings** panel: ![Selecting the EU cloud from Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-activity-bar-select-cloud.png) Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). For information about specific Mule settings, see the sections that follow. ## Mule › Application: Default Mule Runtime And Java Versions Set a default Mule runtime engine and Java version for new Mule projects (integrations and implementations) by clicking the link **Edit defaults through command palette**. ## Mule › Application: Group ID Set the Maven group ID value for Anypoint Code Builder to use when you create a Mule integration or implementation project. This setting populates the `pom.xml` file for each Mule project. The default is `com.mycompany`, for example, `com.mycompany` in the `pom.xml`. You can change the setting within your project, as needed. For information about Maven group IDs, see [Introduction to the POM](https://maven.apache.org/guides/introduction/introduction-to-the-pom.html) in the Apache Maven Project documentation. ## Mule > Logging: Level Set the verbosity of logs that appear in the Anypoint Code Builder extension, Mule DX Server, and Mule DX Server: Scaffolding logs. Verbosity options are progressive: - Off: No issues - Fatal: Fatal issues only - Error: Fatal and Error issues - Warn (default): Fatal, Error, and Warn issues - Info: Fatal, Error, Warn, and Info issues - Debug: Fatal, Error, Warn, Info, and Debug issues - Trace: Fatal, Error, Warn, Info, Debug, and Trace issues ## Mule › Lsp › Trace: Server You can enable and control the verbosity of `LogTrace` notifications to VS Code from the `muleLanguageServerProtocol` service. Available settings: - **off** (default) - **messages** - **verbose** ## Mule › Runtime: Default Arguments Set default command-line arguments to use when starting Mule Runtime engine (Mule). Mule starts when you run a Mule application in an integration or implementation project. Common uses of this setting are to: - Append an encryption key value (such as `-M-Dencryption.key=my-key`) when running a local deployment that incorporates secure configuration properties - Set a variable (such as `-M-Denv=dev`) that Mule uses when selecting a configuration properties file by its file name - Increase the JVM heap size (such as `-M-Xmx2g`) when running memory-intensive Mule applications locally To set the maximum JVM heap size to 2 GB, add the following argument: ```text -M-Xmx2g ``` To also set the initial heap size: ```text -M-Xms512m -M-Xmx2g ``` For more information about passing properties and arguments when running Mule applications, including examples, use cases, and troubleshooting, see [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties). For information about secure configuration properties, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ## Mule › Runtime: Default Metaspace Size Metaspace is an area for non-heap memory used to store class metadata, constant pool information, and method bytecode. Typically, the default of **1g** (1 GB) is sufficient. However, you can change the metaspace size when installing Mule Runtime engine (Mule). ## Mule: Control Plane Select a control plane for Anypoint Code Builder: - **US Cloud** (default) - **EU Cloud** - **Canada Cloud** - **Japan Cloud** - **India Cloud** - **Australia Cloud** - **United Kingdom Cloud** - **Private Cloud Edition** For more information, see [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds). Starting with Anypoint Code Builder 1.28.0, you can select **Private Cloud Edition** to connect to a Private Cloud Edition (PCE) 4.3.0 or later control plane. Set [Mule: Control Plane PCE URL](#setting-pce-url) to your PCE control plane URL. To add a Mule runtime version that Anypoint Code Builder does not include, see [Add a Mule Runtime Version Locally](https://docs.mulesoft.com/anypoint-code-builder/start-acb#add-local-mule-runtime). For more information, see [Set Anypoint Code Builder to a Different Control Plane](https://docs.mulesoft.com/anypoint-code-builder/start-acb#change-clouds). ## Mule: Control Plane PCE URL Set the URL of your Private Cloud Edition (PCE) control plane, for example `[https://pce.example.com](https://pce.example.com)`. Anypoint Code Builder uses this URL when **Mule: Control Plane** is **Private Cloud Edition**, and imports custom SSL certificates for the PCE host automatically. After you set the URL, restart Anypoint Code Builder and sign in from the Command Palette with **MuleSoft: Login to Anypoint Platform**. The command opens the PCE sign-in page. For more information, see [Set Anypoint Code Builder to a Different Control Plane](https://docs.mulesoft.com/anypoint-code-builder/start-acb#change-clouds). ## Mule > Telemetry You can enable or disable telemetry services in the US cloud. By default, this setting is disabled and not used for the EU cloud. When telemetry services are enabled, Anypoint Code Builder sends anonymous usage data to the MuleSoft team. The data helps identify important usage trends. ## Mule: Home Directory Set a home directory for downloaded assets, which include Mule runtime (`runtime/`) and Java (`java/`) versions for your implementations and integrations. ## Mule > Editor > Auto-completion: Enablement Enable auto-completion suggestions in the API design editor in Anypoint Code Builder. This setting prevents the need to press Ctrl+Space to activate a list of suggestions and is disabled by default. See also [Mule > Editor > Auto-completion: Trigger Delay](#setting-auto-complete-debouncer). ## Mule > Editor > Auto-completion: Trigger Delay Set the time in milliseconds to wait before displaying auto-completion options. This setting defaults to 1500 milliseconds. See also [Mule > Editor > Auto-completion: Enablement](#setting-auto-complete). Avoid setting a long delay. If you activate the auto-completion menu but initiate other actions in your project before the delay period ends, Anypoint Code Builder automatically returns focus to the editor and opens the menu where you activated auto-completion. Such actions include opening the command palette or using the command terminal after activating the menu. If you move your cursor to a new location or use the up or down arrow keys in the editor before the trigger delay expires, the request to open the auto-completion menu is cancelled. ## Mule > Runtime: Fips Enabled Enable FIPS compliance mode for your Mule applications. When enabled, the embedded JVM uses Bouncy Castle FIPS (BCFIPS) modules for all cryptographic operations. Required for regulated PCE and GIA2H environments. Enabling this setting automatically configures BCFIPS libraries, generates a custom `java.security` file, creates a BCFKS-format keystore, and updates each Mule application run configuration with the required FIPS parameters. For more information, see [Configuring FIPS Compliance in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-fips-compliance). ## Mule > Runtime: Fips Mode Select the FIPS compliance level. This setting only applies when [Fips Enabled](#setting-fips-enabled) is selected. Available options: - **FIPS 140-2** - **FIPS 140-3** For more information, see [Configuring FIPS Compliance in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-fips-compliance). ## Mule > Runtime: Fips Custom Cacerts Path Optional path to a custom `cacerts` file. If not specified, the default `cacerts` from the JDK is used. When FIPS mode is enabled, this file is automatically converted to BCFKS format. For more information, see [Configuring FIPS Compliance in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-fips-compliance). --- product: Anypoint Code Builder version: master --- # Mulesoft Vibes Example Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use these example messages to guide Mulesoft Vibes in completing common tasks. Customize the values to match your project or environment. ## Application Deployment and Projects - **Task**: Deploy an app to CloudHub or Runtime Fabric. **Prompt**: Deploy the \[application\_name\] app from Anypoint Exchange. - **Task**: Create an integration project. **Prompt**: Create a Mule project that creates an order in NetSuite every time an opportunity in Salesforce is updated to the ‘Closed Won’ stage. - **Task**: Deploy an integration application. **Prompt**: Deploy \[application\_name\] app in the current project. Deploy it with high security, high availability, and performance optimized settings. - **Task**: Modify an existing application. **Prompt**: Update \[application\_name\] so that it meets \[specific business requirements\]. - **Task**: Generate an MCP server using Anypoint connectors. **Prompt**: Generate an MCP server that exposes three tools from the following operations: Workday - Absence Management - Get Time Off Plan Balances, Workday - Absence Management - Enter Time Off, and Google Calendar - Create Calendar Event. ## Exchange Asset Management - **Task**: Create an asset in Exchange. **Prompt**: Publish \[this asset type\] in Exchange using this \[name\]. - **Task**: Search for an asset in Exchange. **Prompt**: Do I have any assets for order notifications in Exchange? - **Task**: Search for an asset within a specific organization. **Prompt**: Find \[asset name\] in \[organization name\]. ## API Instances - **Task**: Create an app instance and apply a policy. **Prompt**: Create an instance for the \[application\_name\] and apply the rate limiting policy to that instance. - **Task**: View performance metrics for your APIs or apps. **Prompt**: Which apps generated the most errors this month? ## Custom Metadata - **Task**: Set custom metadata that uses sample data. **Prompt**: Can you help me define custom metadata on the following component? This is how the sample data looks: \[sample data\]. - **Task**: Set custom metadata using a file. **Prompt**: Define custom metadata using the sample file below and attach it to \[processor\_name\] @\[path\_to\_file\]. ## Agent Network Operations - **Task**: Create an Agent Network **Prompt**: Create an Agent Network for called "Employee Onboarding". - **Task**: Publish an Agent Network. **Prompt**: Publish the "Employee Onboarding" Agent Network project to Exchange. - **Task**: Deploy an instance of the "Employee Onboarding" Agent Network to staging. **Prompt**: Deploy this Agent Network project. ## Order Management Your company manages a growing e-commerce platform and needs a way to streamline the handling of customer orders. You want to build an API specification that allows your backend systems to create, retrieve, update, and delete orders, ensuring consistent data models and robust error handling across all operations. To generate a specification for this task, enter a message like: `Generate an API specification for an order management system for an e-commerce platform. The API should include endpoints to create, retrieve, update, and delete orders, along with detailed definitions for request and response payloads, versioning details, and error handling mechanisms.` This message generates an API specification using the same specification language as the file that was in focus: ```xml openapi: 3.0.0 info: title: Order Management API version: 1.0.0 description: API for managing orders in an e-commerce platform. servers: - url: https://api.ecommerce.com/v1 paths: /orders: post: (1) summary: Create a new order operationId: createOrder requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Order' responses: '201': description: Order created successfully '400': description: Bad request '401': description: Unauthorized '500': description: Internal server error security: - bearerAuth: [] get: (2) summary: Retrieve all orders operationId: getOrders responses: '200': description: A list of orders content: application/json: schema: type: array items: $ref: '#/components/schemas/Order' '401': description: Unauthorized '500': description: Internal server error security: - bearerAuth: [] /orders/{orderId}: (3) get: summary: Retrieve a specific order operationId: getOrder parameters: - name: orderId in: path required: true schema: type: string responses: '200': description: Order details '404': description: Order not found put: summary: Update an existing order operationId: updateOrder parameters: - name: orderId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Order' responses: '200': description: Order updated successfully '404': description: Order not found delete: summary: Delete an order operationId: deleteOrder parameters: - name: orderId in: path required: true schema: type: string responses: '204': description: Order deleted successfully '404': description: Order not found components: securitySchemes: (4) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (5) Order: type: object properties: id: type: string customerId: type: string items: type: array items: $ref: '#/components/schemas/OrderItem' totalAmount: type: number format: float status: type: string enum: [pending, processing, completed, cancelled] OrderItem: type: object properties: productId: type: string quantity: type: integer price: type: number format: float ```
1Creates a new order: The POST /orders operation accepts a JSON payload and returns a success or error response.
2Retrieves a list of all orders: The GET /orders operation returns an array of order objects.
3Handles operations for a specific order: Includes GET, PUT, and DELETE methods on /orders/{orderId} with path parameter validation.
4Uses bearer token authentication: The bearerAuth scheme is applied to secure all endpoints.
5Defines reusable data models: The Order and OrderItem schemas provide consistent structure for request and response payloads.
## Inventory Management Your business needs to track and manage product stock across multiple warehouses and storefronts. To ensure accurate inventory levels and prevent overselling, you want to generate an API specification that supports creating, updating, deleting, and listing products. The specification should include clear data models, input validation rules, and proper security mechanisms. To generate a specification for this task, enter a message like: `Generate an API specification for an inventory management system. The API should expose endpoints to manage products and stock levels, support operations to add, update, delete, and list products, and include clear definitions for data models, input validation rules, and security considerations.` ```xml openapi: 3.0.0 info: title: Inventory Management API version: 1.0.0 description: API for managing products and stock levels. servers: - url: https://api.inventory.com/v1 paths: /products: post: (1) summary: Add a new product operationId: addProduct requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Product' responses: '201': description: Product added successfully '400': description: Invalid input security: - bearerAuth: [] get: (2) summary: List all products operationId: listProducts responses: '200': description: A list of products content: application/json: schema: type: array items: $ref: '#/components/schemas/Product' '500': description: Internal server error security: - bearerAuth: [] /products/{productId}: (3) get: summary: Get product details operationId: getProduct parameters: - name: productId in: path required: true schema: type: string responses: '200': description: Product data '404': description: Product not found put: summary: Update a product operationId: updateProduct parameters: - name: productId in: path required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Product' responses: '200': description: Product updated '400': description: Invalid input '404': description: Product not found delete: summary: Delete a product operationId: deleteProduct parameters: - name: productId in: path required: true schema: type: string responses: '204': description: Product deleted '404': description: Product not found components: securitySchemes:(4) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (5) Product: type: object required: [id, name, quantity, price] properties: id: type: string name: type: string description: type: string quantity: type: integer minimum: 0 price: type: number format: float ```
1Creates a new product: The POST /products operation uses a JSON payload to define the product.
2Lists all products: The GET /products operation returns an array of products in stock.
3Manages individual products: Includes operations to retrieve, update, or delete a specific product using its ID.
4Secures endpoints with bearer authentication: The API uses bearerAuth to protect inventory operations.
5Includes a validated product schema: The Product schema enforces required fields and validation like minimum: 0 for quantity.
## User authentication and management Your application requires secure and reliable user authentication to protect user data and manage access to services. To support this, you want to generate an API specification that handles user registration, login, token management, and password resets. The specification should include proper input validation, error responses, and security best practices. To generate a specification for this task, enter a message like: `Generate an API specification for a user authentication and management service. The API should support endpoints for user registration, login, token management, and password resets, including thorough details on input validation, error responses, and necessary security protocols.` This message generates an API specification using the same specification language as the file that was in focus: ```xml openapi: 3.0.0 info: title: User Auth API version: 1.0.0 description: API for managing user authentication and credentials. servers: - url: https://api.example.com/v1 paths: /register: (1) post: summary: Register a new user operationId: registerUser requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegisterRequest' responses: '201': description: User created '400': description: Invalid input /login: (2) post: summary: Authenticate a user operationId: loginUser requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LoginRequest' responses: '200': description: Login successful '401': description: Unauthorized /token/refresh: (3) post: summary: Refresh an access token operationId: refreshToken requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RefreshRequest' responses: '200': description: Token refreshed '401': description: Invalid refresh token /reset-password: (4) post: summary: Request password reset operationId: resetPassword requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResetRequest' responses: '200': description: Password reset email sent '404': description: User not found components: securitySchemes: (5) bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: (6) RegisterRequest: type: object required: [email, password] properties: email: type: string format: email password: type: string minLength: 8 LoginRequest: type: object required: [email, password] properties: email: type: string password: type: string RefreshRequest: type: object required: [refreshToken] properties: refreshToken: type: string ResetRequest: type: object required: [email] properties: email: type: string ```
1Registers a new user: POST /register validates input and creates a new user account.
2Logs in a user: POST /login checks credentials and returns a token on success.
3Refreshes token: POST /token/refresh issues a new access token using a refresh token.
4Initiates password reset: POST /reset-password sends a reset email if the user exists.
5Secures endpoints: All protected routes use JWT bearer authentication.
6Defines schemas: UserRegistration and UserLogin schemas include input validation like minLength and format: email.
## MUnit tests for Mule flows Your Mule application exposes APIs and orchestrates calls to backend services. To improve reliability, create MUnit tests for a flow that processes requests, transforms payloads, and returns responses under different conditions. To generate tests for this task, enter a message like: `Create MUnit tests for the flow. Add one test for the happy path, one test for invalid input, and one test for a downstream service failure. Mock the external dependencies, use sample event payloads, and verify the expected response payload and status code in each case.` --- product: Anypoint Code Builder version: master keywords: mulesoft vibes, anypoint code builder, learning map, developer resources, mulesoft training, integration development --- # MuleSoft Vibes for Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes is the natural-language assistant in Anypoint Code Builder for API specifications, integrations, and related tasks by using the built-in MuleSoft MCP Server and optional custom MCP servers. The end-to-end journey for MuleSoft Vibes consists of various tasks, each with links to relevant content to assist you in completing them.
Learn about MuleSoft Vibes

Learn About MuleSoft Vibes

MuleSoft Vibes is a purpose-built assistant for the development lifecycle, available directly in Anypoint Code Builder. Build, deploy, and manage your projects using natural language prompts.

Get started with MuleSoft Vibes

Get Started

Set up the IDE, confirm permissions, then open MuleSoft Vibes and start prompting with confidence.

Design APIs

Design APIs, Rules, and Automation

Shape API specs with AI, attach context, tune Vibes settings, and standardize output with rules, workflows, and commands.

Build integration projects

Build Integration Projects

Attach context to MuleSoft Vibes, open the assistant for integrations, and scaffold an integration project.

Resume work

Resume Work, Prompt, and Improve Output

Pick up tasks from conversation history, write and verify prompts, reuse example patterns, and improve output when results are inconsistent.

Configure and manage MCP servers

Configure and Manage MCP Servers

Install and tune MCP servers so MuleSoft Vibes can call the right tools with the right approvals.

## See Also - [Anypoint Code Builder Overview](https://docs.mulesoft.com/anypoint-code-builder/) - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) --- product: Anypoint Code Builder version: master --- # MuleSoft Vibes Overview > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes is a purpose-built assistant for the development lifecycle, available directly in Anypoint Code Builder. MuleSoft Vibes enables you to build, deploy, and manage your projects using natural language messages. MuleSoft Vibes integrates with the [MuleSoft MCP Server](https://docs.mulesoft.com/mulesoft-mcp-server/), which provides a set of agentic tools that connect MuleSoft Vibes directly to your MuleSoft environment. Through this integration, MuleSoft Vibes can perform actions and retrieve data on your behalf, enabling capabilities such as: - Developing API specifications - Creating and configuring applications - Creating agent networks - Searching for assets - Deploying and managing instances - Securing your applications - Managing custom metadata You can also use [skills](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills), reusable instruction sets that MuleSoft Vibes activates when your task matches a skill’s description. MuleSoft Vibes uses the `use_skill` tool to load and run a skill’s full instructions when your task matches that skill. **Workspace skills** are available only in the workspace or project where they are defined. **Global skills** are available in every project and workspace. Large language models (LLMs) power these features and operate within the Salesforce Shared Trust Boundary. MuleSoft Vibes is part of the broader MuleSoft AI ecosystem, which also includes capabilities such as Map with AI and Map and Transform with AI. For an overview of all MuleSoft AI features, see the [Learning Map: MuleSoft AI](https://docs.mulesoft.com/general/learning-map-mulesoft-ai). For a high-level overview that guides you through a curated set of MuleSoft Vibes topics in Anypoint Code Builder, see [Learning Map: MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started). > [!NOTE] MuleSoft Vibes is available on US, EU, Canada, Japan, India, Australia, and United Kingdom > cloud hosts. ## Capabilities in Your Workspace MuleSoft Vibes helps you describe outcomes in plain language so the assistant can plan changes, generate artifacts, and run permitted actions against your connected MuleSoft environment. Generated work stays in your project and is subject to the same governance as code you write manually. Models run within the Salesforce Shared Trust Boundary, and the assistant inherits the permissions of the user signed in to Anypoint Code Builder. For supported regions, prerequisites, and a full capability list, see [Before You Begin](#before-you-begin-vibes). ## MCP Servers and Agentic Tools The MuleSoft MCP Server supplies tools that connect MuleSoft Vibes to Exchange, Runtime Manager, and other services so prompts can search assets, inspect deployments, and perform other allowed operations. You enable or restrict that behavior by which servers and tools you install. For product-level MCP documentation, see [MuleSoft MCP Servers Overview](https://docs.mulesoft.com/mulesoft-mcp-server/). When you are ready to add or tune servers, continue with [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server). ## Related MuleSoft AI Resources MuleSoft Vibes is part of the broader MuleSoft AI story alongside experiences such as Map with AI and Map and Transform with AI. For a platform-wide learning path across those capabilities, see [MuleSoft AI](https://docs.mulesoft.com/general/learning-map-mulesoft-ai). ## Use MuleSoft Vibes Ensure you meet the [prerequisites](#before-you-begin-vibes) before you begin. You can open MuleSoft Vibes from the: - Toolbar icon - Top navigation bar - **Build with AI** card in the project canvas When you submit a prompt, MuleSoft Vibes processes it using one of the MuleSoft MCP Servers and performs actions such as generating API specifications or integration flows. Depending on your configuration, MuleSoft Vibes can: - Request approval before writing to your files - Write automatically if **Auto-approve** is enabled in settings ### Plan and Act Modes MuleSoft Vibes operates in two modes: - **Plan Mode** MuleSoft Vibes analyzes your message and produces a step-by-step plan describing how it will accomplish the task. No actions are executed automatically in this mode. - **Act Mode** MuleSoft Vibes attempts to perform the actions outlined in the plan by using the MuleSoft DX MCP Server tools to modify files, create resources, or execute changes to your project. You can switch between modes depending on whether you prefer to review the plan before execution or allow MuleSoft Vibes to act directly. ### Modernize Flows with Descriptive UI Descriptive UI is a different canvas experience in MuleSoft Vibes starting with Anypoint Code Builder v1.19. It modernizes flow development with a vertical, recipe-style layout that makes integrations easier to read and update. The canvas uses AI to generate human-readable descriptions for each component in your flow. For example, instead of decoding a technical component first, you can understand what that step does in business terms. Visual indentation highlights branching and nested logic, such as choice routers and error handling paths, so you can scan complex flows faster. This structure helps you understand overall flow behavior before opening detailed configuration panels. You can build and refine flows through agent-led and direct UI interactions. Use natural language commands in MuleSoft Vibes to add, modify, delete, and reorder components, or hover over the canvas to reveal inline **+** controls for quick edits. Descriptions are generated on demand with your approval, which helps you document legacy and newly created flows without interrupting development. If you prefer the previous experience, you can switch back to the **Classic** canvas view at any time from canvas controls or Anypoint Code Builder settings. ### Generate Code in MuleSoft Vibes MuleSoft Vibes uses MuleSoft-optimized AI pipelines to generate high-quality code for API specifications and integration flows. The pipelines are exposed to MuleSoft Vibes through these MCP tools: - `generate_mule_flow` – Generates Mule integration flows. - `generate_api_spec` – Generates API specifications from natural language. Because these tools run on pipelines optimized specifically for MuleSoft use cases, users typically receive higher-quality code outputs (on average, 60% better) compared to generic generation. To ensure the best results: - Verify that the MuleSoft MCP Servers are loaded in MuleSoft Vibes prior to sending a prompt. - Make sure MuleSoft Vibes is invoking these specialized tools. - Verify that all required prerequisites for MuleSoft Vibes and MuleSoft MCP Servers are enabled in your environment. For more information about how MuleSoft AI generation pipelines work, see the [MuleSoft research blog](https://blogs.mulesoft.com/automation/how-mulesoft-turns-generative-output-into-value/). ## Provide MuleSoft Vibes with Context You can improve the accuracy of MuleSoft Vibes output by providing additional context files or inputs. Examples include requirement files (`requirements.txt`), configuration folders, logs, URLs, or terminal output. To add context: 1. In the MuleSoft Vibes panel, click the **Add Context** icon in the lower-left corner. 2. Select files or folders to attach, paste the input or output from terminal, or paste a URL. 3. Confirm to add the context to your current task. You can also add context directly from the message input box by typing `@`, which opens the same context selector. These inputs are used as contextual references during generation. ### Add Files to Messages with Multi-Modal Support MuleSoft Vibes supports multi-modal context in the message area. Drag images directly into a conversation to provide visual context alongside text inputs. Attach up to 10 files per conversation to help MuleSoft Vibes interpret requirements that are easier to explain through screenshots or supporting files. ## Configure MuleSoft Vibes Settings You can customize how MuleSoft Vibes interacts with your project through the **Settings** panel. To access this panel, click the **Auto-approve** section at the bottom of the MuleSoft Vibes window. The available options include: - **Auto-approve**: Automatically apply changes without prompting for confirmation. - **Read project files**: Allow MuleSoft Vibes to read project files for context. - **Edit project files**: Allow MuleSoft Vibes to write changes directly to your project. - **Read all files**: Allow MuleSoft Vibes to read all files on your computer. - **Edit all files**: Allow MuleSoft Vibes to edit any file on your computer. - **Use MCP Servers**: Allow MuleSoft Vibes to use connected MCP servers. - **Execute safe commands**: Allow MuleSoft Vibes to execute safe terminal commands. - **Execute all commands**: Allow MuleSoft Vibes to execute any terminal command. - **Use the browser**: Allow MuleSoft Vibes to launch and interact with websites in a browser. - **Default skills**: Enable or disable preloaded skills individually. ### Monitor Token Consumption in MuleSoft Vibes View token consumption for individual requests and tasks directly in MuleSoft Vibes. This visibility helps you understand the resource cost of generation activities and manage usage across sessions. ## Skills in MuleSoft Vibes [Skills](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills) are reusable instruction sets that load when your message matches a skill’s description. For information about skills and MCP tools, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). To share workspace rules and skills from GitHub, see [Sharing Rules and Skills from GitHub with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github). If you use Claude Code, see [Install MuleSoft Skills in Claude Code](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills#install-mulesoft-skills-in-claude-code). ## MCP Connector in Anypoint Code Builder Anypoint Code Builder uses [MCP Connector](https://docs.mulesoft.com/mcp-connector/latest/) to maintain compatibility with MCP integrations to keep tool-driven workflows reliable across supported scenarios. ## Before You Begin To use MuleSoft Vibes, make sure that you meet these prerequisites: - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Make sure you have the [required Anypoint Code Builder permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). - Install Node.js 20 LTS or later. - Install the latest version of `jq`. - On Windows, install **Git Bash** to use skills that run prepackaged shell-based steps. - Ensure you have the **Mule Developer Generative AI User** and **Anypoint Code Builder Developer** permissions. - Make sure Einstein is enabled in Access Management. For more information, see [Enabling or Disabling Generative AI for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). - Connect your Anypoint Platform organization to a Salesforce organization that has generative AI enabled. For setup instructions, see [Connecting a Trusted Salesforce Organization to Anypoint Platform](https://docs.mulesoft.com/access-management/connecting-salesforce-orgs) and [Salesforce Organization Connections in Anypoint Platform](https://docs.mulesoft.com/access-management/trusted-salesforce-org). > [!NOTE] If you’re a MuleSoft customer without an existing Salesforce organization, contact your > MuleSoft account team to provision an Einstein-enabled Salesforce organization. > [!NOTE] Authentication happens through the user logged in to Anypoint Code Builder. MuleSoft Vibes > inherits the same permissions as that user and can only execute actions that the user is > authorized to perform in Anypoint Platform. ## See Also - [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) - [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills) - [Sharing Rules and Skills from GitHub with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github) - [Troubleshooting AI Features in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-generative-ai) - [MuleSoft MCP Servers Overview](https://docs.mulesoft.com/mulesoft-mcp-server/) --- product: Anypoint Code Builder version: master --- # Opening a Component in the Canvas from the Code Editor > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You can open a component and its configuration panel in the canvas from the code editor. This feature is helpful, for example, if you want to configure the component from the UI, if a component is in another flow than the flow currently displayed in the canvas, or if the canvas is not open. 1. From the code editor, place your cursor within the component’s XML. 2. Right-click and select **Configure Component in UI**. This action displays the component in the canvas and opens its configuration panel, for example: ![Opening a component in the canvas from the code editor](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-open-component-ui-from-xml.png) --- product: Anypoint Code Builder version: master --- # Parallel For Each () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Process a collection of messages by splitting the collection into parts that are simultaneously processed. After processing all messages, the component aggregates the results following the same order they were in before the split, and then the flow continues. Parallel For Each buffers all processing routes' results in a list to return it after the scope finishes processing, which can cause out-of-memory errors when processing a large number of entries. To process large payloads, use Batch Processing instead. ## Component XML This component supports the following XML structure: ```xml ``` Parallel For Each (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Parallel foreach (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Collection

collection

An expression that returns a collection. Defaults to #[payload].

Timeout

timeout

Specifies the timeout in milliseconds for each parallel route.

Max concurrency

maxConcurrency

Specifies the maximum level of parallelism for the router to use.

+ By default, all routes run in parallel.

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

## Examples ### Example: Appending Values The following example appends the string `"-result"` to every element in the collection: ```xml ``` ### Example: Modifying Variables The following example demonstrates that changes to existing variables inside the Parallel For Each scope are temporary and do not persist after the execution finishes: ```xml ``` The example produces the following output: ```json { "var1": "var1", "var2": "var2" } ``` Every execution of the Parallel For Each scope starts with the same variables and values as before the execution of the block. New variables or modifications of already existing variables while processing one element are not visible while processing another element. All of those variable changes are not available outside the Parallel For Each scope. The set of variables (and their values) after the execution of the Parallel For Each Scope remains the same as before the execution. ## Error Handling Because the scope processes every route in parallel, if an error occurs in one route, processing continues in all of the other routes until all finish processing. After that, Parallel For Each aggregates all results (and any errors) and processes them by the error handler, as shown in the following example: ```xml ``` ### Throws - `MULE:COMPOSITE_ROUTING` ## Differences between For Each and Parallel For Each Scopes Both For Each and Parallel For Each split the defined collection, and the components within the scope process each element in the collection. Also, in both cases, each route runs with the same initial context. The difference between these two scopes are: - For Each works sequentially, while the Parallel For Each processes in parallel. This difference affects _error handling_: Because of the processing differences, the execution of For Each execution is interrupted when an error is raised (and the Error Handler is invoked), while Parallel For Each processes every route before invoking the Error Handler with a `MULE:COMPOSITE_ROUTE` error type. - For Each does not modify the payload, while the Parallel For Each outputs a collection of the output messages from each iteration. ## See Also - [For Each Scope](https://docs.mulesoft.com/anypoint-code-builder/acb-component-for-each). - [How Transactions Affect Scopes and Routers](https://docs.mulesoft.com/mule-runtime/latest/transaction-management#tx_scopes_routers) --- product: Anypoint Code Builder version: master --- # Parse Template () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Process a template and obtain a result. A template includes text with embedded DataWeave expressions that Mule evaluates and replaces with their result. Configure a template through an external file reference, or embed the template in the component configuration. ## Component XML This component supports the following XML structure: ```xml ``` Parse Template (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Parse template (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Content

content

String representing the template where embedded expressions are evaluated and replaced by their results.

Location

location

Location of the template file. Mule inserts values extracted from the message properties or variables into this file.

Output encoding

outputEncoding

Encoding of the payload that this component outputs.

Output mime type

outputMimeType

MIME type of the payload that this component outputs. For more information, see Using Reader and Writer Properties.

Parameters

N/A

Appends a key-value pair for a reader property to the value of the outputMimeType attribute. Multiple key-value pairs are allowed. Reader properties are specific to the MIME type. For example, see the JSON reader properties for application/json. To find other reader properties, navigate to a supported format from the DataWeave format documentation, and see Using Reader and Writer Properties.

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

## Examples The following examples use Parse Template to load data dynamically into HTML. ### Example: Processing Results of a Database Query Dynamically The following example uses Parse Template in a Mule application that loads employee data from a database into an HTML template. The flow returns the template-built output to the caller. ```xml SELECT * FROM Employees WHERE id=#[attributes.queryParams['id']] ``` #### Template Content The template selects fields containing name, department, job title, start date, and employee type values from the input payload. ```html
First Name Last Name Department Job Title Start Date Employee Type
#[payload['first_name']] #[payload['last_name']] #[payload['department']] #[payload['job_title']] #[payload['start_date']] #[payload['employee_type']]
``` #### Input to Parse Template Assume that you start the flow with a URI that contains a query parameter that identifies the ID of an employee, such as `http://localhost:8081/getEmployee?id=1234`, and that the Select operation returns the following input to Parse Template: ```html { "first_name": "Melba", "last_name": "Roy Mouton", "department": "Computers", "job_title": "Assistant Chief of Research Programs", "start_date": "01/01/2021", "employee_type": "mathematician" } ``` #### Output of the Template The [example](#template) returns template-built output. The output is HTML with the selected employee data. ```xml
First Name Last Name Department Job Title Start Date Employee Type
"Melba" "Roy Mouton" "Computers" "Assistant Chief of Research Programs" "01/01/2021" "mathematician"
``` ### Dynamically Generating Data in HTML Rows The following example uses Parse Template on employee records that are represented as an array of objects. ```xml ``` #### Template Content The following template uses a DataWeave script to iterate over the input array and construct an HTML row for each object in the array: ```html #[%dw 2.0 output application/java --- payload.*Employee[0] map ((item) -> " ") joinBy ""]
First Name Last Name Department Job Title Start Date Employee Type
" ++ (item.first_name default "") ++ " " ++ (item.last_name default "") ++ " " ++ (item.department default "") ++ " " ++ (item.job_title default "") ++ " " ++ (item.start_date default "") ++ " " ++ (item.employee_type default "") ++ "
``` #### Input to Parse Template Assume that Parse Template component receives the following payload from Set Payload: ```html { Employee: [ { "first_name" : "Melba", "last_name" : "Roy Mouton", "department" : "Computers", "job_title" : "Assistant Chief of Research Programs", "start_date" : "01/01/2021", "employee_type" : "mathematician" }, { "first_name" : "Annie", "last_name" : "Easley", "department" : "Software Development", "job_title" : "Technical Lead", "start_date" : "06/02/2020", "employee_type" : "Rocket Scientist" } ] } ``` #### Output of the Template The [example](#template2) returns template-built output. The output is HTML with the dynamically produced rows and data from the objects in the array. ```xml
First Name Last Name Department Job Title Start Date Employee Type
Melba Roy Mouton Computers Assistant Chief of Research Programs 01/01/2021 mathematician
Annie Easley Software Development Technical Lead 06/02/2020 Rocket Scientist
``` ## Special Characters Parse Template supports the use of expressions within a template and the use of literals within these expressions. The template recognizes certain special characters, such as the sequence `\#[` and quotations marks. You can escape such characters to treat them as regular characters. - `#[an-expression]`: Within a template, use the characters `#[]` to designate an expression. For example, a template can contain expressions within HTML elements, such as `#[upper("mulesoft")]`, which resolves to `MULESOFT`. Empty expressions (`#[]`) return an error, but empty strings, such as `#['']` or `#[""]` are valid expressions. - Sub-expressions: To resolve a sub-expression that is surrounded by quotation marks, surround the sub-expression with another `#[]`. For example, the four elements in the template snippet below contain the same sub-expression (`upper("world")`), either inside or outside of quotation marks. The first two return the same results. The last two do not process `upper("world")` because the sub-expression is inside the quotation marks but not surrounded by another `#[]`. Parse Template Snippet: ```XML #['hello #[upper("world")]'] #['hello ' ++ upper("world")] #['hello upper("world")'] #['hello ++ upper("world")'] ``` Output Values: ```XML hello WORLD hello WORLD hello upper("world") hello ++ upper("world") ``` - Escape character (`\`): Parse Template uses the character sequence `#[` to identify where an expression begins. To avoid this behavior and treat that sequence as literal characters, escape it with `\`, for example, `#[` returns `#[`. In addition, expressions can contain strings with special characters that you want to treat as regular characters. To escape any special characters within a string that is embedded inside an expression, append `\` to the character. Examples of special characters include the sequence `#[`, quotations marks (`'` or `"`), apostrophes (`'`), and `$`. It is not necessary to escape `\#` or `[` unless they are adjacent to one another in the string, with the `\#` preceding the `[`. Parse Template Snippet: ```XML \#[ #['abcd\#[-1234' ++ now() as String ++ '.log'] 'abc'def' #['abc\'def'] "xyz"xyz" #["xyz\"xyz"] #["abc\$DEF\#ghi\[JKL]"] ``` Output Values: ```XML #[ abcd#[-12342020-07-06T17:20:10.683-07:00.log 'abc'def' abc'def "xyz"xyz" xyz"xyz abc$DEF#ghi[JKL] ``` For more information, see [Escape Special Characters](https://docs.mulesoft.com/dataweave/2.4/dataweave-language-introduction#escape-special-characters). --- product: Anypoint Code Builder version: master --- # Pass Runtime Properties and Arguments to Mule Applications > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Configure runtime behavior, secure sensitive data, and test different environments by passing properties and arguments to Mule applications running locally in Anypoint Code Builder. Use command-line properties to switch between development, sandbox, and production configurations, provide encryption keys for secure properties, and override default values without modifying application code. You can pass properties when running Mule applications locally through different methods. - [Global default arguments](#mule-settings-method): Apply the same arguments to all Mule applications - [Project-specific launch configurations](#launch-json-method): Configure arguments for individual projects or create multiple configurations with different settings ## Configure Global Default Arguments Configure arguments that apply to all Mule application runs in Anypoint Code Builder. Use this approach when you consistently need the same encryption key or environment setting across all projects during local development. To configure global default arguments: 1. Open Mule settings: 2. If an API specification is open in the Explorer panel, close the project to avoid a synchronization error when you switch clouds. - Click **File** > **Close Folder**. 3. Open the **Settings** panel: ![Selecting the EU cloud from Anypoint Code Builder](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-activity-bar-select-cloud.png) 4. Find the **Mule › Runtime: Default Arguments** setting. 5. In the **Runtime: Default Arguments** field, append your arguments using the `-M-D` prefix followed by the property name and value: ```text -M-Dencryption.key=myEncryptionKey123 ``` To add multiple arguments, separate them with spaces: ```text -M-Dencryption.key=myEncryptionKey123 -M-Denv=dev -M-Dhttp.port=8082 ``` 6. Run or debug your Mule application: 7. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. Select **View: Show Run and Debug**, then click **Run and Debug**. Mule Runtime engine receives the configured arguments each time you run any application. ### Understand Property Syntax The `-M-D` prefix passes system properties to the Java Virtual Machine (JVM) that runs Mule Runtime engine. These properties become available throughout your Mule application and can be referenced in configuration XML files. When configuring properties in the **Runtime: Default Arguments** field: - Use the `-M-D` prefix followed by the property name and value: `-M-Dname=value` - Separate multiple properties with spaces - Avoid quotes around values unless the value contains spaces - Property names are case-sensitive Common examples: ```text -M-Dencryption.key=mySecretKey -M-Denv=dev -M-Dhttp.port=8081 -M-Ddatabase.host=localhost -M-Dmule.env=development ``` ## Configure Project-Specific Launch Configurations Configure arguments for individual projects or create multiple run configurations with different settings for the same project. Use this approach when different projects require different configurations, or to test the same project with different property values. Launch configurations reside in the `.vscode/launch.json` file in your project directory and apply only to that project. ### Create or Modify a Launch Configuration To configure project-specific arguments: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Enter and select **Open 'launch.json'**. If the file doesn’t exist, VS Code creates it in the `.vscode` folder of your project. 3. In the `launch.json` file, locate or create a configuration object within the `configurations` array. 4. Add or modify the `mule.runtime.args` property to include your arguments: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug Mule Application", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=myKey -M-Denv=dev" } ] } ``` 5. Save the `launch.json` file. 6. Run or debug your application by selecting the configuration from the **Run and Debug** view. ### Test the Same Project with Different Property Values Create multiple launch configurations with different property values to test various environments without editing the configuration file each time. For conceptual information about creating and managing launch configurations, see [Running Multiple Mule Applications Concurrently](https://docs.mulesoft.com/anypoint-code-builder/int-run-multiple-mule-apps). The key difference when configuring properties is to vary the `mule.runtime.args` values for each configuration: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug - Development", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=dev -M-Dhttp.port=8081" }, { "type": "mule-xml-debugger", "request": "launch", "name": "Debug - Sandbox", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Denv=sandbox -M-Dhttp.port=8082" } ] } ``` Switch between configurations using the dropdown in the **Run and Debug** view. ### Use Environment Variables in Launch Configurations Reference environment variables defined on your system to avoid hardcoding sensitive values in `launch.json`: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Environment Variables", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=${env:ENCRYPTION_KEY} -M-Denv=${env:MULE_ENV}" } ] } ``` Reference environment variables using the `${env:VARIABLE_NAME}` syntax. The example configuration references `ENCRYPTION_KEY` and `MULE_ENV` from your system environment. ## Common Use Cases and Examples These examples demonstrate common scenarios for passing runtime properties and arguments, such as configuring HTTP listener ports and database connection parameters. For examples of passing encryption keys and switching between environment-specific property files, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ### Example: Set HTTP Listener Port Dynamically Set the HTTP listener port at runtime without modifying your configuration XML: Global default arguments: ```text -M-Dhttp.port=8082 ``` Launch configuration: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug on Port 8082", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dhttp.port=8082" } ] } ``` Reference the property in your HTTP listener configuration: ```xml ``` ### Example: Increase JVM Heap Size Increase the maximum JVM heap size when running memory-intensive Mule applications locally. Use the `-M-Xmx` flag to set the maximum heap and `-M-Xms` to set the initial heap. Global default arguments: ```text -M-Xms512m -M-Xmx2g ``` Launch configuration: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Increased Heap", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Xms512m -M-Xmx2g" } ] } ``` You can combine heap size flags with other arguments, such as environment properties or encryption keys: ```text -M-Xmx2g -M-Denv=dev -M-Dencryption.key=myKey ``` ### Example: Provide Database Connection Parameters Provide database connection parameters at runtime to switch between local and remote databases: Global default arguments: ```text -M-Ddb.host=localhost -M-Ddb.port=3306 -M-Ddb.name=mydb ``` Launch configurations for different databases: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Local Database", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Ddb.host=localhost -M-Ddb.port=3306 -M-Ddb.name=mydb" }, { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Remote Database", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Ddb.host=remote-db.example.com -M-Ddb.port=3306 -M-Ddb.name=proddb" } ] } ``` Reference these properties in your database configuration: ```xml ``` ## Configure Shared Encryption Keys Across a Workspace When you have multiple Mule projects in the same workspace that use the same encryption key, configure it once at the workspace level instead of duplicating it in each project’s launch.json. Use the approach that better applies to your workflow and security requirements. - [Workspace Settings](#workspace-settings-approach): Configure the encryption key in your workspace settings.json. All projects inherit the setting automatically. - [Environment Variable](#environment-variable-approach): Store the key as an OS environment variable in your shell profile. Use this method to keep encryption keys completely out of version-controlled files or if you need machine-specific configuration. - [Multi-Root Workspace](#multi-root-workspace-approach): Configure the encryption key directly in a .code-workspace file. Use this approach when working with multiple Mule projects open simultaneously in a multi-root workspace. ### Use Workspace Settings Add the encryption key to your workspace `settings.json` so all projects inherit it. 1. In your `.code-workspace` file or `.vscode/settings.json` at the workspace root, add the key. ```json { "settings": { "mule.runtime.defaultArguments": "-M-Dencryption.key=MuleSecureKey024" } } ``` 2. Reference the shared setting in each project’s `launch.json`. ```json { "mule.runtime.args": "${config:mule.runtime.defaultArguments}" } ``` ### Use an Environment Variable Set the key as an OS environment variable in your shell profile (`~/.zshrc` or `~/.bash_profile`) 1. Run this command. ```bash export MULE_ENCRYPTION_KEY="MuleSecureKey024" ``` 2. Reference the key in the workspace `launch.json`: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug with Environment Variable", "mule.project": "${workspaceFolder}", "mule.home": "${config:mule.homeDirectory}", "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=${env:MULE_ENCRYPTION_KEY}" } ] } ``` ### Use a Shared Launch Configuration in Multi-Root Workspaces To configure a shared encryption key in a multi-root workspace: 1. Open or create your `.code-workspace` file. 2. Add a `launch` section to the workspace configuration with the encryption key: ```json { "folders": [ (1) { "path": "salesforce-sync" }, { "path": "netsuite-integration" }, { "path": "slack-notifications" } ], "launch": { (2) "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Run Mule App (Shared Key)", (3) "noDebug": true, "mule.projects": ["${workspaceFolder}"], "mule.runtime.args": "${config:mule.runtime.defaultArguments} -M-Dencryption.key=MuleSecureKey024" (4) } ] } } ```
1List the relative paths to each Mule project in your workspace
2Add the launch configuration section with the shared encryption key
3Name that appears in the Run and Debug dropdown
4Replace MuleSecureKey024 with your encryption key
3. Save the workspace file. When you select **Run Mule App (Shared Key)** from the Run and Debug dropdown, Code Builder applies the shared encryption key to whichever project is active. ### Protect Workspace Configuration in .gitignore If your workspace settings contain sensitive values, add them to `.gitignore`: ```gitignore # Workspace config (may contain encryption key) *.code-workspace .vscode/settings.json ``` ### Re-encrypt All Projects After Key Rotation When you rotate the shared key, re-encrypt every secure properties file across all projects: ```bash NEW_KEY="NewSharedKey2025!" # For each project in the workspace: for project in salesforce-sync netsuite-integration slack-notifications; do FILE="$project/src/main/resources/prod.secure.properties" if [ -f "$FILE" ]; then echo "Re-encrypting: $FILE" # Decrypt each value with old key, re-encrypt with new key # (or use a local backup file with plaintext to re-encrypt) fi done ``` Then update the single workspace-level key reference and all projects work immediately. ## See Also - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Running Multiple Mule Applications Concurrently](https://docs.mulesoft.com/anypoint-code-builder/int-run-multiple-mule-apps) - [Launch Configuration Properties Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-launch-json-properties) - [Mule › Runtime: Default Arguments](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-mule-args) - [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements) - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Configuring Properties](https://docs.mulesoft.com/mule-runtime/latest/configuring-properties) --- product: Anypoint Code Builder version: master --- # Project Loading Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Errors sometimes occur when you open or start a project in Anypoint Code Builder. ## Loading Error in the Canvas A **Loading…​** error in the graphical UI (canvas) often occurs under these conditions: - When importing a project due to a missing dependency To check for a missing dependency: 1. Open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 2. Select Mule DX Server from the dropdown list. 3. Search for an error caused by the missing dependency, similar to this one: Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.mule.examples:accelerator-common-config-module:jar:mule-plugin:1.1.0 in https://repo.maven.apache.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 4. If you find a missing dependency, log in to Anypoint Platform. The canvas loads after all dependencies load. When a browser extension is interfering with the UI loading process, you see: ![Loading error in the UI](/mulesoft/current/en-us/anypoint-code-builder/_images/troubleshoot-loading-error.png) To address this issue, try: - Disabling browser extensions and reloading the application - Using another browser that is not using extensions - Clearing your browser’s cache and cookies, then reloading the application - Opening Anypoint Code Builder in an incognito or private browsing window ## UI Canvas Renders Without Configured Flows or Subflows If the UI for an application that is already configured with a flow or subflow treats your application as a new project, prompting you with the question **How do you want to start building your project?** and **Build a flow** and **Build a sub flow** creation options, make sure that your application is open from its _root_ directory or from a multi-root workspace. ![Start Screen Building a Mule Application](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-start-flow-subflow-ui.png) Visual Studio Code treats an open directory as a workspace. For the project to load into a workspace, the root directory of the project must be the top-level directory in the Explorer view, or the project must belong to a [multi-root workspace](https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces). 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command File: Open Folder... ``` 3. Navigate to the _root_ directory for your project. The root is the top-level folder that Anypoint Code Builder generates when it creates a project. Do not navigate to the project’s parent or ancestor directory or to one of its child or descendant directories. See also [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project) and [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). ## Mule DX API Component Was Not Installed The error indicates that some Anypoint Code Builder dependencies have not finished loading. This issue typically occurs when you click **Design an API** and is often accompanied by the notification **Extracting Mule runtime: This operation may take a while…​**. The extraction process can take several minutes, particularly after you install or update Anypoint Extension Pack. 1. Wait for the error **Mule DX API Component was not installed** to disappear. 2. Retry your action. To monitor the progress of backend processes: 1. Open the Output panel. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+u - Windows: Ctrl+Shift+u - Select **View** > **Output**. 2. Select **Mule DX Server** from the dropdown list in the panel. To see scaffolding errors only, select **Mule DX Server: Scaffolding** from the list. ## Dependency Resolution Error The error `There was an issue solving the dependencies for the asset` occurs when a dependency is missing. Usually, the appears after you import or open an integration or implementation project that is missing one or more dependencies for a connector operation. To address this issue and avoid other errors, try logging in to Anypoint Platform, and wait for the project to finish loading before attempting to resolve any missing dependencies that remain. ## Slow Project Load Times If your project takes more than a few seconds to load on the canvas, check for: - A large number of configuration files in `src/main/mule/` - Oversized DataWeave scripts written inline in the XML instead of in external `.dwl` files - Excessive or unused dependencies in the `pom.xml` file Reducing any of these can improve how quickly the canvas loads and responds. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Publishing API Projects to Exchange > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Publish your API project to Anypoint Exchange so that other team members can find and use it. ## Before You Begin Before publishing an API project: - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Create your API specification](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) or [fragment](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments). - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API spec to Exchange, Anypoint Code Builder requests the name of the business group. ## Publish an API Project to Exchange To publish your API project to Exchange: 1. Log in to your Anypoint Platform account. 2. In **Explorer**, open your API project and click the Publish API Project to Exchange icon. ![Publish API Project to Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-publish-to-exchange.png) If you don’t open the project, you can also right-click the API specification and select **Publish API Project to Exchange**. Alternatively: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Enter `publish` and select the following command: ```command MuleSoft: Publish API Project to Exchange ``` 3. If prompted, click **Allow**, and follow the prompts to sign in to Anypoint Platform. 4. Confirm or change each item in **Publish API Project to Exchange**: - **Asset Version** - **API Version** If the API project has never been published to Exchange, the default version is `1.0.0`. The API version isn’t required for API fragments. - **Business Group** If you selected a business group when you created the API project, this field isn’t shown in the form. You can view and update the business by expanding **Project Metadata**. 5. Optionally, expand **Project Metadata** and click **API Project Properties** to update metadata for the API project, such as updating the asset name and ID and adding tags and categories, updating the business group, and so on. For more information, see [Add Metadata to the API Project](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center#add-metadata). 1. After you complete your updates, click **Apply**. 6. In the banner click **Sync centralized governance rulesets and run validation** to ensure the API project conforms to the applied rulesets. This step is optional, but it’s recommended as a best practice. You must be logged in to your Anypoint Platform account and have a business group defined in the API project metadata to validate rulesets. ![Publish API Project to Exchange form with banner to sync centralized rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/des-publish-api-project.png) 7. Click **Publish**. When publishing is complete, you see a message that the API specification successfully published to Exchange. If the API project has errors, you must fix the errors before you can publish to Exchange. Errors are listed in the **Problems** tab. Click the Publish API Project to Exchange icon to bring the **Problems** tab into focus. 8. Click **View Asset** to see the published asset in Exchange. 9. When prompted to implement the API, select one of the following: - **No** to avoid scaffolding the API specification into your integration. - **Yes** to scaffold the API specification into a new project. Show me how 1. In the field that opens, provide a name for your implementation project. 2. Navigate to a directory for your project, and click **Select target folder**. 3. Select a Mule runtime (Mule) version for your project. 4. Select a supported Java version for Mule. 5. After the scaffolding process completes, view the scaffolded interface for your project from the `src/main/mule` directory in the Explorer. If the scaffold fails, see [Implementation Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-implementation-errors). You can also open your new project’s `mule-artifact.json` file from the Explorer to check the Mule and Java versions, for example: ```XML { "minMuleVersion": "4.6.2", "javaSpecificationVersions": [ "11" ] } ``` The `mule-artifact.json` file is located at the root level of the project directory. ## Locate Your API in Exchange After publishing your API specification, you can find it in Anypoint Exchange: 1. Navigate to Anypoint Platform and log in using your credentials. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) 2. Navigate to Anypoint Exchange. Show me how - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) Your API specification appears as an asset in your organization, for example: ![API specification in Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/des-api-exchange.png) You can select the API, navigate through its summary, and see all the endpoints you defined in the previous tasks. You can also generate documentation for REST APIs without documentation on the asset details page in Exchange. For more information, see [Generating API Documentation with Einstein Generative AI](https://docs.mulesoft.com/exchange/generating-documentation-with-ai). ## Publish a GraphQL API Spec to Exchange To publish a GraphQL API specification to Exchange: 1. Navigate to Anypoint Platform and log in using your credentials. Show me how - US cloud (non-EU host): [Anypoint Platform (US)](https://anypoint.mulesoft.com/login/) - EU cloud (EU host): [Anypoint Platform (EU)](https://eu1.anypoint.mulesoft.com/login/) 2. Navigate to Anypoint Exchange. Show me how - US cloud (non-EU host): [Exchange (US)](https://anypoint.mulesoft.com/exchange/) - EU cloud (EU host): [Exchange (EU)](https://eu1.anypoint.mulesoft.com/exchange/) 3. Click **Publish new asset**: ![Publish new asset button in Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/des-publish-asset-exchange.png) 4. Complete the **Publish a new asset** form: ![Publish a new asset form on Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/des-graphql-publish-exchange.png) 1. For **Name**, type a name for your asset. 2. For **Asset types**, select **GraphQL API**. 3. For **Method**, select **Upload a GraphQL API Schema**. 4. For **File upload**, click **Choose file** and browse for your `.graphql` schema file. 5. Click **Advanced** to change the version number. 6. For **Lifecycle state**, select **Stable**. 5. Click **Publish**. Your GraphQL API spec is now available on Exchange, for example: !["GraphQL API spec on Exchange](/mulesoft/current/en-us/anypoint-code-builder/_images/des-graphql-asset-exchange.png) ## See Also - [Publishing Your gRPC API to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-grpc-api-to-exchange) - [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api) - [Enabling an API Project for Topics and Agent Actions](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center) --- product: Anypoint Code Builder version: master --- # Publishing Your gRPC API to Exchange > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Publish your gRPC API specification or Protobuf library (fragment) to Anypoint Exchange so that other team members can discover, reuse, and implement it. In Exchange, published gRPC API projects appear as assets of type **gRPC API**. Published Protobuf libraries (reusable fragments) appear as assets of type **API Fragment**. ## Before You Begin - [Design a gRPC API specification](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec) in Anypoint Code Builder, or create a Protobuf library project for reusable types and services. - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Have some familiarity with [business groups](https://docs.mulesoft.com/access-management/business-groups). When you publish your API spec to Exchange, Anypoint Code Builder requests the name of the business group. ## Publish a gRPC API Project to Exchange To publish your gRPC API project (or Protobuf library project) to Exchange: 1. Log in to your Anypoint Platform account. 2. In **Explorer**, open your gRPC API project and click the **Publish API Project to Exchange** icon. ![Publish API Project to Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-publish-to-exchange.png) You can also right-click the API project in Explorer and select **API** > **Publish API Project to Exchange**. Alternatively, open the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette) and run: ```command MuleSoft: Publish API Project to Exchange ``` 3. If prompted, click **Allow** and follow the prompts to sign in to Anypoint Platform. 4. Confirm or change each item in **Publish API Project to Exchange**: - **Asset Version** – For example, `1.0.0` for a first publish. - **API Version** – Optional for API fragments (Protobuf libraries). - **Business Group** – The business group where the asset is published. 5. Optionally, expand **Project Metadata** and update asset name, tags, categories, or other metadata. Click **Apply** after making changes. 6. Optionally, in the banner click **Sync centralized governance rulesets and run validation** to validate the project against applied rulesets. You must be logged in and have a business group defined in the project metadata. ![Publish API Project to Exchange form with banner to sync centralized rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/des-publish-api-project.png) 7. Click **Publish**. Anypoint Code Builder builds the project and publishes the asset to Exchange. When publishing is complete, you see a message that the API specification (or fragment) successfully published to Exchange. If the project has validation or build errors, fix them before publishing. Check the **Problems** tab and the [output panel](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel) for details. 8. Click **View Asset** to open the published asset in Exchange. 9. When prompted to implement the API, choose **Yes** to scaffold the gRPC specification into a new project, or **No** to skip. See [Implementing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-grpc-api-spec) for implementing a gRPC API spec. ## Locate Your gRPC API in Exchange After publishing, find your gRPC API or Protobuf library in Anypoint Exchange: 1. Log in to Anypoint Platform and open Anypoint Exchange (see [Locate Your API in Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange#locate-api) for links). 2. Search or browse for the asset by name. gRPC API projects appear as assets of type **gRPC API**. Protobuf library projects appear under the appropriate fragment type. Other developers can discover the asset, add it as a dependency for implementation, or import it as a Protobuf library into their gRPC API design projects. ## See Also - [Designing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/des-design-grpc-api-spec) - [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) - [Implementing a gRPC API Specification with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-grpc-api-spec) - [Validating API Specifications Against Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/des-govern-api) - [Anypoint Platform Business Groups](https://docs.mulesoft.com/access-management/business-groups) --- product: Anypoint Code Builder version: master --- # Raise Error () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Generates a Mule error to indicate that a failure occurred. You can customize the error’s description and type. Use this component to raise: - Core runtime errors, such as `MULE:SECURITY` and `MULE:CONNECTIVITY`. - Custom error types. You cannot raise an error from another connector or module, such as `FILE:FILE_NOT_FOUND` or `JSON:INVALID_SCHEMA`. You cannot use a connector’s existing namespace. ## Component XML This component supports the following XML structure: ```xml ``` Raise Error (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Raise error (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Type

type

The type of error.

Description

description

The error description.

## Examples ### Example: Raising an Error After an Invalid User Input The following example of a driving lessons platform checks that the user is over 16 years old. The flow raises a custom `PRECONDITIONS:INCORRECT_AGE` error when the user enters an age less than 16 years. ```xml (1) (2) (3) (4) (5) ```
1The Choice router components adds conditional processing to the flow.
2If the age parameter sent in the request is less than 16 (http://localhost:8081/test?age=15), the Raise Error component raises the error type PRECONDITIONS:INCORRECT_AGE with the description Minimum age of 16 required to drive.
3If the age parameter is greater than 16 in the request (http://localhost:8081/test?age=17), a Logger component returns the default message User age above 16 years. Allowed to drive.
4An On-Error Continue component matches the type of the error PRECONDITIONS:INCORRECT_AGE and executes the Logger component inside its scope. The Logger component logs the error message Minimum age of 16 required to drive.
5If no age parameter is passed in the request (http://localhost:8081/test) the choice component automatically raises a MULE:EXPRESSION error when trying to evaluate the expression #[message.attributes.queryParams.age < 16]. No age parameter was provided in the request, so its value is null.

Then, an On-Error Continue component matches the type of the error MULE:EXPRESSION and executes the Logger component inside its scope. The Logger component returns the message The parameter age is missing or invalid.

### Example: Raising an Error After Comparing Values The following example makes a request to an API (https://unsecurebank.com/balance) and stores the returned account balance in the _balance_ variable, then compares the variable with `payload.amount` to determine if the operation is possible. The Choice router produces an `ACCOUNT:INSUFFICIENT_FUNDS` error when a transfer amount surpasses the available balance, preventing the transfer from taking place. The description dynamically provides failure details. ```xml ``` ## See Also - [Mule Errors](https://docs.mulesoft.com/mule-runtime/latest/mule-error-concept) - [Error Handler ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-error-handler) --- product: Anypoint Code Builder version: master --- # Remove Variable () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Removes a Mule variable from a Mule event. ## Component XML This component supports the following XML structure: ```xml ``` Remove Variable (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Remove variable (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Variable name

variableName

Name of the Mule variable to remove.

## Examples The following example shows how to remove a Mule variable from the flow: ```xml (1) (2) (3) (4) (5) (6) ```
1The Scheduler component triggers the flow.
2Set Variable creates a Mule variable (myMuleVar).
3The first Logger in the flow prints the value of the variable ("value of my Mule variable").
4Remove Variable provides a string with the name of the variable (variableName="myMuleVar") to remove the variable from the Mule event.
5The second Logger prints null because the Mule variable no longer exists.
6The second Remove Variable logs a WARN message because it attempts to remove a Mule variable (banana) that does not exist in the Mule event.
The following example shows the logs for an execution of this flow: ```logs INFO 2022-12-15 08:33:20,151 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97] PRINT VALUE OF VARIABLE: "value of my Mule variable" INFO 2022-12-15 08:33:20,155 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97] ATTEMPT TO PRINT VALUE OF REMOVED VARIABLE: null WARN 2022-12-15 08:33:20,156 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97] ...RemoveFlowVariableProcessor: There is no variable named 'banana'. Check the 'variableName' parameter in the 'remove-variable' component at remove-variable-ex/processors/4 ``` ## See Also - [Variables in Mule Events](https://docs.mulesoft.com/mule-runtime/latest/about-mule-variables) - [Enrich Data with Target Variables](https://docs.mulesoft.com/mule-runtime/latest/target-variables) --- product: Anypoint Code Builder version: master --- # Round Robin () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Provide two or more processing routes, and execute only one of the routes each time the flow executes the component. Each route within Round Robin is a scope that can contain one or more processors. Starting with the first route, Round Robin initiates execution of processors within the route over a Mule event and sends the results to the next processor in the flow. Round Robin keeps track of the previously selected route and never selects the same route consecutively. For example, the first time Round Robin executes, the component selects the first route. The next time, it selects the second route. If the previously selected route is the last route, Round Robin executes the first route. The payload, variables, and attributes from the Mule event that reaches Round Robin are accessible for processing within the route. Any changes to the Mule event within a route propagate to the processor after Round Robin. ## Component XML This component supports the following XML structure: ```xml ``` Round Robin (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Round robin (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

N/A

tracking:enable-default-events

When set to true, activates the Business Events feature.

`` is a child element of Round Robin.
Child ElementDescription

<route/>

Accepts one or more components as child elements for processing the Mule event. Multiple <route/> configurations are allowed.

## Example The following example configures Round Robin with two processing routes: ```xml (1) (2) (3) (4) (5) (6) ```
1Scheduler (<scheduler/>) executes the flow every 10 seconds.
2Set Payload (<set-payload/>) provides the array [1,2,3,4].
3The Logger component before Round Robin prints the initial payload, [1,2,3,4].
4In the first route (<route/>) of Round Robin, a Set Payload component uses the DataWeave expression payload - 4 to remove the last element of the initial payload, and the Logger in that route prints the resulting payload as the value of key "r1", { "r1": [1,2,3] }.
5In the second route (<route/>) of Round Robin, a Set Payload component uses the DataWeave expression payload + 5 to append a new element to the initial payload, and the Logger in that route prints the resulting payload as the value of key "r2", { "r2": [1,2,3,4,5] }.
6The Logger component after Round Robin prints the payload of the route processed by an execution of Round Robin. The first execution prints [1, 2, 3]. The next execution prints [1, 2, 3, 4, 5]. The next prints [1, 2, 3], and so on.
In the following excerpt, the logs show three executions of the Round Robin router. In this example, the flow processes Mule events with IDs that begin `4df56260`, `53eb1c50`, and `59e12460`. (The example is edited for readability.) ... INFO 2022-12-19 10:02:30,233 ...event: 4df56260-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD BEFORE ROUND ROBIN: \[1, 2, 3, 4\] INFO 2022-12-19 10:02:30,290 ...event: 4df56260-7fc7-11ed-957f-147ddaaf4f97\] ROUTE 1 PAYLOAD: { "r1": \[1,2,3\] } INFO 2022-12-19 10:02:30,291 ...event: 4df56260-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD OUTSIDE ROUND ROBIN: \[1, 2, 3\] INFO 2022-12-19 10:02:40,154 ...event: 53eb1c50-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD BEFORE ROUND ROBIN: \[1, 2, 3, 4\] INFO 2022-12-19 10:02:40,167 ...event: 53eb1c50-7fc7-11ed-957f-147ddaaf4f97\] ROUTE 2 PAYLOAD: { "r2": \[1, 2, 3, 4, 5\] } INFO 2022-12-19 10:02:40,168 ...event: 53eb1c50-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD OUTSIDE ROUND ROBIN: \[1, 2, 3, 4, 5\] INFO 2022-12-19 10:02:50,151 ...event: 59e12460-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD BEFORE ROUND ROBIN: \[1, 2, 3, 4\] INFO 2022-12-19 10:02:50,154 ...event: 59e12460-7fc7-11ed-957f-147ddaaf4f97\] ROUTE 1 PAYLOAD: { "r1": \[1, 2, 3\] } INFO 2022-12-19 10:02:50,154 ...event: 59e12460-7fc7-11ed-957f-147ddaaf4f97\] PAYLOAD OUTSIDE ROUND ROBIN: \[1, 2, 3\] ... --- product: Anypoint Code Builder version: master --- # Running Multiple Local Integration Projects with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Run multiple integration projects locally in one runtime to validate service-to-service behavior before deployment. Use MuleSoft Vibes to create a reusable run configuration automatically, start related projects together, and test end-to-end behavior. Update and reuse the same configuration as your local integration scope changes. When an integration depends on multiple local Mule projects, starting each project manually can slow down validation and increase setup errors. MuleSoft Vibes can create a run configuration from your prompt and execute all selected projects together in the same local runtime instance. When MuleSoft Vibes creates a multi-project configuration, it uses the default runtime arguments defined in Anypoint Code Builder settings ([Mule > Runtime: Default Arguments](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-mule-args)) to keep the configuration simple. You can override these defaults by adding `mule.runtime.args` directly to the launch configuration. ## Before You Begin - [Work in a multi-root workspace](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) that contains the related Mule projects. - [Set up MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) and confirm you have required permissions. - Verify that each project can run locally in your environment. ## Run Related Projects Together Locally Use MuleSoft Vibes to create and run a reusable local run configuration for the projects that participate in your flow. 1. Open MuleSoft Vibes. 2. Enter a prompt that identifies the projects to run together. Example prompts: - `Create and run a local configuration for main-project, project-one, and project-two.` - `Run all projects in this workspace.` - `Run all my projects in debug mode.` 3. Review the plan if you are working in Plan mode, and then run the task. 4. Wait for MuleSoft Vibes to create the run configuration and start the selected projects. 5. Confirm that the projects are running in the same local runtime instance. ## Run Saved Configurations from Anypoint Code Builder After MuleSoft Vibes creates a multi-project configuration, you can reuse it through standard execution paths. 1. Open the **Run and Debug** panel. 2. Select the saved multi-project configuration from the launch configuration list. 3. Run it from the launch menu. You can also run the same saved configuration from the Command Palette with `MuleSoft: Run Multi-Project Configuration`. ## Create and Update Configurations for Debugging You can create or update multi-project configurations for either run mode or debug mode. 1. Ask MuleSoft Vibes to run your projects in debug mode when you need to inspect flow execution. 2. If needed, update an existing configuration to change the execution mode. Example prompts: - `Run all my projects in debug mode.` - `Change my configuration to debug mode.` ## Verify End-to-End Integration Behavior After MuleSoft Vibes starts the projects, validate the integration behavior from the entry-point project. 1. Call an endpoint in your main project. 2. Confirm that downstream project responses are returned as expected. 3. Verify that the final response includes the combined or orchestrated output for your flow. ## Update and Reuse a Saved Configuration When your integration scenario changes, ask MuleSoft Vibes to update the existing configuration instead of recreating setup steps manually. 1. In MuleSoft Vibes, request an update to the saved configuration. Example prompts: - `Update my local run configuration to include only project-one and project-two.` - `Rename this local run configuration to project-one-two flow validation.` - `Change my configuration to debug mode.` 2. Run the saved configuration again for the next validation cycle. 3. Repeat updates as your project set changes. ## Set Explicit Mule and JDK Versions By default, a multi-project configuration uses the latest compatible Mule runtime and JDK versions that are available locally for execution. If your validation requires exact versions, edit the generated launch configuration in your `.code-workspace` file and specify them explicitly. 1. Open your `.code-workspace` file. 2. Locate the generated multi-project launch configuration. 3. Add explicit values for `mule.runtime.version` and `mule.jdk.version`. For example: ```json { "type": "mule-xml-debugger", "request": "launch", "name": "Run All 3 Projects (Explicit Versions)", "noDebug": true, "mule.projects": [ "${workspaceFolder:test-run-config}", "${workspaceFolder:test-project1}", "${workspaceFolder:test-project2}" ], "mule.runtime.version": "4.8.2", "mule.jdk.version": "17" } ``` ## Multi-Project Configuration Fields Reference When MuleSoft Vibes generates a multi-project launch configuration in your `.code-workspace` file, it includes fields that control execution mode and runtime behavior. Understanding these fields lets you update configurations without re-creating them from scratch. ### Execution Mode The `noDebug` field controls whether the configuration runs in run mode or debug mode: - `noDebug: true` — starts all projects without attaching the debugger (run mode). - `noDebug: false` or omitted — attaches the debugger to all projects (debug mode). ```json { "type": "mule-xml-debugger", "request": "launch", "name": "Run All Projects", "noDebug": true, (1) "mule.projects": [ "${workspaceFolder:main-project}", "${workspaceFolder:project-one}" ] } ```
1Set to false or remove this field to switch to debug mode.
To switch modes, ask MuleSoft Vibes to update the configuration, or edit `noDebug` directly in your `.code-workspace` file. ### Runtime Arguments MuleSoft Vibes doesn’t include runtime arguments in the generated launch configuration to keep the setup simple. By default, configurations inherit the arguments from the `Mule > Runtime: Default Arguments` setting in Anypoint Code Builder. To customize runtime arguments for a specific configuration, add the `mule.runtime.args` field directly to the launch configuration in your `.code-workspace` file: ```json { "type": "mule-xml-debugger", "request": "launch", "name": "Run Multiple Projects", "noDebug": true, "mule.projects": [ "${workspaceFolder:test-run-config}", "${workspaceFolder:test-project2}", "${workspaceFolder:test-project1}" ], "mule.runtime.args": "-M-Dmule.testingMode -M-XX:+UseStringDeduplication" (1) } ```
1All projects in the configuration use the same runtime arguments.
Alternatively, update the global default: 1. Open **Settings**. 2. Search for `Mule > Runtime: Default Arguments`. 3. Add or update your arguments, for example `-M-Dencryption.key=my-key` or `-M-Denv=dev`. For common runtime argument use cases, see [Mule › Runtime: Default Arguments](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-mule-args) and [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ### Edit a Generated Configuration
To changeDo this

Execution mode (run or debug)

Edit noDebug in the .code-workspace file, or ask MuleSoft Vibes to update the configuration.

Runtime arguments

Add mule.runtime.args to the launch configuration in your .code-workspace file, or update Mule > Runtime: Default Arguments in Settings.

Mule runtime or JDK version

Edit mule.runtime.version or mule.jdk.version in the .code-workspace file. See Set Explicit Mule and JDK Versions.

Projects included in the run

Ask MuleSoft Vibes to update the configuration, or edit mule.projects directly in the .code-workspace file.

## See Also - [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) - [Version Settings for Mule, Java, and Connectors](https://docs.mulesoft.com/anypoint-code-builder/int-versions) - [MuleSoft Settings](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings) - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). --- product: Anypoint Code Builder version: master --- # Running Multiple Mule Applications Concurrently > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Run multiple Mule applications concurrently in the same local runtime instance by creating a custom run or debug configuration in your workspace. Use this approach to test service-to-service interaction and verify end-to-end integration behavior without deploying to remote environments. To run related projects together, configure a workspace-level launch configuration that includes all target projects. After you create the configuration, you can reuse it for both run and debug sessions. To create run configurations for multiple projects using MuleSoft Vibes, see [Running Multiple Local Integration Projects with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-run-multiple-integration-projects-locally). ## Before You Begin - [Create a multi-root workspace](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) that contains all the Mule projects you want to run concurrently. - Open the configuration XML files for each project to verify there are no port conflicts between the projects. For example, if two projects both use port `8081` for an HTTP Listener, change one project to use a different port such as `8082`. ## Create a Run Configuration for Multiple Projects To create a workspace-level run configuration: 1. Open the configuration XML files for the projects you want to run. This step ensures the projects are loaded and available in the workspace. 2. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 3. In the **Run and Debug** panel, open the launch configuration dropdown and select **Add Config (workspace)**. If you don’t see this option, ensure all projects are in the same workspace and the workspace is open. 4. Select **Mule XML Debugger** from the list of available debuggers. Anypoint Code Builder creates a new launch configuration entry in your `.code-workspace` file and opens it for editing. 5. In the configuration editor, update the `name` field for the **Run** configuration to describe the set of projects you are running. 6. Update the `mule.projects` field to include all project folders you want to run concurrently. Use this format `"${workspaceFolder:project1FolderName}", "${workspaceFolder:project2FolderName}"` Replace `project1FolderName` and `project2FolderName` with the actual folder names of your projects. Add additional project folders separated by commas as needed. 7. Copy the `mule.projects` values and paste them into the `mule.projects` field inside the **Debug** configuration. This step ensures the same projects are available when you run in debug mode. Example configuration: ```json "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Run Multiple Applications", "noDebug": true, "mule.projects": [ "${workspaceFolder:first-project}", "${workspaceFolder:second-project}" ], "mule.runtime.args": "${config:mule.runtime.defaultArguments}" }, { "type": "mule-xml-debugger", "request": "launch", "name": "Debug Multiple Applications", "mule.projects": [ "${workspaceFolder:first-project}", "${workspaceFolder:second-project}" ], "mule.runtime.args": "${config:mule.runtime.defaultArguments}" } ] ``` 8. Save the `.code-workspace` file. The new configuration now appears in the launch configuration dropdown in the **Run and Debug** panel. ## Run the Configuration After you create the configuration, run it to start all included projects in the same local runtime instance: 1. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 2. In the launch configuration dropdown, select the run configuration you created. 3. Click **Start Debugging** (F5) or **Run Without Debugging** (Ctrl+F5 on Windows, Cmd+F5 on Mac). Anypoint Code Builder packages and deploys all projects to the embedded Mule runtime engine. The integrated terminal shows Maven and deployment progress for each project, and the status bar indicates that the applications are running. ## Update an Existing Configuration To modify which projects run in the configuration: 1. Open your `.code-workspace` file. 2. Locate the launch configuration by name. 3. Update the `mule.projects` array to add, remove, or reorder projects. 4. Save the file. The updated configuration is immediately available in the **Run and Debug** panel. ## See Also - [Pass Runtime Properties and Arguments to Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-run-mule-apps-with-properties) - [Launch Configuration Properties Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-launch-json-properties) - [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces) - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) - [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) --- product: Anypoint Code Builder version: master --- # Scatter-Gather () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Process a Mule event through two or more routes, and combine the results into a single event object. ## Component XML This component supports the following XML structure: ```xml ``` Scatter Gather (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Scatter gather (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Timeout

timeout

Sets the timeout for responses from sent messages, in milliseconds. A value of 0 or less than 0 prevents a timeout. Defaults to 0.

Max concurrency

maxConcurrency

Sets the maximum number of routes to run concurrently.

By default, all routes run in parallel. Setting this value to 1 makes the component process the routes sequentially.

Collect list

N/A

N/A

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. The default value is #[payload].

See Enrich Data with Target Variables in the Mule documentation.

`` is a child element of Scatter Gather.
Child ElementDescription

<route/>

Accepts one or more components as child elements for processing the Mule event. Multiple <route/> configurations are allowed.

## Error Handling This component can throw the following errors: - `MULE:ROUTING` - `MULE:COMPOSITE_ROUTING` If you configure a timeout for this component and a route does not complete processing before the timeout expires, the route throws a `MULE:TIMEOUT` error. Mule handles this error as it handls other errors generated from a route: After each route completes (either by processing successfully or by throwing a `MULE:TIMEOUT` error), the successful results and errors are collected into the `MULE:COMPOSITE_ROUTING` error and then processed within a configured error handler component. ## See Also - [Core Components](https://docs.mulesoft.com/mule-runtime/latest/about-components) - [How Transactions Affect Scopes and Routers](https://docs.mulesoft.com/mule-runtime/latest/transaction-management#tx_scopes_routers) - [Error Handlers](https://docs.mulesoft.com/mule-runtime/latest/error-handling) - [Try Scope](https://docs.mulesoft.com/mule-runtime/latest/try-scope-concept) - [Mule Event Structure](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event) --- product: Anypoint Code Builder version: master --- # Scheduler () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Trigger execution of a flow based on a time-based condition. For example, a Scheduler might create and send a message that will trigger the flow processing every 5 seconds or every day at 12:00 in a given time zone. The Scheduler sets a scheduling strategy at a fixed frequency or an interval based on a cron expression. When adding a Scheduler to your Mule application, consider these points: - Schedulers use the same timezone as the machine on which Mule is running. However, if an application is running in CloudHub, the Scheduler conforms to the UTC timezone, regardless of the geographic region in which the application is running. To set a different time zone for the Scheduler, see `timeZone` in the [cron scheduling strategy attributes](#cron-attributes). - The `disallowConcurrentExecution` property enables you to prevent the Scheduler from triggering the execution of the flow while a previously-triggered execution is running. - If [back-pressure](https://docs.mulesoft.com/mule-runtime/latest/execution-engine#backpressure) occurs because no resources are available at the time of the scheduled trigger, Mule skips that execution. - In a Mule runtime engine cluster or multi-worker CloudHub deployment, the Scheduler executes only on the primary node (that is, only in one Mule instance). ## Component XML This component supports the following XML structure: ```xml ``` Scheduler (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Scheduler (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Disallow concurrent execution

disallowConcurrentExecution

When this attribute is set to true, the Scheduler skips its scheduled execution if a previous execution is still running. Once the flow finishes, the Scheduler executes at the next configured interval. The default value is false.

**Scheduling strategy** (``) is a child element of Scheduler.
Child ElementDescription

<scheduling-strategy/>

Accepts a <fixed-frequency/> or <cron/> configuration.

### Fixed Frequency Attributes Scheduler accepts a fixed frequency (``) element that accepts these attributes:
Attribute NameAttribute XMLDescription

N/A

frequency

The frequency at which the Scheduler triggers the flow given the timeUnit setting. Defaults to 1000.

N/A

startDelay

The amount of time to delay execution of the Scheduler for the first time after the application starts. This property uses the same timeUnit as the frequency. Defaults to 0.

N/A

timeUnit

One of the following time units for the values of frequency and startDelay: MILLISECONDS, SECONDS, MINUTES, HOURS, or DAYS. Defaults to MILLISECONDS.

See the [fixed frequency examples](#example1). ### Cron Attributes For more complex scheduling, configure a cron expression in the `` element.
Attribute NameAttribute XMLDescription

N/A

expression

A cron expression for triggering the Scheduler. There is no default cron expression. For guidance with expressions, see Cron Expressions. Example: expression="1 1 1 1,7 * ?".

N/A

timeZone

Time zone passed as a system property, or in a machine’s operating system. Java time zone values are supported. Avoid Java abbreviations, such as PST and AGT, and instead use the full-name Java equivalents, such as America/Los_Angeles. Example: timeZone="America/Argentina/Buenos_Aires".

See the [cron examples](#example2). ## Examples ### Fixed Frequency Examples In the following example, the Scheduler executes every fifteen seconds: ```xml ``` In the following example, the Scheduler skips its execution if the flow takes longer to complete than the fixed frequency of 10 milliseconds: ```xml ``` Each time a Scheduler skips its execution, Mule logs an `Execution skipped` message, for example (edited for readability): ```logs INFO 2022-11-09 15:15:43,082 ... ...scheduler.DefaultSchedulerMessageSource: Flow 'scheduler-disallowConcurrentExecution-ex' is already running and 'disallowConcurrentExecution' is set to 'true'. Execution skipped. INFO 2022-11-09 15:15:43,083 ... ...scheduler.DefaultSchedulerMessageSource: Flow 'scheduler-disallowConcurrentExecution-ex' is already running and 'disallowConcurrentExecution' is set to 'true'. Execution skipped. ``` The following example shows a fixed-frequency scheduling strategy that executes the Scheduler every 10 seconds after an initial 10 second delay: ```xml ``` ### Cron Examples The following example uses a cron expression to trigger the generation of a Mule message in a new execution of the flow every fifteen seconds: ```xml ``` The following example uses a cron expression to trigger the flow at 12:00 every day in the `America/Los_Angeles` time zone. ```xml ``` ## Cron Expressions Cron is a widely used standard for describing time and date information. The Cron Expression (`` scheduling strategy (``) is useful for triggering a flow at intervals not available through the Fixed Frequency scheduling strategy. The Scheduler keeps track of every second and creates a Mule event when the Quartz Cron expression matches your time-date setting. You can trigger the event just once or at regular intervals. A date-time expression consists of six required settings and can include the optional year setting. Specify the settings in the following order: 1. Seconds (`0`\-`59`) 2. Minutes (`0`\-`59`) 3. Hours (`0`\-`23`) 4. Day of month (`1`\-`31`) 5. Month (`1`\-`12` or `JAN`\-`DEC`) 6. Day of the week (`1`\-`7` or `SUN`\-`SAT`) 7. Year (empty or a 4-digit year between `1970`\-`2099`, for example, `2019`) The Scheduler supports Quartz Cron expressions. Here are a few examples:
ExpressionBehavior

1/2 * * * * ?

Run every 2 seconds of the day, every day.

0 15 10 ? * *

Run at 10:15 a.m., every day. 0 15 10 * * ? * and 0 15 10 * * ? produce the same effect.

0 15 10 * * ? 2019

Run at 10:15 a.m., every day during the year 2019.

0 * 14 * * ?

Run every minute starting at 2pm and ending at 2:59pm, every day.

0 0/5 14 * * ?

Run every 5 minutes starting at 2pm and ending at 2:55pm, every day

1 1 1 1,7 * ?

Run the first second of the first minute of the first hour, on the first and seventh day, every month.

The Scheduler component also supports Quartz Scheduler special characters: - `*`: All values. - `?`: No specific value. - `-`: Range of values, for example, `1-3`. - `,`: Additional values, for example, `1,7`. - `/`: Incremental values, for example, `1/7`. - `L`: Last day of the week or month, or last specific day of the month (such as `6L` for the last Saturday of the month). - `W`: Weekday, which is valid in the month and day-of-the-week fields. - `#`: "nth" day of the month. For example, `#3` is the third day of the month. This example logs the message "hello" every second: ```XML ``` Note that there are many free online tools that can help you build Cron expressions. ## Error Handling At least one processor must follow the Scheduler. Processors include Mule components and connector operations, such as an HTTP Request operation or Transform Message component. Failure to provide a processor produces a `MuleRuntimeException` and causes the deployment of the Mule application to fail with the following ERROR message in the logs (edited for readability): ```logs ERROR ...MuleRuntimeException ... The content of element 'flow' is not complete. One of '{"http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected. ``` ## See Also - [Mule Events](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event) - [Trigger a Scheduler On Demand](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows#trigger-scheduler-on-demand) --- product: Anypoint Code Builder version: master --- # Set Payload () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Sets or updates the payload of the message. The payload can be a literal string or a DataWeave expression. Use the `set-payload` component only for simple expressions or transformations. For complex scenarios, use the [Transform Message Component](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform). ## Component XML This component supports the following XML structure: ```xml ``` Set Payload (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Set payload (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Value

value

A literal string or DataWeave expression that defines how to set the payload, for example, "some string" or #[now()]. This attribute is required.

N/A

resource

A .dwl file containing a DataWeave transformation script. These values are resolved statically (not dynamically). For example, using <ee:set-payload resource="myscript-$site.dwl"/> generates an error. For more information, see dwl File.

Encoding

encoding

Encoding of the payload that this component outputs.

Mime type

mimeType

MIME type of the payload that this component outputs. For more information, see Using Reader and Writer Properties.

Parameters

N/A

Appends a key-value pair for a reader property to the value of the outputMimeType attribute. Multiple key-value pairs are allowed. Reader properties are specific to the MIME type. For example, see the JSON reader properties for application/json. To find other reader properties, navigate to a supported format from the DataWeave format documentation, and see Using Reader and Writer Properties.

> [!WARNING] The `mimeType` and `encoding` attributes do not affect a DataWeave expression used as a > `value`. These attributes affect the _output_ Mule Message only. If a transformation is required, > the DataWeave expression must contain an explicit `output` directive. ## Examples The following examples show how to set the payload using a static value or a DataWeave expression. ### Example: Set the Payload with a Static Value The following example sets a payload with static values: ```xml ``` ### Example: Set the Payload Using a DataWeave Expression The following example sets the message payload to `"Hello, World"` appending today’s date using a DataWeave expression: `#['Hello World!' ++ ' Today is ' ++ now()]` ```xml ``` ## See Also - [Mule Message Structure](https://docs.mulesoft.com/mule-runtime/latest/about-mule-message) - [DataWeave Language](https://docs.mulesoft.com/dataweave/latest/) --- product: Anypoint Code Builder version: master --- # Set Variable () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Creates or updates a [Mule variable](https://docs.mulesoft.com/mule-runtime/latest/about-mule-variables) to store values for use within the flow of a Mule app. A Mule variable is part of the [Mule event](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event). You can store simple literal values such as strings or messages, message payloads, or attribute objects. For example, you might store the original payload of a message (before it is processed) so you can use it later in the flow or within an error handler. Don’t use Set Variable for complex expressions or transformations. Instead, use the component for simple operations, such as selections, and use the Transform component for complex scenarios. ## Component XML This component supports the following XML structure: ```xml ``` Set Variable (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Set variable (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Value

value

Value for the variable, which can be a string or a DataWeave expression. For an example that uses an expression, see Use Dynamic Writer Properties. This attribute is required.

Variable name

variableName

Name of the variable, which can be a string or a DataWeave expression. Variable names are must include only numbers, characters, and underscores. This attribute is required.

Encoding

encoding

Encoding of the payload that this component outputs.

Mime type

mimeType

MIME type of the payload that this component outputs. For more information, see Using Reader and Writer Properties.

Parameters

N/A

Appends a key-value pair for a reader property to the value of the outputMimeType attribute. Multiple key-value pairs are allowed. Reader properties are specific to the MIME type. For example, see the JSON reader properties for application/json. To find other reader properties, navigate to a supported format from the DataWeave format documentation, and see Using Reader and Writer Properties.

## Accessing Variables in Other Event Processors Set Variable sets a variable in the current Mule event, and the variables then travel with the Mule event to downstream event processors. You can access any variable with DataWeave using `vars`. For example, you can access a variable named _lastMessage_ with `vars.lastMessage`. You can set variables in a Transform component, and also many connectors and event processors have a Target variable that you can set. ## Examples ### Example: Setting a Variable With a String Value The following example assigns a String value to a variable: ```xml ``` ### Example: Setting the Result of a DataWeave Expression as a Variable The following example assigns the result of a DataWeave expression to a variable: ```xml ``` ### Example: Setting a Variable to the Message Payload The following example assigns the message payload to a variable: ```xml ``` ### Example: Setting a Variable to the Message Attributes The following example assigns the message attributes to a variable: ```xml ``` ### Example: Setting a Variable With a Map Value The following example assigns a map value to a variable: ```xml ``` ### Example: Setting a Variable to a Java Object The following example assigns a Java object to a variable by using a DataWeave script: ```xml ``` ## See Also - [Transform Component](https://docs.mulesoft.com/anypoint-code-builder/acb-component-transform) - [Variables in Mule Events](https://docs.mulesoft.com/mule-runtime/latest/about-mule-variables) - [Enrich Data with Target Variables](https://docs.mulesoft.com/mule-runtime/latest/target-variables) --- product: Anypoint Code Builder version: master --- # Setting Up Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The extensions in Anypoint Extension Pack are available from the Visual Studio Marketplace. - [Before You Begin Anypoint Code Builder Setup](#prereqs) - [Hardware and Storage Requirements](#hardware-storage-requirements) - [Install Anypoint Extension Pack](#install-pack) - [Install Anypoint Extension Pack in Cursor, Trae, or Devin](#install-other-ides) - [Update Anypoint Extension Pack](#update-pack) - [Uninstall Anypoint Extension Pack](#uninstall-pack) ## Before You Begin Anypoint Code Builder Setup Before installing the Anypoint Code Builder extensions to VS Code, make sure you have an Anypoint Platform account with the required permissions: - An administrator with an Anypoint Platform organization account must provide you with the necessary permissions. See [Configuring Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions). - Anypoint Platform requires a user account. You can use an existing account or create one from Anypoint Platform (see supported [Cloud Hosts](https://docs.mulesoft.com/anypoint-code-builder/#us-eu-clouds)). For information about OS and system compatibility, see [Anypoint Code Builder Release Notes](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#compatibility). ## Hardware and Storage Requirements Anypoint Code Builder relies on Visual Studio Code (VS Code), Java, Node.js, Maven, and local build artifacts. To avoid timeouts, slow dependency resolution, and poor responsiveness, your environment must meet the following minimum specifications. Recommended values improve performance for larger workspaces and frequent local runs. For supported operating systems and extension compatibility, see [Anypoint Code Builder Release Notes](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#compatibility). To check whether your machine meets these specifications and apply available optimizations automatically, ask MuleSoft Vibes or Claude Code to run the `run-system-diagnostics` skill. ### Hardware Requirements
ComponentMinimumRecommended

CPU

8 cores or 8 vCPUs

More cores for parallel builds and multiple large projects

RAM

32 GB

Additional memory for multiple VS Code windows and heavy local testing

Primary storage type

NVMe SSD (PCIe 3.0 or higher)

Same; avoid network-only or heavily virtualized disks for the OS, user profile, and project roots

Free disk space

50 GB

100 GB

Network

1 Gbps

10 Gbps (for large dependency downloads and corporate artifact repositories)

### Storage Performance Local disks that can’t sustain the following metrics often show slow indexing, Maven repository access, and Mule application startup. Confirm values with your storage vendor or disk benchmark tooling on the volume that hosts your user profile, local Maven repository, VS Code data, and project directories. Consider input/output operations per second (IOPS) as well; higher IOPS generally improve responsiveness for random small-file access.
MetricMinimum Requirement

Random read IOPS (4 KB)

10,000 IOPS

Random write IOPS (4 KB)

8,000 IOPS

Sequential read

1,250 MB/s

Sequential write

1,000 MB/s

Antivirus, endpoint detection, and real-time scanning can reduce read and write speeds below these minimums. To reduce this impact, configure antivirus and endpoint protection exclusions. ### Configure Antivirus and Endpoint Protection Exclusions On managed devices, add exclusions for the processes and directories that Anypoint Code Builder and its toolchain use most intensively. Exclusions reduce file locking, false positives, and severe I/O latency during builds. Your organization’s security policy decides whether exclusions are allowed, so use the list with your security team. For the full list of processes and directories to exclude, see [Antivirus Exclusion Paths](https://docs.mulesoft.com/anypoint-code-builder/urls-to-allow#antivirus-exclusions). ### Windows Performance On Windows, avoid running projects from network-mapped drives, because remote file access adds latency to project loading and canvas responsiveness. Store projects on local storage that meets the requirements in [Storage Performance](#storage-performance), and keep Anypoint Extension Pack updated to the latest version to benefit from ongoing file read and write optimizations for Windows. ### Power Settings Power management can throttle CPU and disk performance during long builds or local runs. - Windows: Prefer a **High performance** or **Balanced** power plan while you work; avoid battery saver or aggressive power saving when the machine is on AC power. - macOS: On notebooks, reduce battery-focused throttling where your org allows it—for example, adjust **System Settings** under **Battery** or **Energy** when plugged in. For more information about hardware and storage requirements, see [Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements). ## Install, Update, or Uninstall Anypoint Extension Pack Use of Anypoint Code Builder in VS Code on your computer requires the Anypoint Extension Pack. - [Install Anypoint Extension Pack](#install-pack) - [Install Anypoint Extension Pack in Cursor, Trae, or Devin](#install-other-ides) - [Update Anypoint Extension Pack](#update-pack) - [Uninstall Anypoint Extension Pack](#uninstall-pack) ### Install Anypoint Extension Pack To install the Anypoint Extension Pack into VS Code: 1. Open VS Code. 2. Find **Anypoint Extension Pack** from within VS Code or from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=salesforce.mule-dx-extension-pack). > [!NOTE] To avoid installation errors: > > Do not install the individual Anypoint Code Builder extensions that are also available > separately from Anypoint Extension Pack in Visual Studio Marketplace. - To install from within VS Code, launch the Extensions menu by clicking the Extensions icon from the activity bar or pressing Cmd+Shift+x (Mac) or Ctrl+Shift+x (Windows), and search for the extension pack. Select **Install Release Version**. - To install from the Visual Studio Marketplace website, find the extension pack, and install: Select **Install Release Version**. For additional guidance, see the [Visual Studio Code website](https://code.visualstudio.com/learn/get-started/extensions). 3. Open the Extensions menu, and review the extensions in Anypoint Extension Pack: Anypoint Extension Pack contains these extensions: - Anypoint Code Builder - API Extension - Anypoint Code Builder - APIkit Extension - Anypoint Code Builder - DataWeave Extension - Anypoint Code Builder - Dependencies Extension - Anypoint Code Builder - Integration Extension - Anypoint Code Builder - MUnit Extension - Anypoint Code Builder - Platform Extension For versioning information about extensions in Anypoint Extension Pack, see the [Change Log](https://marketplace.visualstudio.com/items/salesforce.mule-dx-extension-pack/changelog). 4. Recommended: Ensure that the Anypoint extensions update automatically by right-clicking each extension to see if **Auto Update All (From Publisher)** is checked. If it’s not, select **Auto Update** for each extension, for example: ![Setting an extension to auto-update](/mulesoft/current/en-us/anypoint-code-builder/_images/start-extensions-auto-update.png) Ensure this option is checked. 5. Click the MuleSoft icon in the activity bar to access and use Anypoint Code Builder features. ![MuleSoft icon for Anypoint Code Builder in the activity bar](/mulesoft/current/en-us/anypoint-code-builder/_images/anypoint-code-builder-view.png) 6. Confirm that the [Anypoint Code Builder menu](#acb-menu) loads. 7. Disable other VS Code extensions that you don’t need for Mule development. Java-based extensions, such as a Java Language Server, Java debugger, or Spring Boot tools, run background processes that compete with Anypoint Code Builder for the same JVM resources, which can slow down canvas loading, DataSense resolution, and debugging. 8. If your Anypoint Platform account uses a control plane other than US Cloud, change the **Mule: Control Plane** setting. For guidance, see [Set Anypoint Code Builder to a Different Control Plane](https://docs.mulesoft.com/anypoint-code-builder/start-acb#change-clouds). 9. Follow the steps in [Log in to Anypoint Platform](https://docs.mulesoft.com/anypoint-code-builder/start-acb#login-ide). NOTE If an Anypoint Platform session is active in any of your browsers when you install Anypoint Extension Pack, the extension pack uses that session to sign in to Anypoint Platform. You can [log out](https://docs.mulesoft.com/anypoint-code-builder/start-acb#logout-status-bar) or [sign in](https://docs.mulesoft.com/anypoint-code-builder/start-acb#logout-status-bar) from the status bar. ### Install Anypoint Extension Pack in Cursor, Trae, or Devin Cursor, Trae, and Devin use the OpenVSX marketplace by default. Before you can search for and install Anypoint Extension Pack in these IDEs, configure Visual Studio Marketplace as the gallery service URL. Anypoint Extension Pack is also compatible with Windsurf. See [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server) for more about using the Anypoint Extension Pack, including MuleSoft MCP Servers, across compatible IDEs. - Cursor - Trae - Devin 1. Open Cursor. 2. Go to **Cursor** > **Preferences** > **VS Code Settings**. 3. Search for **Extensions › Gallery: Service Url**. 4. Replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 5. Restart Cursor to apply the change. 6. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. 7. Open Trae. 8. Go to **TRAE** > **Settings**. 9. Search for **Extension Market Url**. 10. Replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 11. Restart Trae to apply the change. 12. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. 13. Open Devin. 14. Go to **Devin** > **Devin Settings** > **Plugins**. 15. In the **Marketplace extension gallery service URL** field, replace the existing value with this URL: ```none https://marketplace.visualstudio.com/_apis/public/gallery ``` 16. Restart Devin to apply the change. 17. After restarting, search for **Anypoint Extension Pack** in the Extensions panel and install it. ### Update Anypoint Extension Pack If Anypoint Extension Pack is installed, update to the latest version of the extension pack by following VS Code instructions in [Update an extension manually](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_update-an-extension-manually). ### Uninstall Anypoint Extension Pack Typically, it is unnecessary to uninstall the extension pack or individual Anypoint Code Builder extensions from VS Code. For example, you can update to a new version without uninstalling first. If you decide to uninstall Anypoint Extension Pack, follow the same procedure that you use for other VS Code extensions. Uninstalling the extension pack also uninstalls the individual Anypoint Code Builder extensions that are bundled within the extension pack, such as the DataWeave and APIkit extensions. To uninstall: 1. Open VS Code. 2. From the activity bar, open the Extensions panel. 3. Find and select Anypoint Extension Pack. 4. In the Anypoint Extension Pack tab that opens, click **Uninstall**. 5. To remove the Anypoint Code Builder extensions from the Extensions panel, click **Reload** on one of the extensions. For additional guidance, see the VS Code documentation, [Manage extensions](https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_manage-extensions). You can reinstall at any time. --- product: Anypoint Code Builder version: master --- # Sharing Rules and Skills from GitHub with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use a GitHub repository to centralize the workspace rules and skills that your team applies in MuleSoft Vibes. When you clone the repository into Anypoint Code Builder and open it as your workspace, MuleSoft Vibes loads those files as workspace rules and workspace skills. Rules and skills such as error handling are ready to use, so each developer doesn’t define them again in every project. To create rules and workflows in the MuleSoft Vibes panel, see [Workflows and Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands). For information about how skills work, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). ## Before You Begin - [Get Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - [Set up MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes#before-you-begin-vibes) and confirm that you have the required permissions. - Install Git on your computer and configure your GitHub username and email. See [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm#prereqs). - Get access to the GitHub repository that stores your team’s rules and skills, or create a repository for them. ## Rule and Skill Locations in Your Repository MuleSoft Vibes reads workspace rules and skills from the `.a4drules` directory at the root of the folder that you open in Anypoint Code Builder.
AssetRepository Location

Workspace rules

Markdown (.md) files directly in .a4drules/. Each file is a natural-language rule that MuleSoft Vibes follows in that workspace. Prefix the file names with numbers, such as 01-error-handling.md, to control the order in which MuleSoft Vibes applies the rules.

Workspace skills

One directory per skill in .a4drules/skills/. The directory name matches the skill name and contains a SKILL.md file with the instructions. Supporting material goes in subfolders such as references/, assets/, or scripts/. See Set Up Skills in Your Project.

Global rules and global skills stay on the local machine and aren’t part of the repository. Share only workspace rules and skills in GitHub. ## Store Rules and Skills in a GitHub Repository Keep `.a4drules` at the repository root. Use a dedicated repository for your team’s rules and skills, or add the directory to an existing API or integration project repository. 1. Open the GitHub repository for your team’s MuleSoft Vibes configuration, or create one. 2. At the root of the repository, create a `.a4drules` directory. 3. Add each workspace rule as a Markdown file in `.a4drules/`. This rule centralizes error-handling guidance for the whole team: `01-error-handling.md` ```markdown # Error handling When you generate or update Mule flows and API specifications: - Add explicit error handling for connector and HTTP failures. - Use On Error Propagate for errors that callers must see. - Use On Error Continue only when the flow can recover and continue. - Log the error type and a correlation ID. ``` 4. Add each workspace skill in `.a4drules/skills//SKILL.md`. The repository structure looks like this example: ```text .a4drules/ ├── 01-error-handling.md ├── 02-naming-conventions.md └── skills/ └── error-handling/ └── SKILL.md ``` 5. Commit `.a4drules` and push the changes to GitHub. For information about publishing and syncing project files, see [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm). > [!NOTE] To create rules and skills in the MuleSoft Vibes panel instead of writing the files > yourself, see [Add Workflows or Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands#add-workflows-or-rules) and > [Set Up Skills in Your Project](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills#set-up-skills-in-your-project). Anypoint Code Builder > saves the files in `.a4drules`, and you commit them to the repository. ## Clone the Repository into Anypoint Code Builder MuleSoft Vibes loads `.a4drules` only from the root of the folder that you open, so open the cloned repository as your workspace. 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Write this command: ```command Git: Clone ``` 3. Write the URL to your repository in GitHub, for example: ```command https://github.com/_owner_/_yourrepo_.git ``` Replace the URL in the example with the URL to your repository. 4. Navigate to a directory for your new repo, and click **Select as repo Destination**. 5. If prompted with the request **Would you like to open the cloned repository?**, click **Open**. 6. In the **Explorer**, check that `.a4drules` is at the root of the open folder. > [!IMPORTANT] If your team’s rules and skills are in a dedicated repository and your application > code is in a different repository, then copy `.a4drules` into the root of the application > repository. Open the application repository as your workspace so that MuleSoft Vibes finds the > directory. ## Verify the Shared Rules and Skills To confirm that MuleSoft Vibes loaded the files from the repository: 1. Open MuleSoft Vibes. 2. In the MuleSoft Vibes panel, click the **Rules/Workflows** icon. 3. Select **Workspace Rules**. The Markdown rules from `.a4drules/` are listed and active. There’s no need to add them again in **Settings**. 4. Check that each skill in `.a4drules/skills/` is available as a workspace skill. MuleSoft Vibes applies the workspace rules to every message that you send in that workspace, and loads a skill when your message matches the skill description. ## Example: Centralized Error Handling Teams often keep error-handling rules and skills in GitHub so that every developer gets the same results: - A workspace rule states when to use On Error Propagate, when to use On Error Continue, and what to log. - A workspace skill provides the workflow that MuleSoft Vibes follows when you ask it to add or review error handling. After a teammate clones the repository and opens it in Anypoint Code Builder, both the rule and the skill are active. When that teammate asks MuleSoft Vibes to generate or update a flow, MuleSoft Vibes applies the shared rule and loads the error-handling skill when the message matches it. ## Troubleshoot Rules and Skills That Don’t Load If the shared rules don’t appear in **Workspace Rules**, verify the following: - You opened the cloned repository as your workspace, not a parent or child folder. - `.a4drules` is at the root of the open folder. - The rules are Markdown files in `.a4drules/`. If a shared skill isn’t available in the workspace, you must verify: - The skill is a directory in `.a4drules/skills/`, and the directory contains a `SKILL.md` file. - Your local clone includes the latest commits. Pull the changes if a teammate added the skill after you cloned the repository. ## See Also - [Workflows and Rules](https://docs.mulesoft.com/anypoint-code-builder/vibes-workflows-commands) - [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills) - [Controlling Source Files](https://docs.mulesoft.com/anypoint-code-builder/start-scm) - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) - [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) --- product: Anypoint Code Builder version: master --- # Subflow () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Group together a sequence of Core components and operations (provided by connectors and modules) inside a scope that you invoke from a Flow Reference in your Mule application. The Subflow component works in a similar way to the [Flow](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow) component but with the following differences: - Subflows do not support Mule event sources. - Subflows do not have a built-in error handling scope. - During design, subflows work as macros that replace the Flow Reference components that call them. When you build the application, Mule replaces all Flow Reference components that call a subflow with the contents of the referenced subflow. - Referencing subflows results in better performance than referencing a flow. You can create multiple subflows in your Mule application. For a more in-depth discussion of uses, capabilities, and limits of flows and subflows, see [Flows and Subflows](https://docs.mulesoft.com/mule-runtime/latest/about-flows). ## Limitations Because the contents of a subflow replace each Flow Reference component that references that subflow, several instances of the event processors inside that subflow exist in the application at runtime. This behavior can cause issues with event processors that depend on unique IDs or instances to execute. ## Component XML This component supports the following XML structure: ```xml ``` Subflow (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

name1 (default)

name

Editable name for the subflow.

## Find Flows That Reference This Subflow You can find every flow that references a subflow without searching the project manually. To list the references, right-click the subflow in the canvas and select **Find References**. You can also press Shift+Alt+F12 (Windows and macOS). Anypoint Code Builder lists each flow reference that points to the selected subflow, including references in other configuration files and in MUnit tests. Select a reference to open that location. This helps you trace execution paths and assess the impact of changes to a reusable subflow. For more information, see [Find Flows That Reference a Subflow](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components#find-referencing-flows). ## Example: Flow and Subflows The following example uses a Scheduler as a source to trigger the execution of a flow every 10 seconds and then connects to a subflow (``) through a Flow Ref (``) component. The subflow then connects to another subflow, also using a Flow Ref component. ```xml 9.99 53 398.99 ', 'application/xml') output application/xml --- myXml ]]> { (key) : { dollars: value, localCurrency: value * conversionRate, index_plus_1: index + 1, timer : currentMilliseconds() } }]]> ``` The example produces the following output: ```json { "priceList": { "basic": { "dollars": "9.99", "localCurrency": 129.87, "index_plus_1": 1, "timer": 1533024312658 }, "premium": { "dollars": "53", "localCurrency": 689, "index_plus_1": 2, "timer": 1533024312659 }, "vip": { "dollars": "398.99", "localCurrency": 5186.87, "index_plus_1": 3, "timer": 1533024312659 } } } ``` ## See Also - [Flow](https://docs.mulesoft.com/anypoint-code-builder/acb-component-flow) --- product: Anypoint Code Builder version: master --- # Test the American Flights API with MUnit > For the full documentation index, see: https://docs.mulesoft.com/llms.txt After debugging your API flows locally, add automated MUnit tests to verify behavior and guard against regressions before deployment. In this tutorial section, you: 1. Build a test manually in the canvas view, so you learn the parts of an MUnit test and how to work in the editor. 2. Use MuleSoft Vibes to create a second test that mocks the database, so you can see how mocking works without building your test manually. Before you begin, complete the debugging steps in [Debug the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-debug-api). MUnit is MuleSoft’s unit testing framework for Mule applications. Use it to create automated tests that verify your API behaves correctly. Anypoint Code Builder provides integrated support for creating, running, and debugging MUnit tests through a Testing panel, canvas UI, and code editor. An MUnit test consists of: - **Test Suite**: A file containing one or more tests (saved as `*-test.xml` in `src/test/munit`). - **Test Case**: An individual test that validates a specific behavior. - **Behavior**: Setup and teardown conditions, including mocks of external systems (like databases) to isolate the logic under test. - **Execution**: Invokes a flow or subflow. - **Validation**: Asserts that the result matches expectations. > [!NOTE] MUnit 3.4.0 or later is required for canvas-based test suite creation in Anypoint Code > Builder. ## Create a Test Suite for the American Flights API Create a test suite to contain the tests for your project. 1. Navigate to `src/test/munit` in the Explorer panel. 2. Right-click the `munit` folder and select **New MUnit Test Suite File**. ![The munit folder context menu with New MUnit Test Suite File selected](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-new-munit.png) 3. Provide a name for the test suite: `american-flights-api-test.xml`. 4. Press **Enter**. Anypoint Code Builder generates a new file with a basic structure. ## Create a Test for Database Operations Now create your first test case to verify a database query returns flight data successfully. This test uses the actual database configuration from your implementation project. 1. Open the test file (`american-flights-api-test.xml`) in canvas view. 2. Click **Build a Test** to start. 3. Click the **Test** component and change its name to `test-database-query`. 4. In the **Execution** section, click **+** and select **Connectors > Database > Select**. 5. Click the **Database - Select** operation and specify these values: - **Connection Config**: `Config` (select the existing database configuration) - **SQL Query Text**: `SELECT * FROM american` 6. In the **Validation** section, click **+** and select **MUnit Test Modules > Assert that**. 7. Click the **Assert that** component and specify these values: - **Expression**: `sizeOf(payload)` - **Is**: `MunitTools::greaterThan(0)` - **Message**: `Should return at least one flight` Ensure **Expression mode** (![The Expression mode icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-function.svg)) is enabled so expressions are recognized ![The Assert that component with Expression mode enabled](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-expression-mode-enabled.png) This validation checks that the database query returned at least one record. ## Create a Test with Mocks Using MuleSoft Vibes While the previous example tested a database operation directly, you can also test your API flows by mocking their dependencies. With this approach, your tests run without requiring external systems like databases. Use MuleSoft Vibes to create the test by sending this message: ```command Add an MUnit test for the GET /flights flow in american-flights-api-test.xml. Mock the database call to return two sample flights, and verify the flow returns both. ``` The generated test might vary because the prompt is general, but you should get a test similar to this: ![The get-flights-returns-two-flights test in the canvas. Behavior contains a Mock All Flights DB Select component, Execution contains a Call get flights flow component, and Validation contains three assertions: Assert two flights returned, Assert first flight ID, and Assert second flight ID](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-test-mocking.png) The test mocks the **All Flights** Database Select that you created in [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api), so the flow returns the sample flights instead of querying the real database. ## Run the Tests Run both tests together to confirm that the first one passes against the real database and the second one passes using only mocked data. 1. In the Testing panel, click **Run all the tests in this file** (![1.5%](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-run-test.png)) and select **Run Test**. ![The MUnit toolbar with The Run Test and Run Test With Coverage options showing](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-munit-toolbar-run-tests.png) 2. View the test results in the **Testing** panel. ![The testing panel results showing both tests passed.](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-munit-test-run-results.png) ## Measure Test Coverage MUnit provides built-in coverage reporting that measures the percentage of event processors executed by your tests. Aim for at least 80% coverage for production APIs. After you run tests with coverage, you can view the results in the **Test Coverage** panel or in the console output. The Explorer panel also displays coverage metrics alongside your files, making it easy to identify which parts of your application need additional test coverage. To run tests with coverage: 1. In the Testing panel, click **Run all the tests in this file** (![1.5%](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-run-test.png)). ![The MUnit toolbar with The Run Test and Run Test With Coverage options showing](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-munit-toolbar-run-tests.png) 2. Click **Run Test With Coverage**. Alternatively, right-click the test suite file in the project explorer and select **Run MUnit Test with Coverage**. ## Best Practices for MUnit Testing Follow these best practices to create maintainable and effective MUnit tests: - **Mock external dependencies**: Always mock database connections, HTTP requests to external APIs, and file system operations to keep tests fast and reliable. - **Test one behavior per test case**: Each test should validate a single scenario (success path, specific error condition, and so on). - **Use descriptive test names**: Names like `get-flight-by-valid-code-returns-200` clearly indicate what the test validates. - **Maintain test data separately**: Consider storing sample payloads in separate files in `src/test/resources` for complex data structures. - **Run tests frequently**: Execute tests after each significant change to catch issues early. - **Aim for high coverage**: Target at least 80% code coverage, ensuring all critical paths are tested. - **Test error scenarios**: Don’t just test the happy path — validate that your error handlers work correctly too. ## Troubleshoot Common MUnit Issues When creating and running MUnit tests, you may encounter issues related to test execution, mocking, or runtime configuration. These are some common problems and their solutions to help you resolve test failures. ### Test Timeout Errors If tests fail with timeout errors: - Increase the timeout value in your MUnit configuration. - Check for infinite loops or blocking operations in your flows. - Ensure mocked components return responses quickly. ### Mock Not Applied If mocks aren’t being applied: - Verify that the name of the component the mock targets exactly matches the name of the component in your flow. For example, the mock must target the Database Select named **All Flights**. Even a small difference, such as a missing space or different capitalization, prevents the mock from being applied. - Check that the mock targets the right type of component. For example, use a Database Select mock for a Database Select operation. - Ensure the mock is in the **Behavior** section of the test, so it is set up before the **Execution** section runs. ### Assertion Failures When assertions fail: - Review the expected vs. actual values in the test output. - Add Logger components to see intermediate payload transformations. - Use debug mode to inspect the actual payload structure at the validation point. [Debug the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-debug-api) [Deploy the American Flights API to CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-deploy-api) --- product: Anypoint Code Builder version: master --- # Test Your GraphQL Project > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Before making changes to your GraphQL project, run the application locally to test the endpoints. ## Before You Begin Complete [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api). ## Run Your Application To deploy your Mule Application locally, run a debug session in Anypoint Code Builder: 1. In Anypoint Code Builder, open the **Books Implementation** project. 2. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar, then click the **Start Debugging (F5)** icon. 3. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 4. In the terminal, open a new command prompt by clicking the plus (**+**) icon, for example: ![Opening command prompt from Terminal](/mulesoft/current/en-us/anypoint-code-builder/_images/open-command-prompt.png) Alternatively, select a command shell, such as **bash**, by clicking the **v** menu (inverted caret), located beside the plus (**+**) icon, and selecting the shell to use. ![Opening bash prompt from Terminal](/mulesoft/current/en-us/anypoint-code-builder/_images/open-command-prompt-bash.png) 5. Run the following `curl` command from the shell’s prompt to trigger the **bookById** flow: ```curl curl --request POST \ --location 'http://localhost:8081/graphql' \ --header 'Content-Type: application/json' \ --data '{ "query": "query bookById($id: ID) {bookById(id: $id){ id name pageCount author{ id firstName lastName}}}", "variables": { "id": 1 } }' ``` If you receive the error `curl: (7) Failed to connect to localhost port 8081 after 0 ms: Couldn’t connect to server`, stop and rerun the application in debug mode. For guidance with stopping the application, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). > [!TIP] Tools such as Postman provide a way to build GraphQL queries. For example, in Postman, > you can place your query in the **Body** tab and copy the example `curl` request. The > resulting command includes newline (`\\n`) and tab (`\\t`) characters that you can delete from > the `curl` command’s `--data` value. For more information, see > [Make an HTTP call with GraphQL](https://learning.postman.com/docs/sending-requests/graphql/graphql-http/) > in the Postman documentation. Anypoint Code Builder returns the following output in the terminal (manually reformatted to enhance readability): ```GraphQL { "data": { "bookById": { "id":"#myID", "name":"This is some example data", "pageCount":100, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } } } } ``` The mock data in the output comes from strings in the Set Payload component that is part of the **Query.bookById** flow (``): ```xml ``` 6. Optionally, try queries for other endpoints: 1. Query the `books` endpoint with the following `curl` command: ```command curl --location 'http://localhost:8081/graphql' \ --header 'Content-Type: application/json' \ --data '{"query":"query books { books{ id name pageCount author{ id firstName lastName } }}","variables":{}}' ``` This command returns the following result (manually reformatted to enhance readability): { "data": { "books": \[{ "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "name":"This is some example data", "pageCount":1, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } }\] } } For your reference, the `books` endpoint has the following structure: ```GraphQL query books { books{ id name pageCount author{ id firstName lastName } } } ``` 2. Query `bestSellers`: ```command curl --location 'http://localhost:8081/graphql' \ --header 'Content-Type: application/json' \ --data '{"query":"query bestsellers { bestsellers{ books{ id name pageCount author{ id firstName lastName } } authors{ id firstName lastName } } }","variables":{}}' ``` This command returns the following result (manually reformatted to enhance readability): { "data" : { "bestsellers": { "books": \[{ "id":"#myID", "name":"This is some example data", "pageCount":1, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } }, { "id":"some-id", "name":"Goodbye", "pageCount":100, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } }, { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "name":"Hello World!", "pageCount":-10, "author": { "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"This is some example data", "lastName":"Hello World!" } }\], "authors": \[{ "id":"urn:uuid:123e4567-e89b-12d3-a456-426655440000", "firstName":"Hello World!", "lastName":"Hello World!" }, { "id":"#myID", "firstName":"Goodbye", "lastName":"Goodbye" }\] } } } For your reference, the `bestsellers` endpoint has the following structure: ```GraphQL query bestsellers { bestsellers{ books{ id name pageCount author{ id firstName lastName } } authors{ id firstName lastName } } } ``` 7. Proceed to [Configure Responses for Your GraphQL Implementation](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-configure-flow-responses) to populate each flow with a custom response for each query. [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api) [Configure Responses for Your GraphQL Implementation](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-configure-flow-responses) --- product: Anypoint Code Builder version: master --- # Testing a Connection Configuration > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Most connectors provide an operation, such as the HTTP Listener operation, that triggers the flow to start. These operations typically include connection configurations that you can test. ## Test Connection from the Configuration Panel You can test the connection from the connectors **Configuration** panel. For example, to test an HTTP Listener connection: ![Configuration panel for connectors](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-configuration-panel-test.png)
1Click the + icon on the connector to open the configuration panel.
2After filling in the required fields, click Test Connection.
The status bar shows the progress: - **Verifying connection** indicates that the test is in progress. - **Connection is valid** indicates a successful connection. - **Invalid Connection Got status code: 500 when trying to resolve a Mule Runtime operation** indicates a connection error. ## Test Connection from the Code Editor You can test the connection from the code editor. For example, to test an HTTP Listener connection, click **Test Connection** in the code editor: ![HTTP Listener Test Connection link in the code editor](/mulesoft/current/en-us/anypoint-code-builder/_images/http-listener-test-connection.png) The status bar shows the progress: - **Verifying connection inbound-request** indicates that the test is in progress. - **Connection is valid** indicates a successful connection. - **Invalid Connection Got status code: 500 when trying to resolve a Mule Runtime operation** indicates a connection error. A common code `500` error is `port 8081: Address already in use`. For port conflicts, configure a different port, such as `8082`, and retest the connection. Before publishing, run your application in debug mode. --- product: Anypoint Code Builder version: master --- # Testing Projects with MUnit > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Create, run, and modify MUnit tests for your implementation and integration projects in Anypoint Code Builder. Import projects that contain MUnit test files. MUnit is a MuleSoft unit testing framework for creating and running unit tests on a Mule application, as described in [MUnit Overview](https://docs.mulesoft.com/munit/latest/). With MUnit, create MUnit tests and MUnit test suites. An MUnit test is an individual test case, defined by the `` element, which includes specific validations and assertions to test the functionality of a Mule application. An MUnit test suite is a container for multiple MUnit tests. It organizes tests in an XML file typically found in the `/src/test/munit` directory. Anypoint Code Builder provides a **Testing** panel from which you can run tests. In the **Explorer**, test suites are also located within the project directory `/src/test/munit`. Anypoint Code Builder also shows a canvas for creating and maintaining MUnit test suits, a Testing Results panel with the status of tests, and logs that identify the status of tests. Anypoint Code Builder - MUnit Extension, part of the Anypoint Extension Pack, supports MUnit functionality in Anypoint Code Builder. For information about extensions, see [Anypoint Extension Pack](https://docs.mulesoft.com/anypoint-code-builder/#extension-pack). ## Before You Begin Understand the fundamentals of MUnit. Refer to the MUnit documentation for an overview and guidance with test configurations: - [MUnit Overview](https://docs.mulesoft.com/munit/latest/) - [MUnit Test Structure Fundamentals](https://docs.mulesoft.com/munit/latest/munit-test-concept) - [MUnit Event Processors](https://docs.mulesoft.com/munit/latest/event-processors) - [MUnit Cookbook](https://docs.mulesoft.com/munit/latest/munit-cookbook) ## MUnit Tasks and Workflows A workflow can include one or more steps: 1. [Creating tests and test suites](#create-tests) 2. [Opening tests](#open-test) 3. [Running tests](#run) 4. [Debugging](#run-debug) 5. [Fixing errors](#fix-errors) 6. [Importing a project that contains MUnit tests](#import-test) ## Create MUnit Tests and Test Suites Configure MUnit tests and test suites directly from a flow or by using the canvas or code editor. - [Create an MUnit Test Suite](#create-suite) - [Create an MUnit Test](#create-test) ### Create an MUnit Test Suite Create an MUnit test suite in your project from the **Explorer**. 1. Open your project to `/src/test/munit` in the **Explorer**. 2. Create a suite file in the `munit` folder: 1. Right-click the `munit` folder and select **New MUnit Test Suite File**. 2. Provide a name for your suite, such as `my-suite.xml`. A canvas shows with a link to build a new test with scope and flow structure options. The new suite file includes the XML declaration (``), `` and `` elements. For example: ```xml ``` 3. Select a component from the canvas to customize your test: - With the **Behavior** components, such as 'munit:before-test', 'munit:after-test', etc., you can set the conditions for the test. - With the **Execution** components, the '' or inline flow definition within the '' block, you can specify the actions or processes to test. - With the **Validation** components, such as 'munit:assert-that', you can check the output or state of the application after the execution phase to ensure it matches the expected results so you can confirm the application behaves as intended. See [MUnit Event Processors](https://docs.mulesoft.com/munit/latest/event-processors) for more information. 4. Continue to [Create an MUnit Test](#create-test). > [!NOTE] Anypoint Code Builder requires MUnit 3.4.0 or later to create MUnit test suites from the > canvas. ### Create an MUnit Test Create an MUnit test in a new or existing test suite. Start an MUnit test by right-clicking the `flow` component, or by using the canvas or code editor. For guidance with your test configuration, refer to the [MUnit documentation](#prereqs) described in the prerequisites. #### Create a Test from a Flow Generate the basic structure for an MUnit test designed to test a specific flow within your Mule application. 1. Open your Mule project. 2. In the canvas, right-click on the `flow` component. 3. Select **Create Test**. 4. Anypoint Code Builder creates a new MUnit test suite file in your project `/src/test/munit` folder with the test structure targeting the selected flow. #### Create a Test from the Canvas 1. Open an MUnit test suite file in the `src/test/munit/` folder. 2. Click **Add**, and then select **Test scope**. 3. In the panel that appears, select **Test**. 4. Anypoint Code Builder creates an empty test in the currently open test suite. #### Create a Test from the Code Editor 1. Open the test suite XML in the code editor. For guidance, see [Open MUnit Tests](#open-test). 2. In the code editor, press Ctrl+Space to display available options, and type `munit`. For example: ![Using autocomplete in the code editor to select the MUnit test element](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-tests-test-xml-autocomplete.png) 3. Select `munit:test` and insert the test element in your suite. For example: ```xml ``` 4. Provide a name and other XML elements to create the test. For example, on any line within XML similar to these examples: ```xml ``` To find more examples, see [MUnit Examples](#examples). 5. Run your test from the Test panel. For guidance, see [Run MUnit Tests](#run). ## Open MUnit Tests Open the test suite XML from the **Testing** panel or the **Explorer**. After the February 2025 release, Anypoint Code Builder shows a canvas with the test components, or provides a link to build a new test. > [!NOTE] Anypoint Code Builder requires MUnit 3.4.0 or later to create MUnit test suites from the > canvas. - **Testing panel** - Open the **Testing** panel from the activity bar: 1. Open a project that contains an MUnit test suite. 2. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-testing.png) (**Testing**) to open the **Testing** panel. 3. Click or hover the suite or test name, and click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test-gray.png) (**Go to test**) or highlighted ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test.png) (**Go to test**) to open the XML file that contains the test. Clicking the test name also opens to the XML file. - **Explorer** - From the **Explorer**, locate MUnit test suite files in the project directory: 1. Open a project that contains an MUnit test suite. 2. In the activity bar, click (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-explorer.png)) (**Explorer**). 3. Go to `src/main/test/munit`. 4. Click a test suite XML file to view the tests in the suite. ## Run MUnit Tests Run MUnit tests using any of these options: - [Run Tests from the Testing Panel](#run-test-panel) - [Run Tests from the Canvas](#run-test-canvas) - [Run Tests from the MUnit Configuration XML File](#run-test-xml) - [Run Tests with an MUnit Launch Configuration](#run-launch-config) - [Run MUnit Tests in Debug Mode](#run-debug) - [Run MUnit Tests with Coverage](#run-coverage) If you run a test, a test build executes, and the Terminal displays the progress of the test. If all tests execute successfully, the build succeeds. Otherwise, the build fails. Anypoint Code Builder displays the results of the tests in the **Testing** panel, the **Terminal**, and the **Test Results** panels. Time-stamped logs are also available from the **Test Results** panel. You can clear the results at any time. ### Run Tests from the Testing Panel Run all tests, all tests in a suite, or a single test from the **Testing** panel. The **Testing** panel lists all MUnit test suites in the project. To run tests: 1. Open a project that contains an MUnit test suite. To check for test suites, see [Open MUnit Tests](#open-test). 2. From the activity bar, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-testing.png) (**Testing**) to open the **Testing** panel. If the icon isn’t present, try right-clicking within the activity bar and selecting **Testing** to display the icon. 3. Run tests from the **Testing** panel at any of three levels: ![Testing panel](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-testing-panel.png) Run tests with or without debugging features. If your XML contains breakpoints and you opt to debug, test execution stops at your breakpoints. For information about debugging, see [Run MUnit Tests in Debug Mode](#run-debug).
1All suites: to run all tests in all suites, click the Run Tests, Debug Tests, or Run Tests with Coverage icon. You can select the same options from the right-click menu.
2Suite: to run all tests in a single suite, hover over, or click the suite, and then click the Run Test, Debug Test, or Run Test with Coverage icon. You can select the same options from the right-click menu.
3Test: to run a single test, hover over, or click a test in a test suite, and then click the Run Test, Debug Test, or Run Test with Coverage icon.
You can select the same options from the right-click menu. 4. Monitor the test and review test results: - **Testing** panel and XML: The following example displays a running test. ![Running test in the Test panel and XML](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-xml-test-run-panel-xml.png) After the test runs, the panel and XML show the result. - Terminal: The following example provides the progress of a test that runs and fails. \================================================================================ === Running suite: myTestSuiteEx3.xml === ================================================================================ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - Running test: test-03-suite3 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ java.lang.AssertionError: at file: \[myTestSuiteEx3.xml\], line: \[27\] Expected: "this" as String {encoding: "UTF-8", mediaType: "application/java; charset=UTF-8", mimeType: "application/java", class: "java.lang.String", contentLength: 4} but: "that" as String {encoding: "UTF-8", mediaType: "application/java; charset=UTF-8", mimeType: "application/java", class: "java.lang.String", contentLength: 4} at (root) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \[INFO\] =============================================================================== \[INFO\] MUnit Run Summary - Product: MULE\_EE, Version: 4.6.0 \[INFO\] =============================================================================== \[INFO\] >> myTestSuiteEx3.xml test result: Tests: 1, Errors: 0, Failures: 1, Skipped: 0 \[INFO\] --- test-03-suite3 <<< FAILED \[INFO\] \[INFO\] =============================================================================== \[INFO\] > Tests: 1 \[INFO\] > Errors: 0 \[INFO\] > Failures: 1 \[INFO\] > Skipped: 0 \[INFO\] =============================================================================== \[INFO\] ------------------------------------------------------------------------ \[INFO\] BUILD FAILURE \[INFO\] ------------------------------------------------------------------------ \[INFO\] Total time: 03:10 min \[INFO\] Finished at: 2024-04-29T08:49:39-07:00 \[INFO\] ------------------------------------------------------------------------ 5. If the test results indicate any failures, go to [Fix Test Errors](#fix-errors). To clear test results, see [Clear Test Results](#clear-results). ### Run Tests from the Canvas Run a test, with or without coverage. Add a test scope to test specific parts of your Mule application or flow structure to define the execution context. ![Running a test from the canvas](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-run-test-canvas.png) See [Create MUnit Tests and Test Suites](#create-tests). See [Run MUnit Tests with Coverage](#run-coverage). ### Run Tests from the MUnit Configuration XML File Run tests with or without debugging features. If your XML contains breakpoints and you opt to debug, test execution stops at your breakpoints. For information about debugging, see [Run MUnit Tests in Debug Mode](#run-debug). To run tests from the test suite XML: 1. From the **Testing** panel, open a test suite XML file in your project. For guidance with opening from the **Testing** panel, see [Open MUnit Tests](#open-test). 2. Run a single test or all tests in the test suite XML file: ![Testing options from test suite XML](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-xml-test-options.png) - To run a single test in the test suite XML: 1. Place your cursor on a line that contains the XML for a test (`munit:test`). For example, on any line within XML similar to this example: ```xml ``` 2. Right-click, and select an option: - **Run Test at Cursor** - **Debug Test at Cursor** - **Run Test at Cursor with Coverage** If you don’t see these menu items, be sure to open the XML file from ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test-gray.png) or highlighted ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test.png) (\*Go to test\*) in the \*Testing\* panel. - To run all tests in the test suite XML: 1. Place your cursor in the XML file. 2. Right-click, and select an option: - **Run Tests in Current File** - **Debug Tests in Current File** - **Run Tests with Coverage in Current File** If you don’t see these menu items, be sure to open the XML file from ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test-gray.png) or highlighted ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-go-to-test.png) (\*Go to test\*) in the \*Testing\* panel. 3. Check the status of the running test in the Testing, Terminal, and Testing Results panels. See the [example](#results-example). To clear test results, see [Clear Test Results](#clear-results). ### Run Tests with an MUnit Launch Configuration Run MUnit tests from the Run and Debug panel with an MUnit launch configuration. Create and run an MUnit launch configuration: 1. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 2. Add a launch configuration to `launch.json`: 1. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gear.png) (gear icon) to open the **launch.json** tab. The default configuration looks something like this: ```json { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", "request": "launch", "name": "Debug Mule Application", "mule.project": "${workspaceFolder}", "mule.runtime.args": "${config:mule.runtime.defaultArguments}" } ] } ``` 2. In the `launch.json` file, add a comma after the first object in the array, and append the MUnit launch configuration by pressing Ctrl+Space to open the auto-complete menu and selecting **MUnit Debug Launch**. For example: ![Adding launch configuration for MUnit from the auto-complete menu](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-launch-config-autocomplete.png) This action adds a new JSON object named `Munit Debug Tests` to the file. For example: ```JSON { "version": "0.2.0", "configurations": [ { "type": "mule-xml-debugger", (1) "request": "launch", "name": "Debug Mule Application", "mule.project": "${workspaceFolder}", "mule.runtime.args": "${config:mule.runtime.defaultArguments}" }, { "type": "munit-xml-debugger", (2) "request": "launch", "name": "Munit Run Tests", "mule.project": "${workspaceFolder}", "munit.runtime.args": "${config:munit.runtime.defaultArguments}", "munit.runtime.debugger.version": "${config:munit.runtime.debugger.version}", "munit.debug": "false" } ] } ```
1Launcher for the standard debugger, named Debug Mule Application.
2Launcher for the MUnit debugger, named Munit Run Tests.
3. Save the configuration to `launch.json`. 4. Run MUnit tests from the **MUnit Debug Tests** launch configuration: 1. In the Run and Debug panel, select **MUnit Debug Tests** from the launch menu. For example: ![Selecting MUnit Debug Tests from the launch menu](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-launch-config-munit.png) 2. Execute **MUnit Debug Tests** by clicking ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png) (launch) in the **Run an Debug** panel. 5. Verify that the MUnit tests run. See the [example](#results-example). ## Run MUnit Tests in Debug Mode Run your test in debug mode after adding breakpoints to the XML for your tests or Mule application. When Mule reaches the breakpoint, you can review variables in the Run and Debug panel. 1. Open a project that contains an MUnit test suite. 2. Add breakpoints to the XML for the Mule application or test suites. For guidance with breakpoints, the Mule event, DataWeave in the **Watch** panel and **Debug Console**, conditional breakpoints, and exception breakpoints, see [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps). 3. Run your test with a debugging command using one of the following options: - From the **Testing** panel, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-run-debug.png) (**Debug test**) at any level (all tests, all tests in a suite, or a single test). For more guidance, see [Run Tests from the Testing Panel](#run-test-panel). - From the suite XML, use the right-click menu to run the test. For more guidance, see [Run Tests from the MUnit Configuration XML File](#run-test-xml). - From a launch configuration in the Run and Debug panel. For guidance, see [Run Tests with an MUnit Launch Configuration](#run-launch-config). 4. When the build process reaches a breakpoint, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) from the activity bar to review variables, including the Mule event variables and test parameters. For example: ![Variables after debugging test with breakpoints](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-debug-test-mule-event.png) 5. Examine the data, and address any issues. By default, running tests fail after a timeout period. If a debugging session reaches a breakpoint in a test, the test and the build fail at timeout. See [Test TimeOut Attribute](https://docs.mulesoft.com/munit/latest/munit-test-concept#test-timeout-attribute). ## Run MUnit Tests with Coverage Run your test with coverage to measure how much of a Mule application your set of MUnit tests executes. 1. Open a project that contains an MUnit test suite. 2. Run your test with coverage using one of the following options: - From the canvas, click **Run Test** and **Run Test with Coverage**. The **Testing** panel shows the test coverage results. For more guidance, see [Run Tests from the Canvas](#run-test-canvas). - From the **Testing** panel, click **Run Test with Coverage** at any level (all tests, all tests in a suite, or a single test). For more guidance, see [Run Tests from the Testing Panel](#run-test-panel). - From the suite XML, right-click and select an option to run the test. For more guidance, see [Run Tests from the MUnit Configuration XML File](#run-test-xml). 3. After the test suite runs, view coverage results using one of the following options: - In the activity bar, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-testing.png) (**Testing**) to open the **Testing** panel. The **Test Coverage** panel shows coverage for directories and files: ![Test coverage percentages after running tests with coverage](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-test-coverage-panel.png) - In the activity bar, click (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-explorer.png)) (**Explorer**), which shows coverage for directories and files. Numeric and graphic percentages both show the percentage of event processors executed by the MUnit test. ## Fix Test Errors After [running a test](#run), fix any errors. 1. Review test errors in the XML by clicking the name of the failing test from the **Testing** panel. The error in the XML example identifies the error `java.lang.AssertionError`. - Expected result (highlighted in red): "yes" as String {encoding: "UTF-8", mediaType: "application/java; charset=UTF-8", mimeType: "application/java", class: "java.lang.String", contentLength: 3} - Actual result (highlighted in green): "no" as String {encoding: "UTF-8", mediaType: "application/java; charset=UTF-8", mimeType: "application/java", class: "java.lang.String", contentLength: 2} at (root) You can also review the test results in the **Test Results** panel by clicking the failing test in the test logs. For example: ![Error in the Test Results panel](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-test-results-panel-failed.png) 2. Fix the error: 1. After reviewing the error, click the **x** icon to close the error message in the XML. For example: ![Closing test error messages in the XML](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-test-error-xml-close.png) 2. Edit the XML to produce the expected output. For example, the failing test case in the example must return `"yes"` instead of `"no"`. 3. After fixing the error, rerun the test to ensure that the fix works: - To rerun the test from the XML, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-failed-test.png) (**Test failure**) for the test. - To rerun the test from the **Testing** panel, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-run-test.png) (**Run test**). - To rerun the test from the Testing Results panel, open the panel, click the name of the failing test in the test logs, and click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-run-test.png) (**Run test**) from the test logs. For guidance with MUnit XML configurations, see [MUnit Test Structure Fundamentals](https://docs.mulesoft.com/munit/latest/munit-test-concept) and [MUnit Event Processors](https://docs.mulesoft.com/munit/latest/event-processors). ### Troubleshoot Runtime Class Errors If running a test fails with an error similar to `NoClassDefFoundError: org/apache/commons/io/output/ByteArrayOutputStream`, check your project and runtime setup before changing test logic. 1. Verify compatibility among Mule runtime, MUnit dependencies, and the Anypoint Code Builder extensions that you are using. 1. Confirm the versions that your project declares in `pom.xml`. 2. If needed, align dependency and plugin versions with the versions recommended in [MUnit Overview](https://docs.mulesoft.com/munit/latest/). 2. Clean and rebuild the project, and then rerun the test. 1. From the terminal, run `mvn clean test` to confirm whether the issue reproduces outside the IDE test runner. 3. Review dependency declarations in `pom.xml` for conflicts in test dependencies, including direct overrides for `commons-io`. 4. If the error persists, isolate the issue in a new minimal project and compare the project dependencies and plugin versions. 5. Capture the full terminal stack trace and contact support if the runtime class error continues after version and dependency checks. To clear test results, see [Clear Test Results](#clear-results). ## Import a Project that Contains MUnit Tests Mule projects created in Anypoint Studio and Anypoint Code Builder for your integrations or implementations can include MUnit tests. - To import and open the project into Anypoint Code Builder, see [Importing Projects into Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project). - To export a project from Anypoint Studio before importing to Anypoint Code Builder, use one of the procedures in [Export Projects From Studio](https://docs.mulesoft.com/studio/import-export-packages#export-project-studio). - To start an integration that imports an example or template that contains MUnit tests from Anypoint Exchange, see [Create an Integration Project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#create-integration-project). Instead of starting with an empty project when creating the integration project, click **Template or Example Project** so that you can import the asset that contains tests into your project. ## Clear Test Results After testing, you can clear test results from the **Testing** panel and the logs if you no longer need them. - From the **Testing** panel, click the **Views and More Actions** (**…​**) menu, and select **Clear All Results**. - From the **Test Results** panel, click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-munit-clear-test-results.png) (**Clear All Results**). For example: ![Clearing test results from Test Results panel](/mulesoft/current/en-us/anypoint-code-builder/_images/munit-clear-testing-results-log.png) ## Targeting Specific Processors and Attributes in Your Test Add these processors to your MUnit test to focus on individual components of your Mule flow:
ProcessorDescription

Mock-when

Create a mock of an event processor in your flow to simulate the behavior of the event processor without executing it.

Spy

Observe what happens before and after a specific event processor in your flow is executed, without altering its behavior.

### Setting Up Processors 1. On your test suite, click **+**. 2. Search for a processor designed to observe your flow (see [Targeting Specific Processors and Attributes in Your Test](#targeting-specific-processors-and-attributes-in-your-test)). 3. Select the type of processor to be observed by clicking on the **+** icon. ![Component window to add a processor](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-munit-processor.png) 4. Select the components and attributes of the processor to observe. ![Component and attribute highlighted in the processor window](/mulesoft/current/en-us/anypoint-code-builder/_images/acb-munit-select-component-attribute.png) 5. Click **Add** to add the processor to your test suite. The processor shows in the code editor and the canvas. When selecting the processor and its attributes, consider these aspects: - The configuration for one processor applies to all processors of the same type in your flow. - The attributes of all processors of the same type are listed. ## MUnit Examples The MUnit documentation provides several examples. See [MUnit Cookbook](https://docs.mulesoft.com/munit/latest/munit-cookbook). The following MUnit test example validates if the `payload` is the string `"Example"`: ```xml ``` For information about `munit:execution`, `munit:validation`, and other MUnit testing elements, see [MUnit Test Structure Fundamentals](https://docs.mulesoft.com/munit/latest/munit-test-concept) and [MUnit Event Processors](https://docs.mulesoft.com/munit/latest/event-processors). --- product: Anypoint Code Builder version: master --- # Tracking Changes with Checkpoints > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When you have a folder or directory open in Visual Studio Code, you can use checkpoints to track changes to your workspace. Checkpoints capture the state of your files and MuleSoft Vibes tasks at a specific moment in time, allowing you to restore or compare your project with a prior state. To restore or compare your workspace: 1. Open a folder or directory in Visual Studio Code. 2. Interact with MuleSoft Vibes to generate actions that create checkpoints. 3. In the MuleSoft Vibes panel, locate the checkpoint that you want to reference. 4. Choose one of the available options: - **Restore** – Revert your workspace to the selected checkpoint. You can restore: - **Restore Files Only** – Restores only the file changes in your workspace. - **Restore Task Only** – Restores only the task history associated with the checkpoint. - **Restore Files and Tasks** – Restores both the file changes and the task history. - **Compare** – Compare the current state of your workspace to the selected checkpoint. This opens a comparison view that highlights the differences between your current files and the files at the time the checkpoint was created. --- product: Anypoint Code Builder version: master --- # Tracking Requests with Autodiscovery > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Set up API autodiscovery in a Mule app to display key metrics in API Manager, including requests to endpoints in the app. API Manager is part of Anypoint Platform. ![View request metrics for a Mule app in API Manager](/mulesoft/current/en-us/anypoint-code-builder/_images/autodiscovery-data-apim.png) Autodiscovery configuration in a Mule app requires an API instance ID from an API in API Manager that runs on a Mule Gateway runtime, and your app requires Anypoint Platform credentials (client ID and secret) for connecting to your API in API Manager. For other important uses of Mule Gateway API instances, review [Managing Instances](https://docs.mulesoft.com/api-manager/latest/api-instance-landing-page) and [Mule Gateway Policies Overview](https://docs.mulesoft.com/mule-gateway/policies-policy-overview). ## Before You Begin To obtain the API instance ID for your Mule app’s autodiscovery configuration, you must have access to an API in API Manager that runs on a Mule Gateway runtime, or you can create your API by following the procedure in [Adding a Mule Gateway API Instance](https://docs.mulesoft.com/api-manager/latest/create-instance-task-mule), in the API Manager documentation. APIs in API Manager are associated with an API spec on Anypoint Exchange that defines endpoints in your Mule app. For an API spec example that defines an endpoint and a Mule app example that implements the endpoint, see [Examples](#examples). For guidance creating API specs, see: - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) to design a spec from Anypoint Code Builder - [Designing API Specs and Fragments](https://docs.mulesoft.com/design-center/design-designing-api-specs-fragments) to design a spec from Design Center For guidance publishing an API spec to Exchange, see: - [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) to publish your spec from Anypoint Code Builder - [Publishing API Specifications](https://docs.mulesoft.com/design-center/design-publish) to publish your spec from Design Center ## Set Up API Autodiscovery in a Mule App Configure a Mule app to send request data to an API running on a Mule Gateway runtime in API Manager. The API tracks this data in charts on API Manager. Autodiscovery configuration of a Mule app requires a global element (``) that references an API instance ID along with credentials (client ID and secret) that enable the Mule runtime engine in your Mule app to connect to the Anypoint Platform business group or environment for your API in API Manager. To set up autodiscovery: 1. Meet the prerequisites in [Before You Begin](#prereqs). 2. Obtain the client ID and secret for your business group from Access Management ([US](https://anypoint.mulesoft.com/accounts/businessGroups/), [EU](https://eu1.anypoint.mulesoft.com/accounts/businessGroups)), in Anypoint Platform. Show me how 1. Open the list of business groups in Access Management, on Anypoint Platform ([US](https://anypoint.mulesoft.com/accounts/businessGroups/), [EU](https://eu1.anypoint.mulesoft.com/accounts/businessGroups)). To navigate to the business group list from the Anypoint Platform home page instead, open Access Management, and click **Business Groups**. 2. In the business group list, click the name of your business group. 3. Click the **Settings** tab for your business group. 4. Obtain the **Client ID** and **Client Secrets** values from the **Settings** tab in Access Manager. 3. Obtain the API instance ID from your API instance in API Manager. Show me how 1. In Anypoint Platform ([US](https://anypoint.mulesoft.com/), [EU](https://eu1.anypoint.mulesoft.com/)), navigate to API Manager. 2. In the **API Administration** page of API Manager, locate and click the name of your API to open its **API Summary** page. 3. Find the **API Instance ID** in the **API Summary** page. You’ll need the instance ID when configuring your Mule app for autodiscovery. 4. In your Mule app in Anypoint Code Builder, use your API instance ID to pair your app to the API instance: You can add API Autodiscovery from **Global Elements** instead of editing XML. See [Add a Global Configuration](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements#add-global-config). .. In the code editor for your Mule app, add the `` element above `` elements in the app, for example: - ```xml ``` \+ For more complete context, see the example in [Example: Mule Application](#mule-app). 1. Paste your API instance ID as the `apiID` value, for example: ```xml ``` 5. In Anypoint Code Builder, append the client ID and client secret for your business group to the Mule runtime arguments in the **Settings** tab: 1. Open the **Settings** tab. Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 2. In the **Settings** tab, find **Mule › Runtime: Default Arguments**. 3. In the text field, append your client ID and secret arguments to the end of the existing arguments, for example: \-M-Danypoint.platform.client\_id=999abcde1f888e9h9aaa00ff5a5b03c5 -M-Danypoint.platform.client\_secret=abc0d1234e5a4ab321A000B2033D4E56 Replace the mock values in the example with your client ID and secret. 6. Run your application to ensure that the API is connected by checking the build logs for the following information: - The client ID and client secret validated successfully against API Manager. - The underlying `GateKeeper` is available (unblocked) and in `FLEXIBLE` mode. - The API Gateway extension is in `STANDALONE` mode. 7. Send requests to an endpoint in your app that is tracked by your API instance. For guidance, see [Triggering Flows in Your Development Environment](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows). 8. In API Manager, check that the API instance is now registered (active) and produces metrics in API Manager. ![API in API Manager with autodiscovery data](/mulesoft/current/en-us/anypoint-code-builder/_images/autodiscovery-apim-fullview.png) ### Examples Examples tested for API autodiscovery include the following: - [Example: OAS Spec](#oas-spec): Testing involved creating the spec in Design Center, publishing the spec to Exchange, creating an Mule Gateway API instance in API Manager that is associated with the spec on Exchange. - [Example: Mule Application](#mule-app) Testing involved adding the `` element with the `apiID` value from API Manager, appending the client ID and secret to the Mule runtime arguments in Anypoint Code Builder settings, running the app in debug mode to deploy the app locally, making requests to the defined endpoint in the app, and checking that the associated Mule Gateway API instance on API Manager is **Active** and that the requests produce data (key metrics) in the instance’s charts. #### Example: OAS Spec The following OAS spec defines a single endpoint in the [Mule app example](#mule-app). ```yaml openapi: "3.0.0" (1) info: version: 1.0.0 title: my-autodiscovery-api servers: - url: https://my-autodiscovery-app.us-e2.cloudhub.io paths: /current-time: (2) get: responses: "200": description: my description here. content: application/json: schema: type: object properties: current-time: type: string example: current-time: "2024-08-05 14:56:12" (3) ```
1OAS 3.0 specification
2/current-time endpoint definition
3Formatted example of a date-time value
#### Example: Mule Application ```xml (1) (2) (3) (4) (5) (6) ```
1HTTP Listener connection configuration example
2Autodiscovery configuration that references the flow currentTimeFlow

If you try this app, replace YOUR_API_ID_HERE with the apiID value of an Mule Gateway API instance associated with the OAS spec example.

3Flow currentTimeFlow
4HTTP listener with endpoint configuration path="/current-time"

This endpoint matches the name of the endpoint defined in the OAS spec example.

5Transform Message component that uses DataWeave to get the current time in the specified format

The format matches the formats defined in the OAS spec example.

6Logger component that prints the current time (in the payload) upon requests to http://localhost:8081/current-time when the app is running
--- product: Anypoint Code Builder version: master --- # Transaction () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Set an identifier for all tracked events. Use a transaction ID so that meaningful information, such as an order number, is displayed for a transaction when analyzing tracked events at runtime, whether using Anypoint Runtime Manager or CloudHub. The transaction ID supports DataWeave expressions, which enables you to create an ID dynamically and include information related to the event into the ID. ## Component XML This component supports the following XML structure: ```xml ``` Transaction (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Transaction (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Id

id

Defines the value of the identifier, which can be an expression or a literal. By default, the component assigns a numeric value.

## Examples The following example sets a transaction ID using the `payload.orderId` value. ```xml ... ... ``` ## See Also - [Business Events](https://docs.mulesoft.com/mule-runtime/latest/business-events) - [Configure Default Events Tracking](https://docs.mulesoft.com/mule-runtime/latest/business-events-in-components) --- product: Anypoint Code Builder version: master --- # Transform () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Write a DataWeave script within this component to set or transform the Mule message payload, attributes, or variables to the required output format and data structure. DataWeave is the programming language for all expressions and data transformations in your integrations and implementations. The language offers function libraries and mechanisms for creating customizations, including your own functions, libraries, and data types. To learn the basics of DataWeave and experiment with DataWeave scripts, see [DataWeave Tutorial and Playground](https://dataweave.mulesoft.com/), and find DataWeave functions and guidance with the language in the [DataWeave documentation](https://docs.mulesoft.com/dataweave/2.4/). ## Component XML This component supports the following XML structure: ```xml ```
1The output directive of a DataWeave script that configures the application/java format
2Location for the body of the DataWeave script
Write a [DataWeave script](https://docs.mulesoft.com/dataweave/2.4/dataweave-language-introduction) within a Transform component (``) to create or transform content for any parts of the [Mule event](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event): `` and `` are child elements of Transform (``): - `` accepts child elements for creating or transforming a Mule message payload and attributes:
Element NameElement XMLDescription

Set payload

<ee:set-payload/>

Sets or transforms the Mule message payload. This child element of <ee:message/> accepts a DataWeave script. One <ee:set-payload/> element is allowed.

Set attribute

<ee:set-attributes/>

Sets or transforms one or more Mule message attributes. This child element of <ee:message/> accepts a DataWeave script. One <ee:set-attributes/> element is allowed.

- `` accepts child elements for creating or transforming a Mule variables:
Element NameElement XMLDescription

Set Variables

<ee:set-variable/>

Sets or transforms a Mule variable. This child element of <ee:variables/> accepts a DataWeave script. One or more <ee:set-variable/> elements are allowed.

## Examples The following examples show how to configure an inline transformation and call DataWeave scripts to apply a transformation. ### Example: Inline DataWeave Transformation The following example sets the payload using an inline DataWeave script. ```xml ``` The DataWeave script within `` returns this XML output as the message’s payload: ```xml Hello World! 2017-03-21 728 14422 ``` ### Example: Calling an External DataWeave Script The following example calls an external DataWeave script within a [DWL file](https://docs.mulesoft.com/dataweave/2.4/dataweave-language-introduction#dwl_file) to set the payload. ```xml ``` Add your DWL file to the `src/main/resources` directory of your Mule project folder. For example, you can create a file named `myscript.dwl` in that folder, and provide the same DataWeave script shown in [Example: Inline DataWeave Transformation](#example1): ```dataweave %dw 2.0 output application/xml --- example: { message @(id: "DSF-829"): "Hello World!", date: |2017-03-21|, items: { item1: 728, item2: "14422" } } ``` If you trigger a flow that contains the [Transform example](#example-dwl), the script returns the same payload returned by [Example: Inline DataWeave Transformation](#example1). ### Example: Payload, Attribute, and Variable Transformation The following example triggers a flow that requests user data and configures `` to transform the user data payload, select an attribute that provides the status code of the HTTP request, and set the value of Mule variables. The loggers in the example help track the values within the Mule event in the flow. ```xml (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) ```
1<http:listener/> configures an HTTP Listener operation that triggers the flow from requests to localhost port 8081 at the endpoint /mytrigger.
2<http:request/> configures and HTTP Request operation for a JSON data sample.
3<set-variable/> sets Mule variable myVar to the string value "myVar Value".
4LOGGER-PAYLOAD-1 prints the value of payload[0], which is the first index of an array of user objects found at https://jsonplaceholder.typicode.com/users.
5LOGGER-ATTRIBUTES-1 is set to the predefined Mule variable attributes to print the HTTP metadata returned from the HTTP request, including the status code, reason phrase, and headers.

For more information about attributes and other Mule variables, see Predefined Variables.

6LOGGER-VARIABLES-1 is set to vars to print an object that describes the Mule variable in the Mule event:
{myVar=TypedValue[value: 'my VarValue',
  dataType: 'SimpleDataType{type=java.lang.String,
  mimeType='*/*; charset=UTF-8'}']}
7<ee:transform/> provides DataWeave scripts that select and transform payload, attribute, and variable data in the Mule event.
  • <ee:set-payload/> selects the id value from the user objects in the payload array.

  • <ee:set-attributes/> uses attributes.statusCode to select the status code value from the HTTP request metadata.

    All the metadata is selectable. For example, you can select the reason phrase with attributes.reasonPhrase and the headers with attributes.headers. For more information, see DataWeave Selectors.

  • <ee:variables/> creates new Mule variables. The first <ee:set-variable/> sets myVar2 to the value of the myVar variable (vars.myVar). The second creates a variable named myVar3 to the string 'myvariable3'.

8LOGGER-PAYLOAD-2 prints the transformed value of payload, which is now an array of user id values ([1,2,3,4,5,6,7,8,9,10]).
9LOGGER-ATTRIBUTES-2 prints the transformed value of attributes, which is now the JSON object { "status-code": 200 }.
10LOGGER-VARIABLES-2 prints the value of Mule variable vars.myVar2, which is the string "myVar Value".
11LOGGER-VARIABLES-3 prints the value of Mule variable vars.myVar3.myNewVar, which is the string "myvariable3".
In the logs, the output looks something like this (edited for readability): INFO 2023-10-24 16:59:43,279 ... \[processor: myFlow/processors/2; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-PAYLOAD-1: { "id": 1, "name": "Leanne Graham", "username": "Bret", "email": "Sincere@april.biz", "address": { "street": "Kulas Light", "suite": "Apt. 556", "city": "Gwenborough", "zipcode": "92998-3874", "geo": { "lat": "-37.3159", "lng": "81.1496" } }, "phone": "1-770-736-8031 x56442", "website": "hildegard.org", "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net", "bs": "harness real-time e-markets" } } INFO 2023-10-24 16:59:43,333 ... \[processor: myFlow/processors/3; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-ATTRIBUTES-1: org.mule.extension.http.api.HttpResponseAttributes { Status Code=200 Reason Phrase=OK Headers=\[ date=Wed, 25 Oct 2023 20:00:48 GMT content-type=application/json; charset=utf-8 transfer-encoding=chunked connection=keep-alive x-powered-by=Express x-ratelimit-limit=1000 x-ratelimit-remaining=999 x-ratelimit-reset=1698156189 vary=Origin, Accept-Encoding access-control-allow-credentials=true cache-control=max-age=43200 pragma=no-cache expires=-1 x-content-type-options=nosniff etag=W/"160d-1eMSsxeJRfnVLRBmYJSbCiJZ1qQ" via=1.1 vegur cf-cache-status=HIT age=21484 report-to={"endpoints":\[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=abcdefg1234..."}\],"group":"cf-nel","max\_age":604800} nel={"success\_fraction":0,"report\_to":"cf-nel","max\_age":604800} server=cloudflare cf-ray=81bd0c408c729685-SJC alt-svc=h3=":443"; ma=86400 \] } INFO 2023-10-24 16:59:43,347 ... \[processor: myFlow/processors/4; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-VARIABLES-1: {myVar=TypedValue\[value: 'myVar Value', dataType: 'SimpleDataType{type=java.lang.String, mimeType='\*/\*; charset=UTF-8'}'\]} INFO 2023-10-24 16:59:43,512 ... \[processor: myFlow/processors/6; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-PAYLOAD-2: \[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 \] INFO 2023-10-24 16:59:43,519 \[processor: myFlow/processors/7; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-ATTRIBUTES-2: { "status-code": 200 } INFO 2023-10-24 16:59:43,528 ... \[processor: myFlow/processors/8; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-VARIABLES-2: "myVar Value" INFO 2023-10-24 16:59:43,576 ... \[processor: myFlow/processors/9; event: 6699ea20-72c9-11ee-b3b5-147ddaaf4f97\] LOGGER-VARIABLES-3: "myvariable3" ## See Also - [Set Payload ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-payload) - [Set Variable ()](https://docs.mulesoft.com/anypoint-code-builder/acb-component-set-variable) - [DataWeave Language](https://docs.mulesoft.com/dataweave/latest/dataweave-language-guide) - [DataWeave Selectors](https://docs.mulesoft.com/dataweave/2.4/dataweave-selectors) --- product: Anypoint Code Builder version: master --- # Triggering Flows in Your Development Environment > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When your integration or implementation builds successfully within Anypoint Code Builder, the application deploys to your local development environment. Configure the **HTTP Listener** from [Anypoint Connector for HTTP](https://docs.mulesoft.com/http-connector/latest/) (HTTP Connector) to trigger the execution of a flow in a deployed application. Or trigger the flow locally from the built-in terminal in Anypoint Code Builder, or from a VS Code extension like Thunder Client. A **Scheduler**, a **Flow Ref**, or any connector trigger or message source can initiate a flow execution. These components serve as entry points that listen for specific events or time intervals to start the flow logic. ## Before You Begin - Complete [Getting Started with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Make sure an integration or implementation project with an HTTP Listener (``) is available in Anypoint Code Builder. To create a project, see [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) or [Implementing APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implementing-apis), or follow [Take Your API Specification from Design Through Deployment](https://docs.mulesoft.com/anypoint-code-builder/tutorials#modular-learning-paths). ## URLs for Triggering a Flow from an HTTP Listener For integrations and implementations that you build and deploy during the development process, the URL to use for triggering an HTTP Listener differs depending on whether the listener is within the configuration XML for a scaffolded interface that is generated from an API specification or within a configuration XML file that does not implement a scaffolded interface. Typically, for apps that use an HTTP Listener, you configure the host to `0.0.0.0` and the port to `8081`. If port `8081` is in use by another application, you can use a similar port, such as `8082`. - Trigger a flow within a configuration XML that _does not_ contain a scaffolded interface by using a URL similar to this one from the terminal: http://localhost:8081/mypath The port and host are defined in the `` element, and the endpoint is defined by the `path` attribute in the `` element: ```xml ... ``` - Trigger a flow from the listener within a scaffolded interface by using a URL similar to this one from the terminal: http://localhost:8081/api/my-endpoint Notice `/api/my-endpoint` in the example. For this case, the endpoint is defined within the `name` attribute of a `` element in the interface, and `api` is defined in an HTTP Listener in the interface. For example, assume that a flow in a scaffolded interface references a flow (`getFlights`): ```xml ``` Also assume that the `getFlights` flow resides in an XML configuration file for the implementation: ```xml ``` The URL to trigger this flow uses `flights` as the endpoint: http://localhost:8081/api/flights The URL adds `/api` before the `/flights` endpoint to make the request through the `` in the interface. Generally, a listener is located before the router, as in this example: ```xml (1) #[vars.outboundHeaders default {}] #[payload] #[vars.outboundHeaders default {}] (2) ... ```
1Within the listener (<http:listener/>), the attribute path="/api/*" is set automatically during the scaffolding process.
2The router (<apikit:router/>) is located after the listener in the scaffolded interface within the configuration XML.
## Trigger a Flow Use the terminal in Anypoint Code Builder to trigger a flow through an HTTP Listener in an integration or implementation project that is deployed locally. > [!TIP] The examples in this procedure show how to trigger the flow with a `curl` command from the > terminal. You can also use Thunder Client, a third-party extension for VS Code, to trigger a flow > with the same URLs. Before attempting to trigger a flow, review [URLs for Triggering a Flow from an HTTP Listener](#trigger-urls), and verify that you meet the prerequisites in [Before You Begin](#before-you-begin). 1. Before starting your Mule app, confirm that the connection to the listener is successful: From the code editor, above the HTTP Listener configuration (``), click **Test Connection**. - If the test succeeds, you see a **Connection is valid** message. - If the connection fails, an error message indicates that the connection was unsuccessful. If the app is running when you click **Test Connection**, this error message appears: `Invalid Connection Got status code: 500 when trying to resolve a Mule Runtime operation. Reason: 'Internal Server Error.` 2. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 3. Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png) (**Start Debugging (F5)**) icon for **Debug Mule Application**. Alternatively, if the **Start Debugging (F5)** icon is not present: 1. Click **Run and Debug**. 2. If a **Select debugger** dropdown menu appears, select **Mule Xml Debugger** to initiate the debugging session: ![Run and Debug button and Mule XML Debugger menu item](/mulesoft/current/en-us/anypoint-code-builder/_images/run-debug-imported-folder.png) When the application deploys successfully, you see a `DEPLOYED` log message in the output panel: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* - - + DOMAIN + - - \* - - + STATUS + - - \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \* default \* DEPLOYED \* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 4. Open the Terminal window in the console: - Select **View** > **Terminal**. - Alternatively, press Ctrl and then press the backtick key (\`). 5. In the terminal, click the name of the shell to use, such as PowerShell (for Windows), Bash (`bash`), or Z shell (`zsh` for Mac). Alternatively, click the **+** icon in the terminal to open a new command prompt. 6. At the command prompt, provide a `curl` command to trigger the flow. - To trigger a flow from an HTTP Listener that doesn’t reside within an interface, use `curl` with a URL similar to this one: $ curl localhost:8081/mypath Use `localhost` instead of `0.0.0.0`. Get [more information](#trigger-url-no-interface) about triggering the endpoint. If successful, the command returns a response. - To trigger a flow from an HTTP Listener that resides in a scaffolded interface, use `curl` with a URL similar to this one: $ curl http://localhost:8081/api/mypath2 Use `localhost` instead of `0.0.0.0`, and add the listener `path` for before the router (such as `api` for most scaffolded interfaces) and the endpoint (such as `mypath2`) to the URL. Get [more information](#trigger-url-interface) about triggering the endpoint. ## Trigger a Scheduler Component On Demand A Scheduler component waits for its configured fixed frequency or cron expression to elapse before triggering a flow. Instead of waiting for that interval during local testing, you can trigger a Scheduler on demand while your Mule application is running, whether or not you’re in a debug session. This feature invokes the Scheduler’s own trigger, it doesn’t bypass the Scheduler or create a temporary schedule. The flow runs exactly as it would on a natural tick, so breakpoints and interceptors behave the same way. The on-demand trigger is for local testing only. It’s not available for applications deployed to a remote environment. In a multi-project workspace, the trigger is scoped to the app that owns the Scheduler, so triggering a Scheduler in one app doesn’t affect Schedulers in other running apps. ### Trigger a Single Scheduler To trigger one Scheduler on demand from the canvas: 1. Open the Run and Debug panel. Show me how - Click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-run-debug.png) (**Run and Debug**) icon in the activity bar. - Use the keyboard shortcuts: - Mac: Cmd+Shift+d - Windows: Ctrl+Shift+d - Select **View** > **Run**. 2. Click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-start-debug.png) (**Start Debugging** (F5)) to start your application, either in Run or Debug mode. 3. Open the configuration XML file that contains the Scheduler, and switch to the canvas view. 4. On the Scheduler component, click the **Trigger** (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-trigger-scheduler-play.svg)) button. After triggering the Scheduler, the button changes to **Re-trigger** (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-trigger-scheduler-retrigger.svg)) so you can fire the Scheduler again. The flow runs exactly as it does when the Scheduler triggers naturally. If you set a breakpoint on a processor in the flow, execution pauses there just as it does for a scheduled run. > [!TIP] To trigger every Scheduler in the running application at once, use the **Trigger All > Schedulers** button on the **Run and Debug** toolbar instead of triggering each Scheduler > individually. ## See Also - [Add a Breakpoint](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps#add-breakpoint) - [Scheduler Component](https://docs.mulesoft.com/anypoint-code-builder/acb-component-scheduler) --- product: Anypoint Code Builder version: master --- # Troubleshooting > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Troubleshoot errors and warnings you encounter when using Anypoint Code Builder. - [Missing or Disabled Features](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-missing-features) - [Authentication Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-authentication-errors) - [Deployment Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-deploy-errors) - [Implementation Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-implementation-errors) - [Mule Runtime Issues and Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-mule-runtime-errors) - [Project Loading Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-loading-errors) - [MCP Server Issues](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-mcp-server) For other issues and workarounds, see [Known Issues](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#known-issues) in the Anypoint Code Builder Release Notes. For tasks that support the troubleshooting process, see: - [Check for Problems and Issues](#check-logs) - [Check Console Logs for Extension Issues](#check-console-logs) - [Export Troubleshooting Information](#export-troubleshooting-info) - [Performance Troubleshooting](#performance-troubleshooting) ## Check for Problems and Issues When you don’t know how to resolve an issue, the first step is to check for and review problems, console output, and logs. Error messages and logs list underlying issues that can help you understand what went wrong and what requires attention. - To view centralized errors and warnings, open the **ACB Logs** panel. See [View Errors and Warnings in ACB Logs](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel#acb-logs). - To view detailed logs for in-depth investigation, use the **Output** panel. See [View Detailed Logs in the Output Panel](https://docs.mulesoft.com/anypoint-code-builder/start-open-output-panel#output-panel). - To view problems, open the **Problems** tab by pressing Cmd+Shift+m (Mac) or Ctrl+Shift+m (Windows). Check the **Problems** tab proactively rather than waiting for a run or deployment to fail. Anypoint Code Builder surfaces validation errors, missing dependencies, and configuration issues at design time, so resolving warnings as they appear catches issues earlier than discovering them at runtime. ## Check Console Logs for Extension Issues If you encounter an issue with an Anypoint Code Builder extension, capture the console logs from the developer tools and share them with the MuleSoft support team. 1. Open the Developer Tools: - Select **Help** > **Toggle Developer Tools**. - Alternatively, open the Command Palette and provide this command: ```command Developer: Toggle Developer Tools ``` 2. In the Developer Tools window, click the **Console** tab. 3. Reproduce the issue to capture the relevant log entries in the console. 4. After the issue occurs, save or copy the logs: - Right-click anywhere inside the console output and select **Save as…​** to save the logs directly to a file. - Alternatively, click inside the console, press Ctrl+A (Cmd+A on Mac) to select all, then press Ctrl+C (Cmd+C on Mac) to copy the logs and paste them into a text file. 5. Save the logs as a `.txt` file, for example, `ACB_ConsoleLogs.txt`. 6. Attach the log file to your MuleSoft Support case. ## Export Troubleshooting Information If the MuleSoft support team requests troubleshooting information about your project, export a compressed file that contains your project’s workspace folders, logs, and information about environment variables, CPU, operating system, and system properties. 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Provide this command: ```command MuleSoft: Export Troubleshooting Information ``` 3. When you receive a notification about the information that the command extracts, click **Continue**. When the process is complete, Anypoint Code Builder shows this message: Collecting information...: Generating compressed file 4. Click **Open folder** to locate the file. The command places the file in your home directory. The filename has the prefix `acb-troubleshooting`, for example, `/Users/me/acb-troubleshooting-w9ffppmq.tar.gz`. 5. Provide a copy of the file to the support team. ## Performance Troubleshooting If Anypoint Code Builder is slow to start, load the canvas, or respond, rule out environment and configuration causes before you contact the MuleSoft support team. Work through these checks in order, and restart VS Code after you make changes. 1. Check your hardware and storage against the requirements. Confirm that your machine meets the minimum CPU, RAM, storage type, free disk space, and network requirements, and that the disk that hosts your user profile, Maven repository, and projects meets the storage performance minimums. See [Hardware and Storage Requirements](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements). On Windows, don’t run projects from network-mapped drives. See [Windows Performance](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements#windows-performance). 2. Apply antivirus and endpoint protection exclusions. Real-time scanning can reduce disk performance below the storage requirements. Exclude the processes and directories that Anypoint Code Builder uses, and confirm with your security team that exclusions are allowed. See [Antivirus Exclusion Paths](https://docs.mulesoft.com/anypoint-code-builder/urls-to-allow#antivirus-exclusions). 3. Check your power settings. Power saving modes can throttle CPU and disk performance. See [Power Settings](https://docs.mulesoft.com/anypoint-code-builder/ref-hardware-storage-requirements#power-settings) for Windows and macOS. 4. Close other resource-intensive applications. Applications such as Anypoint Studio compete with Anypoint Code Builder for CPU, memory, and disk resources. Close applications that you aren’t using. 5. Use one VS Code window. Each VS Code window uses its own resources. Instead of opening a separate window for each project, open related projects in a single multi-root workspace. See [Working with Workspaces](https://docs.mulesoft.com/anypoint-code-builder/start-workspaces). 6. Update to the latest version of Anypoint Extension Pack. Updates include performance improvements, such as file read and write optimizations on Windows. See [Update Anypoint Extension Pack](https://docs.mulesoft.com/anypoint-code-builder/start-acb#update-pack). To receive updates automatically, set each Anypoint extension to **Auto Update All (From Publisher)**. 7. Disable extensions that you don’t need. Other extensions, especially Java-based extensions, can compete with Anypoint Code Builder for JVM resources. In the **Extensions** panel, review your installed extensions, and disable or uninstall the ones you don’t use. Don’t disable the extensions in Anypoint Extension Pack: API, APIkit, DataWeave, Dependencies, Integration, MUnit, and Platform. If the issue persists after you complete these checks, export your troubleshooting information and provide it to the support team. See [Export Troubleshooting Information](#export-troubleshooting-info). ## Check for Anypoint Extension Pack Installation To determine whether Anypoint Code Builder extensions are installed, check for the **Anypoint Extension Pack** in the **Extensions: Marketplace** panel: 1. In the Activity Bar, click the Extensions icon to open the **Extensions: Marketplace** panel. To find this icon, see [Discovering the UI](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui). 2. In the panel’s search field, type _Anypoint_ to locate **Anypoint Extension Pack** in the list of installed extensions. - If the extension pack is _not_ installed, follow the installation steps at [Set up Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb#set-up-desktop). - If the extension pack is installed but the MuleSoft icon is not present in the Activity Bar, see [MuleSoft Icon Missing from Activity Bar](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-missing-features#missing-mulesoft-icon) to display the icon. ## Maven 401 Unauthorized Error If Maven fails to download dependencies with a 401 Unauthorized error when opening or building a MuleSoft project, configure authentication for the MuleSoft Enterprise Repository. See [Authenticating to MuleSoft Repositories](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-maven#authenticating-to-mulesoft-repositories) for instructions on configuring your credentials. ## Settings Sync Overwrites Home Directory on a New Computer When you sync your VS Code profile to a new computer, all profile settings are transferred, including the **Mule: Home Directory** setting. If the username on the new computer differs from the one on the original computer, the synced path is invalid, and the extension fails to load with an error like the following: Error: EPERM: operation not permitted, mkdir 'C:\\Users\\\\AnypointCodeBuilder\\java\\jdk-17.0.13+11' To fix this issue, update the **Mule: Home Directory** setting on the new computer to the correct path for that machine. See [Mule: Home Directory](https://docs.mulesoft.com/anypoint-code-builder/ref-mule-settings#setting-home-dir). To prevent this issue when syncing profiles across computers with different usernames, exclude the `mule.homeDirectory` setting from VS Code settings sync by adding the following to your `settings.json`: ```json "settingsSync.ignoredSettings": [ "mule.homeDirectory" ] ``` ## Disable Components to Isolate Issues When debugging a flow, you can disable (comment out) individual components directly in the canvas. This allows you to isolate and test parts of your logic without removing or rewriting anything. For example: - Temporarily disable a Transform or Logger to test a different path. - Comment out an entire flow or error handler to simplify the execution logic. - Disable MUnit test processors to troubleshoot specific assertions. To disable a component: 1. Right-click it in the canvas. 2. Select **Disable Component**. Disabled components are unavailable in the canvas and are ignored at runtime. In the code editor, the block is wrapped in an XML comment. Once the issue is resolved, you can re-enable the component or use Delete to remove disabled items. ## View Error Messages and Warnings in the Canvas Anypoint Code Builder shows validation issues directly in the canvas to help you resolve problems faster. Hover over a component to see a tooltip listing errors and warnings, along with affected field names. The configuration sidebar also displays validation messages at the node level. Field-level errors appear inline during component configuration. Hover over a component with a red dot to view error details in the canvas. ## Perform a Clean Reinstallation If you experience persistent issues that other troubleshooting steps don’t resolve, perform a clean reinstallation of Anypoint Extension Pack: 1. Close VS Code completely. 2. Uninstall Anypoint Extension Pack: 1. Open VS Code. 2. From the Activity Bar, open the **Extensions** panel. 3. Find and select **Anypoint Extension Pack**. 4. Click **Uninstall**. 5. Close VS Code. 3. Delete the `anypoint-code-builder` folder from your user directory: - Mac: `~/AnypointCodeBuilder` - Windows: `C:\Users\\AnypointCodeBuilder` 4. Optionally, delete cached extension data from the VS Code extensions folder: - Mac: `~/.vscode/extensions/` - Windows: `C:\Users\\.vscode\extensions\` Remove any folders starting with `salesforce.mule-dx-` or `mulesoftinc.mule-dx-`. 5. Reopen VS Code and reinstall Anypoint Extension Pack from the Extensions Marketplace. > [!NOTE] This procedure removes downloaded Mule runtime versions and Java versions. You can > re-download them after reinstalling. ## See Also - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Troubleshooting AI Features in Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following errors can occur when you use MuleSoft Vibes in Anypoint Code Builder. ## Required Permissions for MuleSoft Vibes MuleSoft Vibes always uses the permissions of the logged-in Anypoint Platform user. MuleSoft Vibes can’t perform any action that the user doesn’t already have permission to perform. Here are the permissions required across capabilities in the MuleSoft MCP Server: Required Permissions **Anypoint Monitoring** \* Monitoring Viewer **API Manager** \* Manage APIs Configuration \* Manage Policies \* View APIs Configuration \* View Policies **Exchange** \* Exchange Administrator \* Exchange Contributor \* Exchange Creator \* Exchange Viewer **General** \* View Organization \* View Connected Applications **Runtime Manager** \* Read Applications \* Create Applications \* Read Runtime Fabrics \* CloudHub Network Viewer **Usage** \* Usage Viewer To configure MuleSoft Vibes with a different set of permissions, you must: 1. Remove or disable the out-of-the-box MuleSoft MCP Server. 2. Follow the steps in the [MuleSoft MCP Server documentation](https://docs.mulesoft.com/mulesoft-mcp-server/getting-started#set-up-authentication) to set up a connected app with the desired permissions. ## AI Features Not Enabled for Your Organization If you see the message `AI features are not enabled for your organization`, your Anypoint Platform organization is not linked to a Salesforce organization with an active generative AI license, or Einstein is not enabled. To resolve this error, verify: - Your Anypoint Platform organization is connected to a Salesforce organization with generative AI enabled. For setup instructions, see [Connecting a Trusted Salesforce Organization to Anypoint Platform](https://docs.mulesoft.com/access-management/connecting-salesforce-orgs) and [Salesforce Organization Connections in Anypoint Platform](https://docs.mulesoft.com/access-management/trusted-salesforce-org). - Einstein is enabled in Access Management. See [Enabling or Disabling Generative AI for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). > [!NOTE] If you are a MuleSoft customer without an existing Salesforce organization, contact your > MuleSoft account team to provision an Einstein-enabled Salesforce organization. > [!NOTE] If the **MuleSoft > Anypoint Platform Setup** option is not visible in Salesforce or you > encounter a "Page not found" error, the **Enable Flow API Actions** permission may not be enabled > for your Salesforce organization. Contact MuleSoft Support with your Salesforce Org ID to request > this permission. For setup instructions, see > [Connecting a Trusted Salesforce Organization to Anypoint Platform](https://docs.mulesoft.com/access-management/connecting-salesforce-orgs). ## Unexpected Results When Using Mulesoft Vibes If the generated flow doesn’t return accurate or useful results for your message, try rewriting your message and follow the guidelines to [write an effective message](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations#craft-ai-prompt). If results are still inconsistent, verify that your project context and Mulesoft Vibes settings are correctly configured. ## HTTP 409 Conflict Error If you receive an HTTP 409 Conflict error when initializing or prompting MuleSoft Vibes, the error indicates a configuration mismatch between Anypoint Platform and Salesforce. To resolve this error, verify: - Your Anypoint Platform organization is linked to a Salesforce organization. See [Connecting a Trusted Salesforce Organization to Anypoint Platform](https://docs.mulesoft.com/access-management/connecting-salesforce-orgs) and [Salesforce Organization Connections in Anypoint Platform](https://docs.mulesoft.com/access-management/trusted-salesforce-org). - Einstein is enabled in Access Management. See [Enabling or Disabling Generative AI for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). - You have the **Mule Developer Generative AI User** permission. See [Anypoint Code Builder Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions). ## Vibes Features are Unresponsive or Fail to Load If MuleSoft Vibes features aren’t working as expected, verify that your system points to the JDK used by Anypoint Code Builder. ### Configure JAVA\_HOME on macOS 1. Identify the path where Anypoint Code Builder has installed the JDK. It typically follows this pattern: /Users//AnypointCodeBuilder/java//Contents/Home 2. Open your shell profile (usually `~/.zshrc` for Zsh or `~/.bash_profile` for Bash) in a text editor: ```bash nano ~/.zshrc ``` 3. Add these lines, replacing `` with the path identified in the previous step: ```bash export JAVA_HOME="" export PATH="$JAVA_HOME/bin:$PATH" ``` 4. Save the file and reload the profile: ```bash source ~/.zshrc ``` 5. Verify the configuration by running `echo $JAVA_HOME` and `java -version`. ### Configure JAVA\_HOME on Windows 1. Identify the path where Anypoint Code Builder has installed the JDK. It typically follows this pattern: C:\\Users\\\\AnypointCodeBuilder\\java\\ 2. Open Windows Search, enter `Edit the system environment variables`, and then select **Environment Variables**. 3. In **User variables** or **System variables**, create or update `JAVA_HOME` with your JDK path. 4. Update the `Path` variable and add this line: %JAVA\_HOME%\\bin 5. Open a new Command Prompt and verify the configuration: ```bash echo %JAVA_HOME% java -version ``` ## Token and Quota Errors ### Prompt Size Exceeds the Token Limit If you see the error `Prompt size exceeds the token limit when PII is enabled`, the Einstein Trust Layer’s PII detection and masking is active and is expanding the size of your prompt beyond the model’s token limit. To resolve this error, you must: - Start a new chat session to clear the conversation history. - Remove large project folders or files from the attached context. - Break your request into smaller, more focused prompts. ### Salesforce Connection Error If MuleSoft Vibes returns a `[SALESFORCE] Connection error`, the Salesforce AI model has reached its daily request or token limit for your session. To resolve this error, you must: - Start a new chat session to reset your token usage. - Wait for the daily limit to reset, then retry. - Contact your Anypoint Platform organization administrator if the error persists. ## Java 17 Connector Compatibility Errors If MuleSoft Vibes generates a flow and you then see an `Unsupported class file version` build error, the generated `pom.xml` may reference connector versions that are not compatible with Mule runtime 4.6 and later, and Java 17. To resolve this error, update the connector version in your `pom.xml` to a version that supports Java 17, and rebuild the project. ## See Also - [Log in to Anypoint Platform](https://docs.mulesoft.com/anypoint-code-builder/start-acb#log-in-to-anypoint-platform-from-the-ide) - [Anypoint Code Builder Permissions](https://docs.mulesoft.com/anypoint-code-builder/start-configure-permissions#permissions) - [Creating Integrations with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-create-integrations) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Anypoint Code Builder version: master --- # Try Scope () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Handle errors that might occur during the execution of components inside the scope. The Try scope catches and handles exceptions thrown by the components that you add to the scope. Error handling within the scope is similar to error handling within a Flow component. Instead of configuring a separate flow, you can use Try within a Flow component. Every payload modification or variable addition, modification, or removal is propagated through the rest of the execution. This propagation includes modifications that take place inside the error handlers. The Try scope supports transactions. A transaction is a series of actions that must execute successfully. Configure components within the Try scope as a single unit that either succeeds or fails, depending on whether errors are propagated and the transaction rolled back, or handled and the transaction committed. In either case, the flow that contains the Try scope continues. ## Component XML This component supports the following XML structure: ```xml ``` Try scope (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Try (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Transaction type

transactionType

Specifies the type of transaction. Accepted values are:

  • LOCAL

    Default. A single or local transaction.

  • XA

    A transaction that groups operations from multiple resources and follows the Extended Architecture (XA) standard.

Transactional action

transactionalAction

Defines how to handle a transaction. Accepted values are:

  • Ignore (INDIFFERENT)

    Default. If a transaction is active, the scope joins it. If not, the scope does not create a transaction.

  • Always Begin (ALWAYS_BEGIN)

    A new transaction is started every time the scope is executed.

  • Begin or Join (BEGIN_OR_JOIN)

    Relevant only when execution order might vary (for example, due to asynchronous actions occurring outside the flow). If current flow processing has already started a transaction, the scope joins it. If not, the scope initiates a new transaction.

## Examples The following examples show how to configure the Try scope to handle transactions in different situations. ### Example: Different Transactional Actions in Try Scope The following example shows a `jms:listener` operation configured to initiate a transaction at flow level, a Try scope that tries to initiate or join the transaction (depending on its configuration), and a `jms:publish` operation configured to run outside of the transaction: ```xml ``` If the operations within the Try scope do not produce an error, the scope finishes the execution and commits the transaction, independently of the configured `transactionalAction` value. The transaction and the messages are handled differently when a `` component is added, depending on the `transactionalAction` of the Try scope: - Ignore (`INDIFFERENT`) In this case, the transaction continues while executing the operations inside the Try scope. When the error is raised, it is propagated to the source (which does not handle it with an `` error handler). The transaction is rolled back, and the message is available again in the JMS queue. This rollback does not affect the completed `jms:publish` operation, which was outside of the transaction scope because `transactionAction` was set to its default, `NOT_SUPPORTED`. Had `transactionAction` been set to `JOIN_IF_POSSIBLE`, the `jms:publish` operation would have been rolled back. - Always Begin (`ALWAYS_BEGIN`) This raises an error because an active transaction already exists. - Begin or Join (`BEGIN_OR_JOIN`) In this case, a transaction was already initiated so the scope joins the active transaction. The result is the same as in `INDIFFERENT`. ### Example: Error Handling at Flow Level The following example includes an error handler at flow level: In the following example, an error handler is added at flow level: ```xml ``` The behavior in this example is: - Ignore (`INDIFFERENT`) The transaction continues. Because the error is handled by an `on-error-continue` error handler, the transaction is committed. The message read from the `jms:listener` source is consumed, and the message processed by the `jms:publish` operation is actually sent. - Always Begin (`ALWAYS_BEGIN`) Raises an error because an active transaction already exists. - Begin or Join (`BEGIN_OR_JOIN`) Displays the same behavior as `INDIFFERENT`. ### Example: Error Handling Inside the Try Scope In the following example, the error handler is inside the Try scope and the error occurs after the execution of the scope: ```xml ``` Depending on the configured `transactionalAction`, the behavior in the Try scope is one of the following: - Ignore (`INDIFFERENT`) The transaction continues but the error is not handled by an `on-error-continue` at the flow level, causing the transaction to be rolled back, and the message to not be sent. - Always Begin (`ALWAYS_BEGIN`) Raises an error because an active transaction already exists. - Begin or Join (`BEGIN_OR_JOIN`) Displays the same behavior as `INDIFFERENT`. ## Error Handling When designing your flow, group those operations that are likely to experience errors inside a Try scope. The Try scope enables you to isolate potentially troublesome operations in your flow and assign them an error-handling method. You can also configure the operations inside the Try scope to be processed as a transaction. The Try scope has an error handling strategy that you configure in the same way you configure error handling for a flow. The Try scope can distinguish among various error type conditions and apply different behaviors. If an error is raised by a component inside a Try scope, then the Try scope’s error handler is executed. At this point, the error is available for inspection, so the handlers can execute and act accordingly: - On Error Continue Executes and sends the result of the execution to its container Try scope, which uses that result to complete the execution successfully. Any transactions at this point are also committed. - On Error Propagate Rolls back any transactions, then executes and uses that result to re-throw the existing error, causing its container Try scope’s execution to fail. ## See Also - [Single Resource Transactions](https://docs.mulesoft.com/mule-runtime/latest/single-resource-transaction) - [XA Transactions](https://docs.mulesoft.com/mule-runtime/latest/xa-transactions) --- product: Anypoint Code Builder version: master --- # Tutorials > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Learn how to design, implement, integrate, and deploy APIs with Anypoint Code Builder. Work through these numbered product topics to move from API specification design to a deployed Mule application. For end-to-end walkthroughs that focus on one scenario each, see [Hands-On Tutorials](#hands-on-tutorials). ## Take Your API Specification from Design Through Deployment The following topics guide you step by step from API specification design to publishing the contract on Anypoint Exchange, building and configuring integration flows, importing and scaffolding the API into a Mule interface, and deploying the application to CloudHub or CloudHub 2.0. 1. [Designing API Specs and Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-designing-api-specs) for supported languages and the overall design workflow. 2. [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs), including the API Console and mocking service. 3. Optionally [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) for reusable types and examples from Anypoint Exchange. 4. [Publishing API Projects to Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange) so your team can discover and implement the contract. 5. [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) and [Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components) in your flows. 6. [Using DataWeave Expressions and Transformations](https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions) to map, reshape, or validate data between connectors, processors, and your API layer. 7. [Implementing OAS, RAML, AsyncAPI, and GraphQL APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs) Import your API specification from Exchange, scaffold it into an interface in your project, then wire flows to your implementation. 8. [Developing Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-developing-integrations), including [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) and [Deploying Mule Apps to CloudHub and CloudHub 2.0](https://docs.mulesoft.com/anypoint-code-builder/int-deploy-mule-apps). ## Hands-On Tutorials Each linked tutorial is a self-contained walkthrough that applies Anypoint Code Builder to one integration style, API technology, or connector story from start to finish. - [Iteratively Design and Implement an API Specification](https://docs.mulesoft.com/anypoint-code-builder/tut-local-api-specification): Scaffold an API specification into an interface to implement, and sync changes to the specification with the interface without first publishing to Anypoint Exchange. For example, after adding a new endpoint to your API specification, you can re-scaffold the change into the interface to add a flow for that endpoint to the interface’s configuration XML file. - [Implement a GraphQL API](https://docs.mulesoft.com/anypoint-code-builder/tut-graphql-implement-api): Implement a GraphQL API that you publish to Exchange. - [Integrate Salesforce Data into Slack and Email Notifications](https://docs.mulesoft.com/anypoint-code-builder/tut-slack-create-escalation-api): Create an integration that notifies you through email or Slack when a new case is created in Salesforce. - [Build an API from Start to Finish with Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-api-tutorial): Design, implement, debug, test, deploy, and secure a database-backed REST API from start to finish, using the American Flights API as an example. --- product: Anypoint Code Builder version: master --- # Until Successful () > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Executes processors inside its scope, in order, until they all succeed or the scope exhausts the maximum number of retries. Until Successful runs synchronously. If any processor within the scope fails to connect or to produce a successful result, Until Successful retries all the processors within it, including the one that failed, until all configured retries are exhausted. If a retry succeeds, the scope proceeds to the next component. If the final retry does not succeed, Until Successful produces an error. Routing is successful if no exception is raised or if the response matches an expression. Common processes that use Until Successful include: - Dispatching to outbound endpoints, for example, when calling a remote web service that might have availability issues - Executing a component method, for example, when executing on a Spring bean that might depend on unreliable resources - Using a Subflow component (``) to re-execute several actions until they all succeed ## Component XML This component supports the following XML structure: ```xml ``` Until Successful (``) attributes are configurable through the UI and XML.
Attribute NameAttribute XMLDescription

Until successful (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Max retries

maxRetries

Maximum number of retries allowed. This attribute can be either a number or an expression that resolves to a number. Error messages look like this: Message: 'until-successful' retries exhausted. The Mule error type is MULE:RETRY_EXHAUSTED.

Millis between retries

millisBetweenRetries

Specifies, in milliseconds, the minimum interval between two retries. The length of the interval is affected by a previous execution but typically does not exceed twice the minimum. This attribute can be a number or an expression that resolves to a number. Defaults to 60000 milliseconds (one minute).

## Variable Propagation Every execution of the Until Successful scope starts with the same variables and values present before the execution of the block, even if an error occurs within the scope before the maximum number of retries is exhausted. New variables or modifications to already-existing variables while processing one element are not present when the scope executes. If the execution finishes successfully, the variables (and payload) are propagated to the rest of the flow. ## Example Configuration of the Until Successful Scope The following XML example configures a flow triggered by a Scheduler component and an Until Successful scope that executes an FTP Write operation: ```xml ``` Behavior of the example application: - If the FTP Write operation fails, Until Successful scope retries the operation every `3000` milliseconds until the operation succeeds, with a limit of `5` retries. If the last execution fails, the scope throws a `MULE:RETRY_EXHAUSTED` error. Then the `` handles the error and executes the Logger with the message `File upload failed`. Before throwing `MULE:RETRY_EXHAUSTED`, Mule also logs each unsuccessful attempt to retry execution of the processors on the Mule event, for example: ```logs ERROR 2022-12-09 17:41:44,910 ... event: cdad31c0-782b-11ed-af21-147ddaaf4f97] ...UntilSuccessfulRouter: Retrying execution of event, attempt 1 of 5. ... ERROR 2022-12-09 17:41:55,079 ... event: cdad31c0-782b-11ed-af21-147ddaaf4f97] ...UntilSuccessfulRouter: Retrying execution of event, attempt 5 of 5. ``` - If the FTP Write operation executes successfully in any of the attempts, the next processor after the Until Successful scope executes. In this example, the Logger executes with the message `File upload success`. ## See Also - [How Transactions Affect Scopes and Routers](https://docs.mulesoft.com/mule-runtime/latest/transaction-management#tx_scopes_routers) --- product: Anypoint Code Builder version: master --- # Using a Proxy in Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Execute network-dependent functions in Anypoint Code Builder, such as publishing to Exchange, logging into Anypoint Platform, and running or debugging applications, by configuring your proxy settings in Visual Studio Code (VS Code). ## Before You Begin Configuring Your Proxy Take into account these considerations before configuring your proxy setting in VS Code: - When setting a proxy URL, the `protocol` can be `HTTP` or `SOCKS`. For example: - PROTOCOL://username:password@host:port - PROTOCOL://host:port > [!NOTE] Anypoint Code Builder supports `SOCKS` proxies without authentication but doesn’t > support `SOCKS` proxies with basic authentication. - Anypoint Code Builder ignores these fields and reads settings from the proxy URL and the no-proxy list: - Proxy Authorization - Proxy Kerberos Service Principal - Proxy Strict SSL - To exclude certain hosts from the proxy, use the **Proxy bypass** settings. ## Configure Your Proxy Settings in VS Code To configure your proxy settings for Anypoint Code Builder: 1. Open VS Code. 2. Open VS Code settings: 1. In Windows, go to **File > Preferences > Settings**. 2. In macOS, go to **Code > Settings > Settings**. 3. Search for "proxy" in the settings search bar. 4. Configure your proxy URL and no-proxy settings. 5. Configure your proxy settings in your Maven `settings.xml` file. See [Configure a Proxy in Maven](https://maven.apache.org/guides/mini/guide-proxies.html) for configuration instructions. 6. Set the 'Proxy Support' setting to 'override' or 'on'. 7. Restart VS Code to apply your changes. ## Add Anypoint Platform URLs to an Allowlist If your organization uses an allowlist, add these Anypoint Code Builder and Anypoint Platform URLs:
MuleSoftURL

Anypoint Platform services: CloudHub, Exchange, Core Services

  • https://(*).anypoint.mulesoft.com (/*)

  • https://repository.mulesoft.org/(*)

  • https://(*).cloudhub.io/(*/)

Assets downloaded from Exchange

  • https://exchange2-asset-manager-kprod.s3.amazonaws.com (/*)

  • https://exchange2-asset-manager-kprod-eu.s3.eu-central-1.amazonaws.com (/*)

Resources for API Portals

  • https://exchange2-file-upload-service-kprod.s3.amazonaws.com (/*)

Third PartyURL

Eclipse libraries and Eclipse update sites

  • https://download.eclipse.org/eclipse/updates (/*)

MuleSoft Maven repositories and connectors update site

  • https://repo.maven.apache.org/maven2 (/*)

  • https://repo1.maven.org/maven2 (/*)

> [!NOTE] For services that use the web browser, such as the **Login** or **Exchange** operations, > refer to the browser documentation to learn about the browser network requirements. If you use an > external identity provider (IdP), you must also grant permission to other third-party domains. --- product: Anypoint Code Builder version: master --- # Using DataWeave Expressions and Transformations in Anypoint Code Builder > For the full documentation index, see: https://docs.mulesoft.com/llms.txt DataWeave is the MuleSoft programming language for data transformation and for defining expressions. Use DataWeave to process Mule event data, such as `payload`, `attributes`, and `vars`, in connector operations and other components. Develop DataWeave expressions and transformations in your Mule applications using the **Expression Field**, **Expression Builder**, or **Transformation Builder**, or in the code editor. Generate DataWeave transformations with AI help by providing input and output sample data, metadata, or both. AI-powered auto mapping provides comprehensive error feedback for GenAI actions, including authorization, metadata, and request limits, ensuring a more reliable and guided mapping experience. ![A configuration panel showing three numbered callouts: 1) fx button for Expression Field, 2) Expression Builder button, and 3) Transformation Builder button](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-transform-ui.png)
1Expression Field: Enters a DataWeave expression or script in a component configuration panel.
2Expression Builder: Creates and manages expressions within your Mule applications.
3Transformation Builder: Creates DataWeave transformations in your Mule applications in a visual interface assisted by AI.
Implementations and integrations in Anypoint Code Builder create Mule apps that run on an instance of the Mule runtime engine. Anypoint Code Builder integrates DataWeave expressions and transformations into the Mule app development process and supports these features: - Hierarchical mapping - Object-to-object and array-to-array transformations - Concatenation of strings, numbers, and booleans - Type conversions - Custom metadata for inputs and outputs - [Namespace-aware generated scripts](#namespaces-in-generated-dataweave) when metadata defines namespaces (for example, qualified XML from a schema or sample) Anypoint Code Builder supports these transform mapping use cases: - `Object` to `Object` - `Primitive` to `Primitive` - `Object` to `Primitive` - `Primitive` to `Object` - `Object` to `Array` - `Array` to `Object` - Type conversion `Object` to `Object` - Concatenation of simple fields - `Array` to `Array` (same level) ## Before You Begin - Understand the functions, operators, variables, and selectors of DataWeave expressions. For more information, see [DataWeave Reference](https://docs.mulesoft.com/dataweave/latest/dw-functions). - Review the built-in documentation for functions that Anypoint Code Builder provides. For example, see [List DataWeave Functions and Get Documentation](#tab-functions). - [Predefined Mule event variables](https://docs.mulesoft.com/dataweave/latest/dataweave-variables-context) such as `payload`, `attributes`, `vars`. - [DataWeave selectors](https://docs.mulesoft.com/dataweave/latest/dataweave-selectors) for capturing the values of fields within the payload, an attribute, or a variable within the [Mule event](https://docs.mulesoft.com/mule-runtime/latest/about-mule-event). For more resources, see [DataWeave Overview](https://docs.mulesoft.com/dataweave/latest/). - Make sure you have these permissions to use the Anypoint Code Builder AI feature: - Anypoint Code Builder Developer - Mule Developer Generative AI User - Enable Einstein in Access Management. For more information, see [Enabling Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). - AI-assisted features support multiple languages. - If you have issues with the AI-assisted transformations, see [Troubleshoot AI-Assisted Transformations](#troubleshoot-ai-assisted-transformations). ## Open the Expression Field Most connector operations and components provide at least one field that accepts DataWeave expressions and scripts. In the configuration panel for a component, the **fx** button indicates that the field accepts an expression. In the code editor, these fields have the `#[]` markup. Expression fields accept DataWeave expressions, including DataWeave functions and Mule event data, such as `payload`, `attributes`, and `vars`. To open a component expression field (**fx**): 1. Open a component that accepts expressions from the canvas in your implementation or integration project. 2. Click **fx** to change the field from a string field to an expression field. ![Set Variable component configuration panel with the \*fx\* button highlighted next to the \*Value\* field](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-field-set-variable.png) The markup `#[]` in the **fx** field also appears in the code editor to indicate that the field is for an expression. 3. Click **Expression Builder** to configure the component. ![\*Expression Builder\* interface shows the \*Data\*, \*Functions\*, and \*Preview\* tabs for building DataWeave expressions in the \`Set Variable\` component](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-expression-builder.png) Use the **Data**, **Functions**, and **Preview** tabs to ease configuration of expressions in your components. Select custom metadata for the payload, attributes, and Mule variables. Preview the expression output without running your Mule app with data from external sources: - [Check the Data Structure](#tab-data) - [List DataWeave Functions and Get Documentation](#tab-functions) - [Preview Output of DataWeave Expressions](#tab-preview) ## Open Expression Builder **Expression Builder** simplifies the process of creating and managing expressions within your Mule applications. The builder provides a visual interface to create DataWeave expressions and transformations. ### Check the Data Structure To review the data structure of the Mule event, including the payload, attributes, and Mule variables, use the **Data** tab. The tab includes any sample data and custom metadata and is part of **Expression Builder** for a component **fx** field. For example:
Data tab (with automatically generated data)Data tab (expanded)

Data tab for expression field

Data tab for expression field with mock attributes

Anypoint Code Builder shows the automatically generated strings as mock values and uses them to generate output for previews, such as in the [Preview](#tab-preview) tab. The attribute metadata keys in the example come from the configuration of an `HTTP Listener` component in the flow. ### Set Component Custom Metadata on the Metadata or Data Tab The **Metadata** tab shows the structure of data entering (**Input**) and exiting (**Output**) components. For example: ![Metadata tab for a component](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-input-output-sample.png) From the **Metadata** tab or the **Data** tab of **Expression Builder**, manage component metadata by setting, clearing, or editing custom definitions for inputs and outputs. Each payload, attribute, or variable supports only one custom metadata assignment at a time. To set custom metadata from the **Metadata** tab or the **Data** tab of **Expression Builder**: 1. Click **No metadata selected** if metadata isn’t already set or click the name of the custom metadata. If default metadata is being used, click **Default**. 2. Click **Set Custom Metadata**. 3. Select, edit, or preview existing custom metadata or create new custom metadata. See [Create Custom Metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#create-custom-metadata) for more information about creating custom metadata. See [Edit Custom Metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#edit-custom-metadata) for more information about editing custom metadata. 4. Click **Apply and Close**. To clear custom metadata, click the name of the custom metadata and then click **Clear Custom Metadata**. The metadata is cleared from the component. ### List DataWeave Functions and Get Documentation To get a list of available functions from a component **Functions** tab, the **fx** field, or the auto complete menu in the code editor: 1. Open a component that has the **fx** expression field. For guidance, see [Open the Expression Field](#open-fx-field). 2. List available functions: - To show a list of DataWeave functions from the `Core` module from an empty **fx** field, press Ctrl+Space in an _empty_ **fx** field. For example: ![DataWeave autocomplete dropdown menu showing available Core module functions like abs, avg, ceil, and floor with their descriptions](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-field-autocomplete.png) - To show functions from all [DataWeave modules](https://docs.mulesoft.com/dataweave/latest/dw-functions#dw_modules), such as `String`, `Array`, and `Core` modules: 1. Click the **fx** field to open **Expression Builder**. 2. Click the **Functions** tab.
DataWeave FunctionsFunction Reference

Hover over a function to get a short description:

Expression Builder Functions tab displaying categorized DataWeave functions including Array, Core, Object, and String modules with search functionality

Click Details to get complete documentation:

Function details popup showing complete documentation for a DataWeave function including syntax, parameters, and usage examples

### Preview Output of DataWeave Expressions Preview output of DataWeave expressions from the canvas or from the code editor. The preview feature acts on sample data that you provide in the **fx** (expression) field in the code editor for the payload (`payload`) or Mule variables (for example, `vars.somevar`). To provide your own sample data, see [Provide Sample Data for a DataWeave Expression](#sample-data). - [Preview Results in the UI](#preview-results-fx) - [Preview Results from the Code Editor](#preview-results-xml) #### Preview Results in the UI Preview auto generated sample data, or preview your own sample data. Preview the output in the **Preview** tab of **Expression Builder** for a component expression field.
Preview Auto Generated Sample DataPreview Your Sample Data

Output results from auto generated sample data:

Expression Builder Preview tab showing the output of a DataWeave expression with automatically generated sample data

Outputs results from an expression with user-created sample data:

Expression Builder Preview tab displaying the evaluated result of a DataWeave expression using user-provided sample data

You can apply DataWeave selectors and functions to your sample data. To create sample data that has the structure and data types you expect, see [Provide Sample Data for a DataWeave Expression](#sample-data). #### Preview Results from the Code Editor To preview the results from the code editor, hover over your DataWeave code, click the **Show Code Actions** icon, and click **Run Preview**: ![Code Actions menu in the code editor with 'Run Preview' option highlighted for executing DataWeave expressions](/mulesoft/current/en-us/anypoint-code-builder/_images/function-validation-run-preview.png) Anypoint Code Builder opens a new **Preview Output** tab with the result of the function: ![Preview Output tab showing the executed result of a DataWeave function with JSON formatted output](/mulesoft/current/en-us/anypoint-code-builder/_images/dataweave-function-preview-output.png) ## Open Transformation Builder Create DataWeave transformations in your Mule applications with **Transformation Builder**, assisted by Einstein generative AI. Provide input and output sample metadata or data to generate DataWeave scripts. Use the drag-and-drop mapping in **Transformation Builder** for straightforward mappings, as it supports nested arrays, multi-level mappings, field concatenation, and automatic type casting. For complex logic, such as conditional branching or custom functions, switch to the script editor. ![The \*Transformation Builder\* window and its sections highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-transform-builder-ui.png) ### Customize the Transformation Builder Layout Customize **Transformation Builder** to make the workspace match your mapping and scripting needs. Collapse and expand the **Input Preview** and **Output Preview** sections independently, resize the vertical spacing between the input and output mapper areas, and adjust the **Script** panel for better code visibility. These layout controls provide more flexibility when working with complex transformations and large metadata tree structures because you can focus on the section you need most at each step. On **Transformation Builder**, select the option that best suits your needs: - [Map with AI](#map-with-ai) - [Map and Transform with AI](#map-and-transform-with-ai) ### Namespaces in Generated DataWeave Scripts If your input or output metadata includes namespace URIs, Anypoint Code Builder updates the generated DataWeave script for visual mapping to XML and similar targets, adds `ns` directives to the script header for each URI that needs a declaration, and maps fields using qualified names with a generated prefix. Prefixes are unique in the script (such as `ns0`, `ns1`), and Anypoint Code Builder reuses any existing `ns` line if it binds the same URI. Namespace handling applies to AI-assisted mapping and manual drag mapping in **Transformation Builder**. It also applies to other flows that generate scripts from metadata, for MIME types where the type system exposes namespaces. Provide accurate [custom metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata) or sample data so element namespaces are present in the structure the builder uses. If you declared namespaces in the header, the tooling preserves those declarations when it updates the output section of the script where supported. For the DataWeave language rules that govern `ns` directives and qualified keys, see [DataWeave formats](https://docs.mulesoft.com/dataweave/latest/dataweave-formats) and [DataWeave documentation](https://docs.mulesoft.com/dataweave/latest/). ### Considerations for AI-Assisted Transformations If using AI-assisted transformations, evaluate these considerations: - To generate a DataWeave script using **Map and Transform with AI**, provide input and output samples. While optional, providing metadata helps AI understand the data structure and improves the accuracy of the transformation. - Sample data provides the context to generate functions or expressions for calculations, conditions, and other operations. You can provide Web Services Description Language (WSDL) files with sample data. See [Provide Sample Data for a DataWeave Expression](#sample-data) for supported data formats (MIME types) for sample data. - For field-to-field mapping using **Map with AI**, provide both input and output metadata. Use **Map with AI** even when a DataWeave script is already present in the component. Click **Map with AI** to trigger it. - AI requires valid data to create the transformation script. Write it manually if needed. - AI chat history isn’t available in **Transformation Builder**. - Avoid using real personally identifiable information (PII) in sample data or AI inputs. Provide input and output sample data that contains only fictional or masked data. - AI-assisted transformations provide comprehensive error feedback for GenAI actions. If you encounter errors related to authorization, metadata, or request limits, the error messages guide you to resolve the issue. See [Troubleshoot AI-Assisted Transformations](#troubleshoot-ai-assisted-transformations) for detailed troubleshooting steps. ### Map with AI The **Map with AI** feature suggests a field-to-field mapping using AI-powered auto mapping. Click **Map with AI** to trigger it. Use it even when a DataWeave script is already present in the component. Provide both input and output metadata for the component. Mapping is performed based on the metadata you provide. **Map with AI** provides comprehensive error feedback for GenAI actions, including authorization errors, metadata issues, and request limits. If you encounter errors during the mapping process, see [Troubleshoot AI-Assisted Transformations](#troubleshoot-ai-assisted-transformations) for detailed guidance on resolving specific error types. If you don’t have access to **Map with AI**, you must: - Make sure your configuration meets the prerequisites for using AI-assisted transformations. See [Before You Begin](#prereq-dw-transforms). - Review that the provided input and output metadata are valid. 1. Open your Mule project. 2. Select a component that has a **fx** field. 3. Open **Transformation Builder**. ![Transformation Builder showing 'Fetching metadata' status message with loading indicator for AI-assisted mapping functionality](/mulesoft/current/en-us/anypoint-code-builder/_images/int-map-with-ai.png) 4. Click **Map with AI** to start the mapping. Provide both input and output metadata if not already provided. The mapping is applied to the XML file, and the **Preview** tab shows the output of the transformation. 5. After the mapping is complete, you must: 1. Click **Apply Mapping** to apply suggested mapping to your project. 2. Click **Revise Mapping** to get new suggestions from the AI. ### Map and Transform with AI Create a DataWeave transformation script assisted by AI by providing input and output sample data. You can also provide optional metadata to help define the data structure and instructions to guide the AI. 1. Open your Mule project. 2. Select a component that has a **fx** field. 3. Open **Transformation Builder**. ![Transformation Builder showing 'Fetching metadata' status message with loading indicator for AI-assisted mapping functionality](/mulesoft/current/en-us/anypoint-code-builder/_images/int-map-with-ai.png) The mapping starts automatically considering the data provided. The mapping is applied to the XML file. 4. Click **Map and Transform with AI**. 5. Provide this information if needed, or modify it as needed: - **Input sample** data - **Output sample** data - Optional instructions to guide the AI > [!NOTE] If modifying the input and output sample data, provide the same information to help > the AI understand the intended transformation. The input data can come from payloads, > attributes, or variables. 6. Click **Transform**. Einstein AI analyzes your input and output samples, and the instructions, if any, to generate DataWeave script suggestions that aim to perform the suggested transformation. 7. Click **View Suggested Scripts** to insert one if appropriate, or copy the suggested script to the clipboard without losing its format. After inserting a script, the XML file is updated, and you can regenerate the script by clicking **Revise**. ### Troubleshoot AI-Assisted Transformations AI-assisted transformations in **Transformation Builder** provide comprehensive error feedback to help you resolve issues. Error messages indicate the type of error and provide guidance to resolve it. If you encounter errors when using AI-assisted transformations, identify the error type and follow the corresponding resolution steps: - [Authorization Errors](#troubleshoot-authorization-errors) - [Metadata Errors](#troubleshoot-metadata-errors) - [Request Limit Errors](#troubleshoot-request-limit-errors) - [General AI Errors](#troubleshoot-general-ai-errors) #### Authorization Errors Authorization errors occur when your Anypoint Platform account lacks the required permissions or when Einstein generative AI isn’t properly configured for your organization. If you receive an authorization error: 1. Verify that you are logged in to Anypoint Platform from Anypoint Code Builder. For more information, see [Log in to Anypoint Platform](https://docs.mulesoft.com/anypoint-code-builder/start-acb#log-in-to-anypoint-platform-from-the-ide). 2. Contact your Anypoint Platform organization administrator to verify: - You have the **Mule Developer Generative AI User** permission assigned in Anypoint Platform access management. - Einstein generative AI is enabled for your organization. For more information, see [Enabling Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai). - You have accepted the terms and conditions for using Einstein generative AI. - Your Anypoint Platform organization is current and active. 3. If you are the organization administrator, verify that: - The Salesforce organization connected for requests has generative AI enabled. - The Salesforce organization has an [established tenant relationship](https://docs.mulesoft.com/access-management/trusted-salesforce-org) with your Anypoint Platform organization, and the connection is enabled. - The Salesforce organization is valid and not expired or disabled. #### Metadata Errors Metadata errors occur when the input or output metadata provided to **Map with AI** or **Map and Transform with AI** is invalid, missing, or improperly structured. If you receive a metadata error: 1. Verify that both input and output metadata are provided when using **Map with AI**. **Map with AI** requires both input and output metadata to perform automatic field-to-field mapping. 2. Check that your metadata structure is valid: - Ensure the metadata follows the expected schema format. - Verify that required fields are present in the metadata. - Confirm that data types match between input and output metadata where applicable. 3. Review the metadata source: - If metadata is generated from sample data, verify that the sample data structure is correct. - If metadata is imported from an API specification, verify the specification is valid and complete. - Refresh metadata by clicking **More Actions** in **Transformation Builder** and selecting **Refresh metadata**. 4. For **Map and Transform with AI**, verify that: - Input sample data is provided and valid. - Output sample data is provided and valid. - Sample data formats match the expected MIME types. See [Provide Sample Data for a DataWeave Expression](#sample-data) for supported formats. #### Request Limit Errors Request limit errors occur when you exceed the rate limits for GenAI API requests. These limits help ensure fair usage and system stability. If you receive a request limit error: 1. Wait before retrying your request: - The error message indicates when you can retry the request. - Avoid making multiple rapid requests in succession. 2. Reduce the frequency of AI-assisted transformation requests: - Batch multiple transformations when possible. - Use manual mapping for simple transformations to reduce API calls. 3. Contact your Anypoint Platform organization administrator if: - Request limits are consistently reached during normal usage. - You must understand your organization’s specific rate limits. 4. Consider alternative approaches: - Use **Manually Adding Data Sources and Targets** for straightforward mappings. See [Manually Adding Data Sources and Targets](#manually-add-data-sources-targets). - Write DataWeave scripts manually for complex transformations that don’t require AI assistance. #### General AI Errors If you encounter other errors with AI-assisted transformations: 1. Log in to Anypoint Platform and try again. 2. Verify that your Anypoint Platform organization has access to Einstein generative AI. 3. Ensure you have accepted the terms and conditions for using Einstein generative AI. 4. Check your network connection and try again. 5. If the error persists, contact your Anypoint Platform organization administrator or MuleSoft support. ### Manually Adding Data Sources and Targets You can manually add data sources and targets to your transformation script. 1. In the **Transformation Workspace** section, drag the source field from the input payload to the target field to map the source data to the target data. The mapped fields show a green dot and are highlighted to indicate that the mapping is successful. The **Script** section updates with the new mapping, and the **Output Preview** section displays the output of the transformation. If needed, map multiple source field to a target field, and then the Transform Builder concatenates them. To remove one mapping, see [Remove a Mapping](#remove-a-mapping). 2. Click **More Actions** to refresh metadata or remove all mappings. 3. Verify the input sample generated from the field mapping. You can select the generated sample or provide your own [sample data](#sample-data). ### Remove a Mapping Remove one mapping from **Transformation Builder**. **Remove Mapping** is available on every mapped node in the input and output metadata trees. > [!NOTE] The **Remove Mapping** action removes the mapping for that node and any functions applied > to the mapping. 1. In **Transformation Builder**, right-click a mapped node in the input or output metadata tree. 2. Select **Remove Mapping**. 3. Confirm the removal. Anypoint Code Builder removes the mappings for that node. The **Script** section updates, and the **Output Preview** section shows the transformation without those mappings. To remove every mapping at once, click **More Actions**. ### Set Custom Metadata in Transformation Builder In Transformation Builder, you can manage component metadata by setting, clearing, or editing custom definitions for inputs and outputs. Each payload, attribute, or variable supports only one custom metadata assignment at a time. To set custom metadata: 1. Click **No metadata selected** if metadata isn’t already set or click the name of the custom metadata. If default metadata is being used, click **Default**. 2. Click **Set Custom Metadata**. 3. Select, edit, or preview existing custom metadata or create new custom metadata. See [Create Custom Metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#create-custom-metadata) for more information about creating custom metadata. See [Edit Custom Metadata](https://docs.mulesoft.com/anypoint-code-builder/int-manage-custom-metadata#edit-custom-metadata) for more information about editing custom metadata. 4. Click **Apply and Close**. To clear custom metadata, click the name of the custom metadata and then click **Clear Custom Metadata**. The metadata is cleared from the component. ## Provide Sample Data for a DataWeave Expression Test and preview DataWeave expressions locally in Anypoint Code Builder. Add sample data for Mule variables such as `payload` in **fx** fields to preview outputs without running your application. For AI-assisted transformations, providing sample input and output data helps AI understand the intended transformation and generate the correct DataWeave scripts. You can create sample data in these formats: - JSON - XML - CSV - Java - Text - YAML - Avro - Excel - NDJSON - URL Encoded - Protobuf - Multipart > [!IMPORTANT] > > - To avoid errors when you run your app with real data, provide sample data that matches the basic > structure, format, and data type of the data the expression expects. > > - Your sample data is overwritten when you reopen the component from the canvas. To create sample data for a Mule variable: 1. Open your project. 2. In the code editor, hover over the Mule event variable (such as `payload`), for example: ![Code editor with cursor hovering over payload variable, showing Quick Fix for creating sample data](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-hover.png) 3. Click **Quick Fix** to open the **Quick Fix** menu. 4. Select **Create sample data for _your-value_**, such as **Create sample data for payload**, for example: ![Quick Fix menu displaying 'Create sample data for payload' option in the code editor context menu](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-create.png) 5. In the menu that opens, select a format, such as JSON, for the sample data. ![Sample data format selection menu showing options including JSON, XML, CSV, Java, Text, YAML, Avro, Excel, and other supported formats](/mulesoft/current/en-us/anypoint-code-builder/_images/dw-issue-sample-data-formats.png) Anypoint Code Builder opens a tab for your sample data. 6. Add content in the selected format to the sample data file. For example, for JSON: ![Project Explorer showing sample data files like payload.json stored in src/test/resources directory structure](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-example-dir.png) The file name is `payload.json`. Files for your sample data and for the automatically generated sample data is stored in the project directory `src/test/resources`. Custom sample data files should be created under `src/main/resources/user-sample-data`. See [Important](#important) before adding sample data. Hover over the value in the code editor to show the structure, data keys, and data types of your sample data, for example: ![Hover over XML to display sample data](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-example-hover-xml.png) 7. Preview your sample data in **Expression Builder**: 1. From the canvas, click the component that contains your sample data to open **Expression Builder** for that field. 2. Click **fx** of the component that has sample data to open **Expression Builder** for that field. 3. Click **Preview** to display the sample data. For example: ![Sample data preview in \*Expression Builder\*](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-example-preview.png) You can modify the value. For example, add DataWeave selectors or functions: ![Preview modified sample data](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-sample-quick-fix-example-preview-modified.png) The example now returns an array of `id` values. ## Address DataWeave Errors When your DataWeave code contains a syntactic or semantic error, Anypoint Code Builder highlights the error and offers a suggested fix. Issues include: - [Add a Missing Import Directive for a DataWeave Module](#fix-dw-add-import) - [Fix an Undefined Function Error](#fix-dw-error) ### Add a Missing Import Directive for a DataWeave Module Many DataWeave modules require an explicit `import` directive in the expression. Only the Core module doesn’t require this directive. For example, if you don’t import the string module to which this function belongs, the function `camelize( "hello world")` produces an error `Unable to resolve the reference of 'camelize'`. ```xml ``` **Expression Builder** identifies the error. For example: !['Import required' error](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-error-add-import.png) To fix this issue, click to add the import directive automatically, for example: ![Import required error](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-fx-error-fix-import.png) The XML for the fix is similar to this example: ```xml ``` ### Fix an Undefined Function Error Anypoint Code Builder flags undefined functions automatically. For example, in this code, DataWeave flags an error with `toUpper`: ![Undefined function error](/mulesoft/current/en-us/anypoint-code-builder/_images/dw-error.png) When you place your cursor on the function, DataWeave provides information about the error: ![Information about the undefined function error](/mulesoft/current/en-us/anypoint-code-builder/_images/undefined-function.png) To fix this issue: 1. Click the error to display the popup. 2. Click **Quick Fix**, and then click **Create Function**. Anypoint Code Builder automatically adds a function definition with the `???` placeholder for you to define your function: ```DataWeave fun toUpper(param0: String) = ??? ``` 3. Update the function to use the `upper` function to return the provided String in uppercase characters: ```DataWeave ``` ## Import a DataWeave Library Use Anypoint Code Builder to import DataWeave libraries from Exchange into your Mule application. A DataWeave library is a reusable package of DataWeave modules, mapping files, and resource files, such as JSON, XML, and CSV files. You can import a DataWeave library the same way you import any other asset from Exchange: 1. Open your integration project in Anypoint Code Builder. 2. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 3. Enter `import` and select the following command: ```command MuleSoft: Import Asset from Exchange ``` 4. Select **DataWeave Library**. To search for a library, type the search term and press Enter. For example, enter **DataWeave**: ![Search for DataWeave libraries](/mulesoft/current/en-us/anypoint-code-builder/_images/int-dw-libraries.png) 5. Select the DataWeave library from the **Assets From Exchange** menu. 6. Select a version of the DataWeave library. The status bar shows the progress. When complete, Anypoint Code Builder shows a message that the dependency was successfully added to the project. ## Reference a DataWeave Script Stored in an External File If you use the same transformation logic in multiple places, store the DataWeave script in a `.dwl` file in `src/main/resources` instead of duplicating the transformation inline in each component. By externalizing a script, you can update the transformation in one place and reference it wherever it’s needed. To reference an externalized script, use the `${file::}` syntax in any XML tag that expects an expression, where `` is the name of your `.dwl` file in `src/main/resources`. For example: ```xml ``` ## See Also - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) - [DataWeave Issues and Errors](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-dataweave) - [Add a Component to Your Project](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations#add-components) - [Implementing OAS, RAML, AsyncAPI, and GraphQL APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-api-specs) - [Locate Your API in Exchange](https://docs.mulesoft.com/anypoint-code-builder/des-publish-api-spec-to-exchange#locate-api) - [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference) --- product: Anypoint Code Builder version: master --- # Using Skills with MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Skills are reusable instruction sets that MuleSoft Vibes activates only when they apply to your task. Each skill packages guidance and optional resources so MuleSoft Vibes can follow a consistent workflow without loading that material for unrelated messages. When your request matches a skill’s description, MuleSoft Vibes uses the `use_skill` tool to load the full instructions and run them for that task. Unlike workspace rules that stay active across conversations, skills load as needed, which leaves more context available for other work. MuleSoft publishes Mule development skills from the `mulesoft-dx` repository as the `@salesforce/mulesoft-vibes-skills` package so you can use them across agents such as MuleSoft Vibes, Claude Code, Cursor, Cline, and Codex. **Default skills** are preloaded in MuleSoft Vibes and enabled by default. You can turn on and off each default skill individually. **Workspace skills** are available only in the workspace or project where they’re defined. **Global skills** are available in every project and workspace. ## Manage Default Skills in MuleSoft Vibes Default skills are available automatically when you use MuleSoft Vibes where the feature is supported. > [!NOTE] When you use MuleSoft Vibes, Anypoint Code Builder automatically installs or updates > Anypoint CLI after you restart VS Code. Some skills, such as `build-mule-integration` and > `upgrade-mule-app`, require Anypoint CLI. When you use skills with Claude Code or another agent > instead, you must install Anypoint CLI manually before using skills. See > [Install MuleSoft Skills in Claude Code](#install-mulesoft-skills-in-claude-code). Use MuleSoft Vibes settings to turn on and off each default skill based on your workflow. ## Set Up Skills in Your Project To add **workspace skills** to a project, add skills under `.a4drules/skills/` in your workspace. Each skill is a directory whose name matches the skill. The directory contains a `SKILL.md` file with the instructions (and optional YAML frontmatter for metadata). You can add supporting material in subfolders such as `references/`, `assets/`, or `scripts/` inside that skill directory. Commit `.a4drules/skills/` with your project so everyone who uses the repository gets the same skills. To share workspace rules and skills from GitHub, see [Sharing Rules and Skills from GitHub with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github). ## Install MuleSoft Skills in Claude Code These steps are written for Claude Code and also apply to other supported agents that use the same installer flow. Before you install skills, create a connected app and authenticate Anypoint CLI: - `anypoint-cli-v4 conf client_id {myClientID}` - `anypoint-cli-v4 conf client_secret {myClientSecret}` For more information, see [Authentication to the Anypoint Platform CLI](https://docs.mulesoft.com/anypoint-cli/latest/auth). To install MuleSoft skills: 1. Make sure Node.js is installed. 2. Install the `anypoint-cli-dx-mule-plugin` version 1.3.0 or later. 3. Run: `npx skills add mulesoft/mulesoft-dx/skills/mule-development` 4. Select the skills you want to install. 5. Select the agent targets for the installation: - Keep **Universal (`.agents/skills`)** selected. It is always included by the installer. - Select **Claude Code (`.claude/skills`)** under **Additional agents**. 6. Select a scope: - **Project** installs in the current directory so you can commit the skills with your project. - **Global** makes the skills available to all instances of supported agents. 7. Select an installation method: - **Symlink (Recommended)** installs one shared copy for all selected agent types. - **Copy to all agents** installs independent copies for each selected agent type. 8. Confirm the installation by typing `yes`. > [!NOTE] Use `mulesoft/mulesoft-dx/skills/mule-development` in the `install` command. The shorter > `mulesoft/mulesoft-dx` path doesn’t resolve the nested skills directory. ## MuleSoft Skills Catalog The default MuleSoft skills set includes:
Skill NameDescription

author-governance-ruleset

Create, update, or validate an Anypoint API Governance ruleset for API specifications, API instances, and MCP servers.

build-agent-broker-project

Build, edit, validate, publish, and deploy an Agent Broker project for Agent Network 2.0.

build-mule-integration

Create, update, or fix a Mule flow, subflow, or component. This skill runs a validation script at startup to check whether anypoint-cli-dx-mule-plugin is installed.

create-mule-run-config

Create a new Anypoint Code Builder run configuration.

delete-mule-run-config

Delete an existing Anypoint Code Builder run configuration.

develop-pdk-policy

Scaffold, configure, build, test locally, and publish a custom Omni Gateway policy with the Policy Development Kit (PDK).

execute-mule-run-config

Run or debug a Mule application by using an existing Anypoint Code Builder run configuration.

generate-doc-description

Add or update doc:description attributes in Mule XML configuration files.

manage-api-version

Read, check for updates, and change the version of API dependencies in a Mule project.

manage-global-configurations

Create, edit, delete, list, validate, and consolidate global configuration elements in a Mule project. Covers connector configs, TLS Context, Object Store, Caching Strategy, Global Error Handler, API AutoDiscovery, Import Project Reference, properties files, global-property elements, and multi-environment setup.

pdk-prerequisites

Verify and install the tools required to develop custom Omni Gateway policies with the Policy Development Kit (PDK).

pdk-templates

Apply Policy Development Kit (PDK) code templates for common Omni Gateway custom policy features.

pdk-test

Write and run Docker-based integration tests for a custom Omni Gateway policy.

pdk-unit

Write and run unit tests for a custom Omni Gateway policy built with the Policy Development Kit (PDK).

run-system-diagnostics

Run Anypoint Code Builder system diagnostics, including RAM, CPU, IOPS, and Windows optimizations.

secure-mule-app

Configure and implement Mule secure properties to encrypt sensitive data.

translate-agent-broker-old-to-new-project

Convert an Agent Network 1.0 project into an Agent Network 2.0 project.

update-mule-run-config

Edit an existing Anypoint Code Builder run configuration.

upgrade-mule-app

Upgrade a Mule application to a later Mule runtime version and Java version.

> [!NOTE] The `upgrade-mule-app` skill requires a Mule application on Mule 4.3 or later. It also > requires `@salesforce/anypoint-cli-dx-mule-plugin` version 1.3.0 or later, which auto-provisions > the source and target JDKs during the upgrade. To update the plugin, run: > > `npm install -g @salesforce/anypoint-cli-dx-mule-plugin@latest` ## Skills and MCP Tools Model Context Protocol (MCP) servers expose **tools** that perform actions, such as generating a flow or calling an API. **Skills** supply structured instructions and workflows the assistant follows when a task matches the skill. You typically use both: tools carry out operations, while skills guide how and when to apply them for specific scenarios. For configuring MCP servers in Anypoint Code Builder, see [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server). ## See Also - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) - [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) - [Sharing Rules and Skills from GitHub with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github) - [Configuring an MCP Server](https://docs.mulesoft.com/anypoint-code-builder/vibes-mcp-server) - [Troubleshooting AI Features in Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/troubleshoot-generative-ai) --- product: Anypoint Code Builder version: master --- # Using the Command Palette > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Command Palette in Anypoint Code Builder is the control center for all commands you use to perform tasks. Knowing how to open it is important for your productivity. 1. Open the Command Palette in one of the following ways: - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**: ![The View and Command Palette options are displayed in a list of menu choices](/mulesoft/current/en-us/anypoint-code-builder/_images/open-command-palette.png) 2. Type `MuleSoft:` and browse the available commands: ![A text box for entering commands, with a list of recently used and other commands](/mulesoft/current/en-us/anypoint-code-builder/_images/all-mulesoft-commands.png) For a list of MuleSoft commands, see [Command Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-commands). ## See Also - [Learn Anypoint Code Builder UI](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui) - [Customize Look and Feel](https://docs.mulesoft.com/anypoint-code-builder/start-discover-ui) --- product: Anypoint Code Builder version: master --- # Validate Input Parameters and Transform Flight Data > For the full documentation index, see: https://docs.mulesoft.com/llms.txt When you scaffold an API specification into an implementation project, APIKit automatically validates incoming requests against your API specification. This validation includes: - **Path parameter formats**: If your API spec defines a pattern (such as `pattern: "^[A-Z]{2}\d+$"`), APIKit validates the format automatically. - **Required vs. optional parameters**: APIKit ensures required parameters are present. - **Data types**: APIKit validates that parameters match their specified types (string, integer, boolean, and so on). - **Enum values**: If your spec defines allowed values, APIKit validates against that list. If a request doesn’t match these rules, APIKit returns a `400 Bad Request` with an appropriate error message before your flow logic even executes. While APIKit handles format and structural validation, you need custom validation for: - **Business logic rules**: Validating that a resource exists in your system (for example, "Does this flight code exist in our database?"). - **Cross-field validation**: Rules that depend on multiple parameters. - **External system checks**: Validating against external APIs or services. - **Database lookups**: Confirming that identifiers correspond to actual records. In this section, you add business logic validation to check whether a flight code exists in your database before attempting to query for it. This prevents unnecessary database calls and provides more meaningful error messages to API consumers. In the American Flights API, the example database stores flights with numeric IDs (1, 2, 3), but the API exposes flight codes like `AA123`, `AA234`, and `AA345`. You need to map these codes to database IDs and validate that the flight exists before querying. ## Create the Flight Code to Database ID Mapping First, create a transform that stores the mapping of flight codes to database IDs. 1. Open the `get:\flights\(flightId):american-flights-api-config` flow. Because MuleSoft Vibes generated the API spec, your implementation flows might have different names. You must locate the flow that starts with `get:\flights\(flightId)`. ![The Flow List with the get:\\flights\\(flightId):american-flights-api-config flow selected](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-flow-list-select-flow.png) 2. If the flow already contains any **Transform Message** components, select the components and press **Delete**, or click **More actions…​** (![The More actions menu icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-kebab.svg)) and select **Delete Component**. Delete any existing **Transform Messages** to start with a clean flow. 3. Click **Add Component** (**+**) at the start of the flow and select **Core Processors > Components > Transform Message**. 4. Click the **Transform Message** component to open its properties panel. 5. Click **Delete Target** next to **Payload**. ![The Transform Message General tab with Delete Target selected next to the Payload target](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-delete-target.png) This step ensures the Transform does not modify the payload. 6. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)), change it to **Create Flight Code Map**, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). 7. In the **General** tab, under **Target**, click **Add** (+) and select **Variable**. 8. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)) next to `vars.NewVariable1`, set the name to `flightCodeMap`, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). 9. In the **Inline Script** field, replace the content with this DataWeave script: ```dataweave %dw 2.0 output application/java --- { "AA123": 1, "AA234": 2, "AA345": 3, "AA456": 4, "AA567": 5 } ``` This creates a variable `vars.flightCodeMap` that maps flight codes to their corresponding database IDs. > [!NOTE] In a production application, you would typically query the database directly rather than > maintaining a hardcoded map. This tutorial uses a map to clearly demonstrate the validation logic > without requiring additional database queries. ## Look Up the Database Flight ID Now create a second transform to look up the flight code in the mapping you just created. 1. After the **Create Flight Code Map** transform, click **Add Component** (**+**) and select **Core Processors > Components > Transform Message**. ![The Add Component button after the Create Flight Code Map Transform element.](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-flow-add-component.png) 2. Click the **Transform Message** component to open its properties panel. 3. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)), change it to **Lookup DB Flight ID**, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). 4. Click **Delete Target** next to **Payload**. 5. In the **General** tab, under **Target**, click **Add** (+) and select **Variable**. 6. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)) next to `vars.NewVariable1`, set the name to `dbFlightId`, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). 7. In the **Inline Script** field for this variable, paste this code: ```dataweave %dw 2.0 output application/java --- vars.flightCodeMap[attributes.uriParams.flightId] ``` This script looks up the flight code from the request URL in the mapping created in the previous transform and returns the corresponding database ID. If the flight code isn’t in the map, it returns `null`. > [!NOTE] You cannot reference a variable in the same Transform Message where you’re creating it. > The variable only becomes available **after** the transform completes. By splitting the logic into > two transforms, `vars.flightCodeMap` is available for use in the second transform. ## Add a Choice Router to Validate Flight Existence Now add logic to check whether the flight code was found in the mapping. 1. After the **Lookup DB Flight ID** transform, click **Add Component** (**+**) and select **Core Processors > Flow Control > Choice**. 2. Click the **When** path inside the Choice router. ![The When path of the Choice router selected and the When element properties panel.](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-flow-when-config.png) 3. In the **When** properties panel, under **Expression**, add this condition to check if the flight code wasn’t found: ```dataweave #[vars.dbFlightId == null] ``` This expression evaluates to `true` when the flight code doesn’t exist in the mapping. ## Raise an Error for Unknown Flight Codes When a flight code isn’t found, raise a custom error instead of proceeding with the query. 1. Inside the **When** path (where the condition is true), click **Add Component** (**+**) and select **Core Processors > Error Handling > Raise Error**. 2. In the **Raise Error** properties panel, configure:
Field NameField Value

Type

VALIDATION:FLIGHT_NOT_FOUND

Description

'Flight code ' ++ attributes.uriParams.flightId ++ ' not found in our system'

This creates a custom error type that you handle in the error handler, providing a meaningful message that includes the flight code the user attempted to look up. ## Add the Database Query to the Otherwise Path The database query executes when the flight exists (when `vars.dbFlightId` is not null). 1. Inside the **Otherwise** path of the Choice router, click **Add Component** (**+**) and select **Connectors > Database > Select**. 2. Select the component and configure:
Field NameField Value

Name

Flight by ID

Connection Config

Config (your MySQL connection)

SQL Query Text

SELECT * FROM american WHERE ID = :flightId

Input Parameters

{ 'flightId': vars.dbFlightId }

![Database - Select properties panel with Name set to Flight by ID, Connection Config set to Config, and the SQL Query Text and Input Parameters fields configured](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-db-flight-by-id-config.png) Your flow should now look like this: ![The get:\\flights\\(flightId):american-flights-api-config flow with the Choice router’s When and Otherwise paths configured with Raise Error and Database Select components](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-choice-flow-overview.png) ## Add an Error Handler for Flight Not Found Now configure the error handler to return a proper 404 response when a flight isn’t found. 1. In the canvas, open the `american-flights-api-main` flow (the main flow with the HTTP listener and error handler). 2. After the last **Error Handler**, click **Add Component** (**+**). ![The american-flights-api-main flow’s Error Handler section with Add Component clicked after the last error handler](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-error-handler-add-component.png) 3. Select **On Error Propagate**. 4. Click the **On Error Propagate** component to open its properties panel 5. Next to **Type** click the **Text Mode** button (![The Text Mode icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-text-mode.svg)) to enable it. ![The On Error Propagate properties panel with the Text Mode button next to the Type field](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-enable-text-mode.png) 6. In **Type**, paste `VALIDATION:FLIGHT_NOT_FOUND`. 7. Inside this error handler, click **Add Component** (**+**) and select **Core Processors > Components > Logger**. 8. Select the **Logger** and set these properties:
Field NameField Value

Level

WARN

Message

#['Flight not found: ' ++ error.description]

This logs details about which flight was requested but not found, helping with debugging and monitoring. 9. After the Logger, click **Add Component** (**+**) and add **Core Processors > Components > Transform Message**. 10. Configure the Transform Message: 1. In the **General** tab, under **Target > Payload**, set **Source** to **Inline Script**. 2. In the **Inline Script** field, set: ```dataweave %dw 2.0 output application/json --- { message: error.description default "Flight not found", flightId: attributes.uriParams.flightId } ``` 11. Click **+Add** and select **Variable**. 12. Name the variable `httpStatus` and set its value to `404`. ![The Transform Message properties panel with the error response script and the httpStatus variable set to 404](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-dw-transform-config.png) This returns a JSON response with a meaningful error message and the flight ID that was requested, along with a 404 HTTP status code. ## Transform Data to Meet the API Contract When building an API implementation, it’s essential that your responses match the structure defined in your API specification. While the database might store data in one format, your API contract defines how that data should be presented to consumers. DataWeave transformations bridge this gap by mapping database fields to the expected API response format. In this section, you create a DataWeave transformation that converts database query results into the JSON format specified in your American Flights API contract. ### Understand the Data Mapping Challenge Your MySQL database stores flight information with these fields: Example database record ```json { "ID": 1, "code1": "rree", "code2": "0001", "airlineName": "American Airlines", "toAirport": "LAX", "fromAirport": "MUA", "takeOffDate": "2016-01-20", "price": 541, "planeType": "Boeing 787", "seatsAvailable": 0, "totalSeats": 200 } ``` Your API specification defines a different structure for the response: ```json { "ID": 1, "code": "AA123", "price": 499.99, "departureDate": "2024-12-25T10:00:00", "origin": "SFO", "destination": "LAX", "emptySeats": 45, "plane": { "type": "Boeing 737", "totalSeats": 150 } } ``` Notice the transformation challenges: 1. **Field name changes**: Database fields have different names than API fields: 1. `fromAirport` → `origin` 2. `toAirport` → `destination` 3. `takeOffDate` → `departureDate` 4. `seatsAvailable` → `emptySeats` 2. **Field combination**: `code1` and `code2` need to be combined into a single `code` field. 3. **Nested object creation**: `planeType` and `totalSeats` (flat fields in the database) must become a nested `plane` object in the API response. 4. **Fields to exclude**: `airlineName` is in the database but not needed in the API response. ### Step 1: Add the Transform Message Component In your implementation flow `get:\flights\(flightId):american-flights-api-config`, add a Transform Message component after the Database Select operation. 1. Locate the `get:\flights\(flightId):american-flights-api-config` flow in your canvas. 2. After the **Flight by ID** database query, click **Add Component** (**+**) and select **Core Processors > Components > Transform Message**. 3. Click the **Transform Message** component to open its properties panel. 4. Click **Edit name** (![The Edit Name icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-edit.svg)), change it to **Transform Flight**, then click **Apply** (![The Apply icon.](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-apply.svg)). By default, this transform just outputs `payload`, which passes through the raw database structure without transformation. ### Step 2: Define Input Metadata To help DataWeave understand the structure of your database results, define input metadata. 1. In the project explorer, right-click the `examples` folder (`src/main/resources/examples`) and select **New File**. If the `examples` folder doesn’t exist, right-click the **resources** folder (`src/main/resources`), select **New Folder**, and name it `examples`. ![The project explorer with the examples folder highlighted and New File selected from the context menu](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-new-file.png) 2. Name the file `sample-database-input.json`. 3. Open the file, populate it with this sample database record, and save the file: ```json [ { "ID": 1, "code1": "rree", "code2": "0001", "airlineName": "American Airlines", "toAirport": "LAX", "fromAirport": "MUA", "takeOffDate": "2016-01-20", "price": 541, "planeType": "Boeing 787", "seatsAvailable": 0, "totalSeats": 200 } ] ``` 4. Open the `get:\flights\(flightId):american-flights-api-config` flow in the canvas. 5. Click the **Transform Flight** element you added previously. 6. Click the **Metadata** tab. 7. Inside **Input** and next to **Payload: Any**, click **(No metadata selected)** > **Set custom metadata**. ![The Input Payload metadata selector with Set custom metadata highlighted](/mulesoft/current/en-us/anypoint-code-builder/_images/tut-flights-set-custom-metadata.png) 8. In the tab that opens, click **Create New**. 9. In the **Add Custom Metadata** dialog, set:
Field NameField Value

Name

DatabaseFlightRecord

Type

JSON

Source

Example

Example

examples/sample-database-input.json
This is the example file you just created.

10. Click **Save & Close**. 11. Click **Apply & Close**. You should now see the input payload structure in the left panel, showing all available database fields. ### Step 3: Define Output Metadata Now define the expected API response format based on your specification. 1. In the project explorer, right-click the `examples` folder (`src/main/resources/examples`) and select **New File**. 2. Name the file `sample-flight-response.json`. 3. Open the file, populate it with this sample API response (from your API spec), and save the file: ```json { "ID": 1, "code": "AA123", "price": 499.99, "departureDate": "2024-12-25T10:00:00", "origin": "SFO", "destination": "LAX", "emptySeats": 45, "plane": { "type": "Boeing 737", "totalSeats": 150 } } ``` 4. Open the `get:\flights\(flightId):american-flights-api-config` flow in the canvas. 5. Click the **Transform Flight** element you added previously. 6. Click the **Metadata** tab. 7. Inside **Output** and next to **Payload: Any**, click **(No metadata selected)** > **Set custom metadata**. 8. In the tab that opens, click **Create New**. 9. In the **Add Custom Metadata** dialog, set:
Field NameField Value

Name

FlightResponse

Type

JSON

Source

Example

Example

examples/sample-flight-response.json
This is the example file you just created.

10. Click **Save & Close**. 11. Click **Apply & Close**. The output panel now shows the expected response structure with the nested `plane` object. ### Step 4: Create the Field Mappings With both input and output metadata defined, you can now create the transformation using DataWeave’s mapping features. - Use MuleSoft Vibes - Write the DataWeave Script Manually 1. Open MuleSoft Vibes. 2. Send this message: ```command In the get:\flights\(flightId):american-flights-api-config flow, open the Transform Flight component and add a transformation that maps the input metadata with the output metadata. For code, use code1 ++ code2. ``` > [!NOTE] If you used a different flow or component name, ensure you specify it in the message > so MuleSoft Vibes knows exactly which flow and components to modify. 3. Wait until MuleSoft Vibes completes the task before making further changes. After MuleSoft Vibes finishes adding the transformation, confirm that the DataWeave script is similar to this: ```dataweave %dw 2.0 output application/json --- { ID: payload[0].ID, code: payload[0].code1 ++ payload[0].code2, price: payload[0].price, departureDate: payload[0].takeOffDate, origin: payload[0].fromAirport, destination: payload[0].toAirport, emptySeats: payload[0].seatsAvailable, plane: { "type": payload[0].planeType, totalSeats: payload[0].totalSeats } } ``` You can write the complete DataWeave script in the **Script** view: 1. Click the **Script** tab in the Transform Message component. 2. Replace the current content with: ```dataweave %dw 2.0 output application/json --- { ID: payload[0].ID, code: payload[0].code1 ++ payload[0].code2, price: payload[0].price, departureDate: payload[0].takeOffDate, origin: payload[0].fromAirport, destination: payload[0].toAirport, emptySeats: payload[0].seatsAvailable, plane: { "type": payload[0].planeType, totalSeats: payload[0].totalSeats } } ``` **Explanation:** - `code: payload[0].code1 ++ payload[0].code2` — concatenates `code1` and `code2` into a single `code` field. - `departureDate: payload[0].takeOffDate` — renames the field from database to API format. - `origin: payload[0].fromAirport` — maps `fromAirport` to `origin`. - `destination: payload[0].toAirport` — maps `toAirport` to `destination`. - `emptySeats: payload[0].seatsAvailable` — renames `seatsAvailable` to `emptySeats`. - `plane: { …​ }` — creates a nested object from flat database fields. - `output application/json` — specifies the output format. [Implement the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-implement-api) [Debug the American Flights API](https://docs.mulesoft.com/anypoint-code-builder/tut-flights-debug-api) --- product: Anypoint Code Builder version: master --- # Validating API Specifications Against Governance Rulesets > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Test your API specifications in Anypoint Code Builder design projects against rules in governance rulesets, and fix conformance issues that result. For information about rulesets and governance, see [Anypoint API Governance Concepts](https://docs.mulesoft.com/api-governance/#anypoint-api-governance-concepts). ## Before You Begin You must have an API design project with a supported specification in Anypoint Code Builder: - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) - [Creating and Importing AsyncAPI Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-asyncapi-api-specs) ## Workflows and tasks A typical workflow consists of one or more of the following tasks: 1. Add one or more rulesets to an API design project: [Add Rulesets to a Project](#add-rulesets) 2. Run rules in the rulesets to determine if your API specification conforms with the rules: [Run Rules Against Your API Specification](#run-rules) 3. Fix any conformance issues in the specification: [Fix Conformance Issues](#fix-issues) ## Add Rulesets to a Project Add governance rulesets as dependencies to your API design project in Anypoint Code Builder. Rulesets are hosted on Exchange. MuleSoft provides a number of public rulesets that you can find from Anypoint Code Builder or review directly on [Exchange](https://anypoint.mulesoft.com/exchange/?type=ruleset&show=mulesoft&sort=last&view=grid). For example, the ruleset [Anypoint Best Practices](https://anypoint.mulesoft.com/exchange/68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/minor/1.6/) provides documentation and examples. Your team can also create and publish rulesets for your organization to Exchange (see [Creating Custom Governance Rulesets](https://docs.mulesoft.com/api-governance/create-custom-rulesets)). 1. Open your API design project in Anypoint Code Builder. 2. From the **Explorer**, expand the **Governance Rulesets** panel in your project. If the panel is not in the **Explorer**, activate the panel from the **Views and More Actions…​** (**…​**) menu in the **Explorer**. 3. Add a ruleset: - If the panel does not contain any rulesets, click **Add Rulesets**. For example: ![Governance Rulesets panel](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-add-panel.png) - If the panel contains rulesets, you can hover over the panel and click ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gov-ruleset-add.png) (**Add Governance Rulesets**) to add another ruleset. For example: ![Add ruleset icon](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-add-panel-not-empty.png) 4. If prompted, sign in to Anypoint Platform. 5. Search for the ruleset, and click **Add Rulesets**. For example: ![All Available Rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-search-add.png) You can also narrow your search to specific organizations from the **Any organization** menu, and you can select a different version of a ruleset if more than one version is available. 6. Proceed to [Run Rules Against Your API Specification](#run-rules). ## Centralized Rulesets for Topics and Agents If you enable your API project for topics and agents, the **SF API Topic and Action Enablement** centralized ruleset is added to your topic-enabled API project automatically. For more information, see [Topic and Agent Governance Rulesets](https://docs.mulesoft.com/anypoint-code-builder/ai-enabling-api-project-topic-center#governance-rulesets). ## Run Rules Against Your API Specification Determine whether your API specification conforms with rules in governance rulesets. 1. Open your API design project in Anypoint Code Builder. 2. From the **Explorer**, expand the **Governance Rulesets** panel to check for rulesets in your project. - If any rulesets are present and you don’t intend to add more, proceed to the next step. ![Add ruleset icon](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-add-panel-not-empty.png) - If no rulesets are present or if you intend to add more rulesets, go to [Add Rulesets to a Project](#add-rulesets). ![Governance Rulesets panel](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-add-panel.png) 3. Run rules from the **Governance Rulesets** panel. You can run rulesets at multiple levels: - All rules in all rulesets ![Clicking icon to run all rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-run-all.png) - All rules in a single ruleset ![Clicking icon to run a rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-run-ruleset.png) - A single rule in a ruleset ![Clicking icon to run a rule](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-run-rule.png) You can monitor the rules as they run. For example: ![Rules running in the panel](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-running.png) 4. If any rules return an error (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gov-rule-error.png)) or a warning (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gov-rule-warning.png)), proceed to [Fix Conformance Issues](#fix-issues). For example, this ruleset returns a warning on some rules: ![Ruleset with warnings in API Governance panel](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-warning.png) Execution times displayed for a ruleset (such as 19.25s) represent the sum of time it takes to run each rule. Due to parallel execution of rules on machines with multiple cores, the execution time displayed for a ruleset is likely to be greater than the actual time to complete the execution. The **Governance Results** panel also identifies any warnings or errors. For example: ![Ruleset with warnings in Governance Results panel](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-rulesets-warning-output.png) ## Fix Conformance Issues To address rules that return errors or warnings, fix the specification to comply with the rules. Then re-run the rules to ensure that the fix is effective. ### Example To illustrate the process for addressing issues, the example in this procedure starts with a partial RAML specification and some rulesets: ![Re-running HTTPs rule](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-prefix.png) Full Example - The specification has this markup: ```yaml #%RAML 1.0 title: my-des-with-governance protocols: - HTTP ``` - The design project for the specification applies these rulesets: - HTTPS Enforcement - Anypoint Best Practices ### Fix Conformance Issues To fix errors (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gov-rule-error.png)) and warnings (![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-gov-rule-warning.png)): 1. Run the rulesets in your project. For guidances, see [Run Rules Against Your API Specification](#run-rules). 2. Review any resulting errors and warnings in the **Governance Results** panel. For example: ![Error and Warnings in Governance Rulesets](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-postrun-issues.png) **Governance Results** lists the corresponding issues. For example: ![Error and Warnings in Governance Results](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-postrun-issues-output.png) - `Error: [HTTPS Enforcement] Only use https protocol scheme.` - `Warning: [Anypoint Best Practices] Provide the documentation for the API.` - `Warning: [Anypoint Best Practices] Provide the description for the API.` 3. Address errors in the specification. For instance, fix the **HTTPS Enforcement** error in the [specification example](#example) by changing `HTTP` to `HTTPS`: ```yaml #%RAML 1.0 title: my-des-with-governance protocols: - HTTPS ``` 4. Re-run the failing rule to ensure that the error is fixed. For instance, after fixing the `protocols` error in the [specification example](#example), run **use-https-for-scheme-protocol** from the **Governance Rulesets** panel. For example: ![Re-running HTTPs rule](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-run-fixed-error-https.png) Notice that the error no longer appears in **Governance Rulesets**. For example: ![Fixed HTTPs rule](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-error-fixed-https.png) In addition, the **Governance Results** panel no longer lists the issue. 5. Address warnings, as needed. For instance: 1. Address the warning `Provide the description for the API` by adding a `description` to the [specification example](#example). For example: ```yaml #%RAML 1.0 title: my-des-with-governance description: my description protocols: - HTTPS ``` The description is between `title` and `protocols`. 2. Re-run the rule **api-must-have-description**, and notice that the specification now conforms to the rule. ![Fixed description](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-warning-fixed-description.png) The ruleset continues to identify a warning because a different rule in the ruleset has a warning. 6. Address any remaining issues that you intend to fix. For instance, for the warning `Provide the documentation for the API` in the [example](#example), add and save `documentation` markup to the specification: ```yaml #%RAML 1.0 title: my-des-with-governance description: my description documentation: - title: My Title content: | Welcome to my API documentation. - title: Legal content: | This is my legal documentation. protocols: - HTTPS ``` 7. Re-run the corresponding rule from the **Governance Rulesets** panel. For example, re-run **api-must-have-documentation**, and notice that the specification now conforms to the rule. ![Fixed documentation](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-warning-fixed-all.png) The specification has no more errors or warnings. For example: ![Panel displaying rulesets validate](/mulesoft/current/en-us/anypoint-code-builder/_images/gov-example-error-fixed-all.png) ## Remove a Ruleset from a Project 1. In the **Governance Ruleset** panel, hover over a ruleset to display the **More actions** (**…​**) menu. 2. In the **More actions** menu, click **Remove Ruleset…​**. You can also use the command **MuleSoft: Remove Governance Ruleset…​** from the command palette for this purpose. ## Open a Ruleset YAML File To examine the configuration of a ruleset’s YAML file: 1. In the **Governance Ruleset** panel, hover over a ruleset to display its **More actions** (**…​**) menu. 2. Click **Show in Files** to open the YAML file in a **ruleset.yaml** tab. The following example shows version 1.6.1 of the HTTPS Enforcement YAML file: ```YAML #%Validation Profile 1.0 profile: HTTPS enforcement description: This ruleset helps ensure the use of HTTPS across URLs in API definitions, both in the base server URL and in any callbacks optionally defined. violation: - use-https-for-callbacks - use-https-for-scheme-protocol - use-https-for-urls tags: - security validations: use-https-for-callbacks: message: "{{apiContract.expression}} must use https as it is a callback url" targetClass: apiContract.Callback propertyConstraints: apiContract.expression: pattern: ^https:// examples: valid: | openapi: "3.0.0" info: title: example API version: "1.0.0" paths: /subscribe: post: responses: '201': description: Webhook created callbacks: myEvent: 'https://{$request.body#/callbackUrl}' invalid: | openapi: "3.0.0" info: title: example API version: "1.0.0" paths: /subscribe: post: responses: '201': description: Webhook created callbacks: myEvent: 'http://{$request.body#/callbackUrl}' use-https-for-scheme-protocol: message: Only use https protocol scheme targetClass: apiContract.WebAPI not: propertyConstraints: apiContract.scheme: containsSome: - HTTP - http examples: valid: | #%RAML 1.0 protocols: - HTTPS invalid: | #%RAML 1.0 protocols: - HTTP use-https-for-urls: message: "{{core.urlTemplate}} should use https" targetClass: apiContract.Server propertyConstraints: core.urlTemplate: pattern: ^https:// examples: valid: | openapi: "3.0.0" servers: - url: "https://mySecureEndpoint" description: "My endpoint that uses HTTPS" invalid: | openapi: "3.0.0" servers: - url: "http://myNotSoSecureEndpoint" description: "My endpoint that uses HTTP" ``` ## Open a Ruleset in Exchange In Exchange, rulesets list all rules and can provide documentation with examples. To open the ruleset in Exchange: 1. In the **Governance Ruleset** panel, hover over a ruleset to display its **More actions** (**…​**) menu. 2. Click **Open in Exchange**. ## Change a Ruleset Version To select a different version of a ruleset: 1. In the **Governance Ruleset** panel, hover over a ruleset to display its **More actions** (**…​**) menu. 2. Click **Change Version…​**. 3. Select a different version from the **Change Version** menu that opens. --- product: Anypoint Code Builder version: master --- # Version Settings for Mule, Java, and Connectors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Set Mule runtime engine (Mule), Java, and connector versions to use in your projects. Anypoint Code Builder includes bundled Mule runtime versions so you can open and design projects instantly without additional Mule runtime downloads. Anypoint Code Builder uses these bundled Mule runtime versions for editing and DataSense. Exact Mule runtime versions are only required when you run or debug your applications. - [Bundled runtimes](#bundled-runtimes): Learn about the Mule runtime versions included with Anypoint Code Builder. - [Default versions](#default-versions): Set default Mule and Java versions to show in version dropdown menus. - Project-level versions: Set versions to use in a specific project. - For Mule and Java versions, see [Select Mule and Java Versions for a Project](#project-version-mule-java). - For connector versions, see [Select Connector Versions for a Project](#project-versions-connectors). - To upgrade all connectors at once, see [Upgrade All Connectors in a Project](#upgrade-all-connectors). - [Install additional runtimes](#install-additional-runtimes): Download specific Mule runtime versions when needed for run or debug operations. ## Bundled Mule Runtime Versions Anypoint Code Builder includes two bundled Mule runtime versions that are available immediately after installation: - **Mule 4.8 (Java 8 compatible)**: A minimal Mule runtime version bundle compatible with all Java 8-based Mule 4.4 and later projects. This Mule runtime version is used for design-time activities with Java 8 projects and serves as the default fallback for legacy applications. You can’t use this version to run Mule applications. - **Latest Runtime (Java 17)**: The most recent supported Mule runtime version (Edge or LTS) bundled with Anypoint Code Builder at the time of release. For example, Mule 4.13.0. This Mule runtime version supports Java 17 and can be used for both designing and running applications. Projects configured for Mule 4.6, 4.9, 4.10, 4.11, and 4.12 are compatible with this bundled Mule runtime version. Anypoint Code Builder automatically selects the appropriate bundled Mule runtime version based on your project’s Java version: - Java 8 projects use the bundled 4.8 minimal Mule runtime version - Java 17 projects use the latest bundled Mule runtime version These bundled Mule runtime versions guarantee that the design service can always start and serve the canvas and design-time needs without requiring Mule runtime downloads. Projects open instantly using these bundled Mule runtime versions. Download a specific Mule runtime version if you want to run or debug your application with an exact version that isn’t available locally. ## Select Default Mule and Java Versions Select the default Mule and Java versions for new implementation and integration projects. The defaults appear in drop-down menus from which you select a version, for example, when creating a project. The dropdown shows only locally available Mule runtime versions, including the bundled ones. Versions that don’t support a feature typically append a message, such as **AsyncAPI implementation unsupported** for Mule 4.4. You can set a different version at the project level (see [Select Mule and Java Versions for a Project](#project-version-mule-java)). To select the default Mule and Java versions from the **Settings** tab: 1. Open the **Settings** panel: Show me how - From the Anypoint Code Builder panel, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon. - From the activity bar, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-settings-gear.png) (gear) icon, select **Settings**, and search for `mule` in the **Settings** tab. - Provide the command `MuleSoft: Open ACB Settings` in the [Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette). 2. Find **Mule › Application: Default Mule Runtime And Java Versions** in the open tab. 3. Click **Edit defaults through command palette**. Although it is also possible to set the versions as values to **muleRuntimeVersion** and **jdkVersion** items directly in the **Settings** tab, you must know the major, minor, and patch numbers, and in some cases, the timestamp. It is easier to set them after clicking **Edit defaults through command palette**. 4. Select a Mule runtime version. 5. Select a Java version. ## Select Mule and Java Versions for a Project Set Mule or Java versions for a specific implementation or integration project from **Project Properties**. You can change versions at any time, but test your projects with the versions you intend to deploy. Anypoint Code Builder uses bundled Mule runtime versions to open and edit projects immediately. The design service uses the latest Java-compatible Mule runtime version available locally. Anypoint Code Builder bundles the latest Mule runtime version (for example, 4.13) for Java 17 and a reduced Mule runtime version 4.8 for Java 8. This guarantees that the design service can always start and serve the canvas and design-time needs without requiring Mule runtime downloads. Because the bundled Mule runtime version is the latest one, you can open and edit any project regardless of its `minMuleVersion` property. The design service uses the latest Java-compatible Mule runtime version available locally for design-time activities. The `minMuleVersion` property in your project’s `mule-artifact.json` file is checked only at deployment time. The `minMuleVersion` property specifies the minimum Mule runtime version required to run or deploy the application. Version settings are important in several scenarios: - Updating a project to use more current versions - Switching to a supported version, for example, for a project that you import into Anypoint Code Builder that uses an unsupported version - Selecting versions of Mule or Java that are compatible with each other - Specifying exact Mule runtime versions for run and debug operations When you run or debug an application, Anypoint Code Builder checks if the exact Mule runtime version specified in your project is available locally. If not, you see a warning dialog that allows you to: - Continue with the latest compatible local version - Open **Project Properties** to select or download the required Mule runtime version > [!NOTE] Changing the minimum Mule version (`minMuleVersion`) manually can have serious > implications. This requires a full test of your application so it works correctly with the target > Mule runtime version. Newer Mule runtime versions turn on feature flags by default. See > [Feature Flagging Mechanism](https://docs.mulesoft.com/mule-runtime/latest/feature-flagging). This can change behavior > that was fixed in later versions. Your application can rely on behavior that was later corrected > or on a previous issue. Prefer changing the Mule runtime version through **Project Properties**, > and always run full regression tests after any version change. When a Mule or Java version isn’t set for a project, the canvas and notifications provide a **Set version** button that opens the **Project Properties** tab. You can also navigate directly to the **Project Properties** tab. To select Mule and Java versions for a project: 1. Open your implementation or integration project 2. Run this command to open the **Project Properties** tab: ```command MuleSoft: Open Mule Project Properties ``` 3. In the Explorer, right-click your project, and select **Mule** > **Open Mule Project Properties**. 4. In **Project Properties**, select the versions to use in this project. ![Mule and Java versions in Project Properties tab](/mulesoft/current/en-us/anypoint-code-builder/_images/int-project-properties.png) You can select from locally available Mule runtime and Java versions. The dropdown shows only the Mule runtime versions that are installed on your local disk, including bundled Mule runtime versions that are available immediately after installation. Anypoint Code Builder saves your version settings to the project’s `mule-artifact.json` file. Bundled Mule runtime versions enable instant project opening and design. To install additional Mule runtime versions, use the `MuleSoft: Install Runtime` command. For information about version support and automated Mule patch updates, see [Mule and Java version support](https://docs.mulesoft.com/anypoint-code-builder/acb-release-notes#versions-mule-jdk). ## Select Connector Versions for a Project Set connector versions for a specific implementation or integration project from **Project Properties** or when you add a component to the canvas. You can change versions at any time, but it is important to test your projects with the versions you intend to deploy. To upgrade every connector in the project at once, see [Upgrade All Connectors in a Project](#upgrade-all-connectors). To select connector versions for a project: 1. Open your implementation or integration project. 2. Run this command to open the **Project Properties** tab: ```command MuleSoft: Open Mule Project Properties ``` 3. In the Explorer, right-click your project, and select **Mule** > **Open Mule Project Properties**. 4. Click **Connectors** from the **Project Properties** side bar. ![Connector versions in Project Properties tab](/mulesoft/current/en-us/anypoint-code-builder/_images/int-project-properties-connectors.png) 5. Select connector versions. You can update Exchange connector versions for compatibility with your project’s Mule runtime and Java versions. 6. Click **Apply**. > [!NOTE] Connector compatibility is checked against the selected Mule runtime and Java versions. > Compatibility issues appear after you apply changes in **Project Properties**. Connector versions > that are unavailable from Anypoint Exchange can’t be changed in **Project Properties**. ## Upgrade All Connectors in a Project Upgrade every connector in an implementation or integration project to its latest compatible version from **Project Properties**. Anypoint Code Builder selects the latest version that is compatible with the project’s Mule runtime and Java versions. The upgrade stays on each connector’s current major version. For example, a connector on version 1.11.0 can move to 1.12.5, but not to 2.0.0. Review the selected versions, then apply them to update the project’s `pom.xml` file. **Upgrade all to latest** is available when at least one connector has a newer compatible version within its current major version. Connector versions that are unavailable from Anypoint Exchange can’t be changed in **Project Properties**. To upgrade all connectors: 1. Open your implementation or integration project. 2. Run this command to open the **Project Properties** tab: ```command MuleSoft: Open Mule Project Properties ``` 3. In the Explorer, right-click your project, and select **Mule** > **Open Mule Project Properties**. 4. Click **Connectors** from **Project Properties**. 5. Click **Upgrade all to latest**. Anypoint Code Builder sets each connector to the latest compatible version within that connector’s current major version. The new version appears in the connector’s version dropdown menu. Connectors that already use the latest compatible version, or that have no compatible upgrade within the same major version, remain unchanged. 6. Review the selected versions. To keep a different version for a connector, select it from that connector’s dropdown menu. 7. Click **Apply**. 8. In the **Apply connector upgrades?** window, click **Apply**. Anypoint Code Builder writes the selected connector versions to the project’s `pom.xml` file. If you close the window without applying, Anypoint Code Builder doesn’t update `pom.xml`. > [!NOTE] To move a connector to a different major version, select that version from the connector’s > dropdown menu, then click **Apply**. **Upgrade all to latest** stays within each connector’s > current major version. ## Install Additional Mule Runtime Versions Bundled Mule runtime versions enable instant project opening and design. If you need specific Mule versions for running or debugging your applications, install these additional versions. To install a specific Mule runtime version: 1. Open **Command Palette** by pressing Cmd+Shift+P on Mac, or Ctrl+Shift+P on Windows. 2. Run the command: ```command MuleSoft: Install Runtime ``` 3. Select the Mule runtime version to install. Anypoint Code Builder downloads the selected Mule runtime version to `${user.home}/AnypointCodeBuilder/runtimes`. To use a Mule runtime version that Anypoint Code Builder does not include, copy the runtime directory to `${user.home}/AnypointCodeBuilder/runtimes/user-installed`. The version appears when you create a project and in **Project Properties**. See [Add a Mule Runtime Version Locally](https://docs.mulesoft.com/anypoint-code-builder/start-acb#add-local-mule-runtime). > [!NOTE] The dropdown in project creation and **Project Properties** shows only locally available > Mule runtime versions. After installing additional Mule runtime versions, they appear in these > dropdowns for future use. --- product: Anypoint Code Builder version: master --- # Viewing Conversation History > For the full documentation index, see: https://docs.mulesoft.com/llms.txt MuleSoft Vibes allows you to return to tasks you have previously started and continue working from where you left off. To open a recently started task: 1. In the MuleSoft Vibes panel, locate the **Recent Tasks** section. 2. Select the task you want to reopen. If the task is not listed under Recent Tasks: 1. Click **View All History**. 2. Use the search bar to find a specific task, or browse your full history list. You can sort tasks by: - **Newest** - **Oldest** - **Most Tokens** - Other available criteria You can also filter tasks by: - **Workspace** - **Favorites** To favorite a task, click the **Star** icon next to the task entry. ## Delete History You can remove past tasks in two ways: - **Delete specific tasks** – Deletes the specific tasks you select. - **Delete all history** – Clears all tasks. ## Reduce Token Usage with Chat History Summaries MuleSoft Vibes automatically summarizes conversation history to reduce total token consumption while preserving relevant context. As tasks grow in complexity, conversation history becomes larger. Instead of sending the full history with each interaction, Vibes compacts previous messages into summaries. This maintains performance and reduces tokens usage. Chat history summaries: - Preserve the intent and key decisions from earlier steps - Reduce redundant context sent to the model - Keep interactions fast and efficient Vibes manages this process automatically. You don’t need to manually trim or rewrite previous messages to optimize token usage. Even with automatic summarization, a conversation with a clear, bounded scope gives Vibes more useful context than one long thread covering unrelated work. If your work spans several distinct tasks, such as scaffolding a project, configuring connectors, and writing DataWeave transformations, start a new conversation for each one instead of continuing the same thread, so Vibes doesn’t keep the full context for changes unrelated to the current task. --- product: Anypoint Code Builder version: master --- # Viewing Logs and Errors > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Code Builder provides two ways to view logs and errors: - **ACB Logs** tab: A centralized view that consolidates warnings and errors from all Anypoint Code Builder extensions into a single, filterable panel. Use this view to quickly identify and troubleshoot issues. - **Output** panel: Displays detailed, raw logs from individual extension channels. Use this view for in-depth investigation when you need complete log output. ## View Errors and Warnings The **ACB Logs** panel provides a centralized view of all warnings and errors generated by Anypoint Code Builder. This panel consolidates logs from multiple extension channels into a single, searchable interface. To open this panel, click the **ACB Logs** tab in the Panel area, alongside other tabs such as Output, Problems, and Debug Console. The panel displays log entries in a table with the following columns:
ColumnDescription

Date

Timestamp of when the log entry was recorded.

Log Level

Severity of the log entry (Error, Warning, Info).

Extension

The Anypoint Code Builder extension that generated the log.

Message

The detailed text of the log entry.

Project

The name of the project related to the log entry.

### Filter and Search Logs Use filters to narrow down the log entries displayed: - **Level**: Filter by log severity (Error, Warning, Info). - **Source**: Filter by the extension that generated the log. - **Date**: Filter by date range. To search for specific text within the logs, use the search bar. ### Expand Log Details Click a log entry to expand it and view additional details, such as the full stack trace. ### Clear Logs To remove all log entries from the panel, click **Clear logs**. ### Export Logs for Troubleshooting When you export troubleshooting information using the `MuleSoft: Export Troubleshooting Information` command, Anypoint Code Builder automatically includes the logs in the exported file. For more information, see [Export Troubleshooting Information](https://docs.mulesoft.com/anypoint-code-builder/troubleshooting#export-troubleshooting-info). ## View Detailed Logs in the Output Panel For in-depth investigation, use the Output panel to view raw, detailed logs from individual Anypoint Code Builder extension channels. To open and configure the Output panel: 1. Open the Output panel using one of these methods: - Use the keyboard shortcuts: Cmd+Shift+u (Mac) or Ctrl+Shift+u (Windows) - Select **View** > **Output**: ![The View and Output options are displayed in a list of menu choices](/mulesoft/current/en-us/anypoint-code-builder/_images/select-specific-output-view.png) 2. In the Output panel, select an output channel from the dropdown list: ![A menu bar with the Mule DX Server tab open](/mulesoft/current/en-us/anypoint-code-builder/_images/select-mule-dx-server.png) Common channels include: - **Mule DX Server**: General logs from the Anypoint Code Builder backend. - **Mule DX Server: Scaffolding**: Logs specific to project scaffolding operations. The Output panel displays the complete log stream for the selected channel, which is useful for debugging complex issues that require full context. --- product: Anypoint Code Builder version: master --- # Viewing Project Dependencies > For the full documentation index, see: https://docs.mulesoft.com/llms.txt View the dependencies added to a project without inspecting the POM file. The **Project Dependencies** list in Explorer shows each Exchange asset and version. Expand an entry to see nested assets that a dependency pulls in. ## Before You Begin - [Set up and access Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/start-acb). - Open a project that includes dependencies from Anypoint Exchange. ## View Project Dependencies To open the **Project Dependencies** list: 1. Open the Command Palette. Show me how - Use the keyboard shortcuts: - Mac: Cmd+Shift+p - Windows: Ctrl+Shift+p - Select **View** > **Command Palette**. 2. Select this command: ```command MuleSoft: Show Project dependencies ``` Anypoint Code Builder opens Explorer and expands **Project Dependencies**. Each entry identifies an Exchange asset and its version. Use this list to see what the project depends on without inspecting the POM file (`pom.xml`). If a dependency pulls in other Exchange assets, expand its entry to see those nested dependencies. Alternatively, expand **Project Dependencies** directly in Explorer. Anypoint Code Builder downloads dependency files to the `.exchange_modules` directory in your home directory. The **Project Dependencies** list shows those assets in the IDE. ## See Also - [Creating and Using API Spec Fragments](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-fragments) - [Using the Command Palette](https://docs.mulesoft.com/anypoint-code-builder/start-use-command-palette) - [Command Reference](https://docs.mulesoft.com/anypoint-code-builder/ref-acb-commands) --- product: Anypoint Code Builder version: master --- # Workflows and Rules > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use workflows and rules to customize how MuleSoft Vibes operates within your project. Rules define natural-language constraints that MuleSoft Vibes follows when generating content. Use rules to enforce organizational conventions, ensure consistent error handling, and maintain coding standards across your workspace. You can define rules at two levels: - **Global** – Applies to all messages sent to Mulesoft Vibes. - **Workspace** – Applies only to the active workspace. Workflows create predefined multi-step tasks that MuleSoft Vibes executes automatically. Workflows let you streamline repeated development steps and can be triggered using slash commands (for example, `/workflow-name`) in the Mulesoft Vibes panel. ## Add Workflows or Rules 1. Open MuleSoft Vibes in the sidebar. 2. Select **Settings**. 3. In the **Rules and Workflows** section, add a rule or a workflow. 4. Select **Add Rule** or **Add Workflow**. 5. Provide the required information: - For rules, enter the natural-language instruction to follow. - For workflows, enter a name, an optional description, and the steps the workflow must run. 6. Select **Save**. You can edit or delete existing rules and workflows from the same section. ### Rule Examples You can use rules to guide how MuleSoft Vibes generates or validates content. For example: - **Naming convention rule**: Instruct MuleSoft Vibes to ensure that all API names follow your organization’s naming standards. - **Validation rule**: Require that every API specification includes version information before generating related files. - **Security rule**: Ask MuleSoft Vibes to flag endpoints that expose sensitive data without authentication. Example rule text to enter in **Add Rule**: ```text When generating RAML files, enforce this naming pattern: --api. If the API title or baseUri doesn't follow the pattern, return a warning and suggest a corrected value. ``` #### Workflow Examples Workflows define a sequence of steps that MuleSoft Vibes executes to complete a task. For example: - **API design validation workflow**: Validate an API specification, check naming conventions, verify security requirements, and generate a summary of issues. - **API creation workflow**: Generate an API specification, apply validation rules, suggest improvements, and save the final version to the workspace. - **Troubleshooting workflow**: Analyze an error, identify the root cause, propose a fix, and update the configuration if needed. Example workflow definition to enter in **Add Workflow**: ```text Name: api-design-review Description: Run governance checks before publishing a RAML spec. Steps: 1. Validate RAML syntax and required metadata. 2. Check naming conventions from workspace rules. 3. Check for unsecured endpoints that expose sensitive fields. 4. Summarize findings with required fixes and suggested improvements. ``` ## Add Commands Commands provide quick shortcuts for interacting with MuleSoft Vibes. You can invoke any command by typing `/` in the message input box. MuleSoft Vibes includes several built-in commands.
CommandDescription

/newrule

Create a new rule based on the current conversation.

/newchat

Start a new chat that carries over context from your current task.

/reportbug

Report a malfunctioning output by creating a GitHub issue with the MuleSoft Vibes format.

Workflows that you define also appear as commands under **Workflow Commands**. You can trigger them the same way by typing `/` followed by the workflow name. Example command usage: - ```command /api-design-review ``` ## Enforce Organizational Conventions with Rulesets Define and apply organizational conventions with rulesets across your development workflows using natural language. By creating rules at the global or workspace level, you can standardize how MuleSoft Vibes generates APIs, integrations, and related assets. Rulesets help you: - Enforce naming and design standards across teams - Apply consistent validation and security requirements - Reduce manual review by guiding generation upfront Because rules are written in natural language, you can describe expectations without needing formal configuration or code. MuleSoft Vibes applies these rules automatically when processing messages and executing workflows. To share workspace rules and skills from GitHub, see [Sharing Rules and Skills from GitHub with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-share-rules-skills-github). --- product: Anypoint Code Builder version: master --- # Working with Secure Properties Using MuleSoft Vibes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Instead of manually creating files and editing XML, use MuleSoft Vibes to set up secure properties conversationally. MuleSoft Vibes can automatically encrypt values, create configuration files, update XML, and validate your setup. For information about secure properties concepts and manual configuration, see [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs). ![Diagram showing secure properties flow from runtime argument to global-configs.xml to encrypted properties file to flow references](/mulesoft/current/en-us/anypoint-code-builder/_images/int-secure-properties-overview-diagram.png) Figure 1. How secure properties work ## Set Up Secure Properties from Scratch To set up secure properties, send a message to MuleSoft Vibes that asks to configure secure properties for your credentials and specifies the encryption algorithm to use. For example: Set up secure properties for my Salesforce credentials using AES/CBC encryption MuleSoft Vibes: - Adds the `mule-secure-configuration-property-module` dependency to `pom.xml` - Adds the `` element to `global-configs.xml` - Adds the required namespace and schema location - Updates connector configurations to use `${secure::}` references - Creates the `.secure.properties` file structure ## Encrypt a Value To encrypt a specific value, send a message to MuleSoft Vibes that includes the value to encrypt, your encryption key, and the algorithm to use. For example: Encrypt the value 'MyPassword123' using my encryption key MuleSecureKey024 with AES CBC MuleSoft Vibes runs the secure-properties-tool and returns the encrypted value ready to paste into your properties file. ## Add a New Credential to an Existing Setup To add a new encrypted property, send a message to MuleSoft Vibes that specifies the property name and value to encrypt. For example: Add a new secure property called 'netsuite.password' with the value 'NS-Prod-Pass!' to my secure properties files MuleSoft Vibes encrypts the value and adds it to the appropriate `.secure.properties` file. ## Switch from Plaintext to Secure To convert existing plaintext credentials to secure properties, send this message to MuleSoft Vibes: Convert all the plaintext Salesforce credentials in my project to use secure properties MuleSoft Vibes: - Scans for hardcoded or plaintext credential values - Encrypts each value - Moves them to `.secure.properties` files - Updates XML references from `${salesforce.password}` to `${secure::salesforce.password}` ## Set Up Multi-Environment Secure Properties To create environment-specific secure properties files, send a message to MuleSoft Vibes that specifies the environment name and requests the `$site.secure.properties` pattern. For example: Create a secure properties file for prod with the ${env}.secure.properties pattern MuleSoft Vibes creates the environment-specific file and configures the dynamic file reference in `global-configs.xml`. For more information about multi-environment configuration, see [int-create-secure-configs.adoc#create-prop-file](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs#create-prop-file). ## Validate Your Setup To check if your secure properties are configured correctly, send this message to MuleSoft Vibes: Check if my secure properties are configured correctly MuleSoft Vibes validates: - The dependency is in `pom.xml` - The `` element exists with the correct namespace - Referenced keys exist in the `.secure.properties` files - The encryption key is configured in `launch.json` for local runs ## Rotate the Encryption Key To change your encryption key and re-encrypt all values, send a message to MuleSoft Vibes that specifies the old key, the new key, and asks to re-encrypt all values. For example: Rotate my encryption key from MuleSecureKey024 to NewSecureKey2025 and re-encrypt all values MuleSoft Vibes: - Decrypts all values with the old key - Re-encrypts with the new key - Updates all `.secure.properties` files - Updates `launch.json` with the new key ## Skills MuleSoft Vibes Uses When you ask MuleSoft Vibes to work with secure properties, it invokes specialized skills that handle the tasks:
SkillWhat It Does

Secure Mule App
(/secure-mule-app)

Scans for sensitive data, encrypts values using the secure-properties-tool JAR, creates .secure.properties files, updates XML with ${secure::} references, adds the pom.xml dependency, and configures launch.json.

Manage Global Configurations
(/manage-global-configurations)

Creates the <secure-properties:config> element in global-configs.xml, manages namespaces, handles the $site.secure.properties multi-environment pattern, and validates the build.

Build Mule Integration
(/build-mule-integration)

When generating new flows that need credentials, automatically includes secure property placeholders and wires up the secure config element.

These skills work together. For example, when you say "convert my plaintext credentials to secure properties," MuleSoft Vibes uses **Secure Mule App** to encrypt and create the files, then **Manage Global Configurations** to wire up the XML config element and validate everything builds. For more information about skills in MuleSoft Vibes, see [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills). ## Common MuleSoft Vibes Prompts for Secure Properties Use these example prompts to work with secure properties:
What You WantWhat to Ask MuleSoft Vibes

Initial setup

"Set up secure properties for this project"

Encrypt a single value

"Encrypt 'my-secret' with key X using AES CBC"

Add credentials

"Add encrypted DB credentials to my secure properties"

Convert plaintext

"Move my hardcoded passwords to secure properties"

Production setup

"Create a prod secure properties file"

Check configuration

"Validate my secure properties setup"

Debug issues

"Why is my secure property not resolving?"

Key rotation

"Rotate my encryption key to a new value"

## See Also - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Managing Global Configuration Elements](https://docs.mulesoft.com/anypoint-code-builder/int-global-config-elements) - [Using Skills with MuleSoft Vibes](https://docs.mulesoft.com/anypoint-code-builder/vibes-skills) - [MuleSoft Vibes Overview](https://docs.mulesoft.com/anypoint-code-builder/mulesoft-vibes) - [MuleSoft Vibes for Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/vibes-get-started) --- product: Anypoint Code Builder version: master --- # Working with Workspaces > For the full documentation index, see: https://docs.mulesoft.com/llms.txt 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](#fix-nested-project). Use a multi-root workspace when you work on an API-led architecture that spans an experience API, one or more process APIs, and one or more system APIs. By grouping these related projects in a single workspace, you can configure a multi-project run configuration that deploys all projects to the same local runtime, so you can validate service-to-service calls across the stack. See [Running Multiple Mule Applications Concurrently](https://docs.mulesoft.com/anypoint-code-builder/int-run-multiple-mule-apps) for additional information. ## 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 **Create** menu, select the project type. For example, **Implement an API** or **Develop an Integration**. - From the Command Palette, run the appropriate command. For example, `MuleSoft: Implement an API Specification`. - Ask MuleSoft Vibes to create the project using natural language. 2. In the project creation form, select **Add to workspace**. You can create a new workspace or add the project to an existing workspace. 3. Complete the remaining project configuration options. 4. Click **Create Project**. Anypoint Code Builder creates the project and adds it to the selected workspace. ## Import an Anypoint Studio Workspace If you have existing projects in Anypoint Studio, you can import your Studio workspace into Anypoint Code Builder. This approach references your existing Studio projects and keeps them in sync. To instead package and import a single project as a JAR file, see [Migrating Mule Projects from Anypoint Studio to Anypoint Code Builder](https://docs.mulesoft.com/anypoint-code-builder/int-migrate-studio-to-acb). 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 - Select **View** > **Command Palette**. 2. Select the following command: ```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](/mulesoft/current/en-us/anypoint-code-builder/_images/imp-local-api-open-workspace.png) ### Open a Workspace with MuleSoft Vibes You can ask MuleSoft Vibes to switch workspaces using natural language, such as: - "Open my Orders API workspace" - "Switch to the `` 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 - Select **View** > **Command Palette**. 2. Select the following command: ```command Workspaces: Close Workspace ``` ## Actions in Workspaces Anypoint Code Builder organizes actions based on their scope:
Action TypeLocation

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. > [!IMPORTANT] 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 in either of these cases: - 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. - You open a parent directory that contains multiple Mule projects without configuring it as a multi-root workspace. To fix this issue, open the project folder at the root level or add it (or each project in the parent directory) 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. > [!TIP] If you frequently work with multiple projects, creating a workspace from the start avoids > this issue. See [Create a Project in a Workspace](#create-project-workspace). ## See Also - [Iteratively Design and Implement APIs](https://docs.mulesoft.com/anypoint-code-builder/imp-implement-local-apis) - [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) - [Creating and Importing API Specifications](https://docs.mulesoft.com/anypoint-code-builder/des-create-api-specs) - [Multi-root Workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces) in the VS Code documentation