Creating Integrations Using Agentforce | MuleSoft Documentation
# Creating Integrations Using Agentforce
Cloud IDE 
Desktop IDE 
The Agentforce generative flow feature in Anypoint Code Builder transforms your natural language input, which describes your business logic, into a flow that contains the connector operations and processors, in the correct order, to accomplish the specified task.
For example, if you want to create a flow that reads contacts from Salesforce in JSON format, enter a message describing that task. The message is then transformed into a series of the connector operations and processors needed to execute that task, in this case: Listener, Query, Transformer, and Logger.
Agentforce generates a flow, which you can then further configure to suit your specific needs.
## Before You Begin
Before you start creating your integration:
  * Set up and access the web or desktop IDE.
  * Ensure that you have the required Anypoint Code Builder permissions.
  * Ensure that you have these permissions to use the Anypoint Code Builder Agentforce feature:
    * Anypoint Code Builder Developer
    * Mule Developer Generative AI User
  * Einstein must be enabled in Access Management. For more information, see Enabling Einstein for Anypoint Platform.


## Access Agentforce
There are two ways to open Agentforce:
  * When you create a new integration project, click a card in the flow canvas. For example, the **Build a Flow with Agentforce** card.
  * Click the Agentforce icon in the toolbar.


## Create a New Integration Project
To create a new integration development project:
  1. In the activity bar of the IDE, click the (**Anypoint Code Builder**) icon.
  2. From **Quick Actions** , click **Develop an Integration** :
  3. Complete the **Develop an Integration** form:
Field Name | Field 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 flow builder canvas appears with starting cards.


To use Agentforce to generate a flow, click **Use Agentforce** in the **Build a Flow with Agentforce** card. To use connectors, click **Connect to an agent** or **Create an MCP server** in the **Build Agent-Enabled Apps** card.
To build your flow from scratch, click **Build a flow** in the **Start From Scratch** card.
## Craft Your Input
Before you create a flow, define what you want to achieve with the flow, for example, optimizing a business process. In the Agentforce pane, click **New Chat** and craft your message using natural language. Keep in mind that the more concise and specific you make your message, the more effective Agentforce is when generating your flow.
These are some best practices for writing messages:
  * Be clear and precise.
Use clear and specific language to describe the use case for the flow to build.
  * Include triggering events.
Mention the triggering events that initiate the flow, for example, sending an email when a new case is created.
  * Emphasize key components.
Highlight the key MuleSoft components and connector operations to include in the flow, for example, HTTP Connector **Listener** and Email Connector **Send** operations.
  * Specify the data objects.
Clearly mention the data objects to include in the flow, such as "Salesforce Account object" or any other relevant data source.
  * Proofread your message.
Review your message to ensure that it’s clear and comprehensive before you send it.


After Agentforce generates the initial flow, you can then customize the code for your specific needs. Or, you can continue the conversation to have Agentforce revise the flow after each message you send.
For examples of messages and generated flows, see Generative Flow Examples.
  * You can send up to 20 messages per chat. If you reach the limit, start a new chat.
  * Due to the sensitivity of LLMs and depending on which LLM is used, the same message can produce different responses. Sometimes, a similar message can produce different responses.

  
---  
## View Your Chat History
The message history for a project shows the previous 50 messages for that project. The history can be helpful for reference during the development process.
To see the chat history:
  1. Click the open chat history icon.
You see a list of your previous messages, up to the maximum of 50. You can rename your chats in chat history.
  2. Click a message in the list to see the details of the generated flow.
You can insert the code that was generated into your flow, or you can copy the code snippet and use or modify it elsewhere.


## Add a Flow to Your Project
Add a flow to your integration project using Agentforce:
  1. In the **Build a Flow with Agentforce** card, click **Use Agentforce**.
Optionally, click an example on the **Build a Flow with Agentforce** card to see how this feature works.
  2. If this is the first time you’re using this feature, agree to the terms, and continue.
The **Agentforce** panel opens:
  3. Enter a message to create the initial flow for your task.
Optionally, click an example to get started.
When your flow is ready, the code and a description of the components in the flow appear in the **Agentforce** panel:
  4. Optionally, click the thumbs up or thumbs down icon that appears after the generated code.
Rating the flow that’s created for you helps improve the quality of generative flows.
  5. Inspect the generated code. If you’re satisfied, click the insert code icon to add the code to your flow.
If you aren’t satisfied with the generated flow, try rewording your message and sending it again.


## Complete Your Flow
After Agentforce builds the flow, fill in information specific to your configuration as needed.
  1. After you inspect the code for your generated flow, you can either copy it into your clipboard or insert it with a single click using the **Insert** action.
After you insert the code, the initial flow is built and the visual representation of the flow is shown in the flow canvas next to the XML code tab.
Components that require further configuration display the error icon.
  2. Select the component in the canvas to determine where the error is.
Anypoint Code Builder highlights the location of the error within the configuration XML.


## See Also
  * Enabling or Disabling Einstein for Anypoint Platform
  * Generative Flow Examples
  * Developing Integrations Using Agentforce