Mule 4 connectors for Salesforce

Published on
September 29, 2021
Author
MuleSoft Integration Team
Mule 4 connectors for Salesforce

Anypoint Connector for Salesforce (Salesforce Connector) enables us to create apps that react to Salesforce events such as adding, changing, or deleting objects, topics, documents, and channels. Salesforce Connector enables us to connect to the Salesforce APIs.

In this blog we will dive into usage, configuration and output parameters of 5 most useful connectors.

1. Create Job Bulk API v2:

Uploading records stored in the CSV format to Salesforce is one the most common use cases MuleSoft Customers use. Among the many ways to fulful this functionality, dataloader.io is the most common data loader on Salesforce AppExchange along with Anypoint’s Salesforce connector with various operations.

Usage: With Create job bulk API v2 we can upload our records stored in CSV format to Salesforce. We can drag and drop the connector, and further configure it.

Input Parameters: We need to pass the Salesforce object name and external id.

Example:

demoSalesforce:  

type: "Demo_Salesforce__c"

externalId: "External_Key__c"

[Payload should be of CSV type]

Example:

External_Key__c,Account_Id__r
xyz1234,ACC1234

Create Bulk JOB API

Connector Configuration:

Create bulk job API 2

Output Parameters:

The result of get job bulk state v2 in JSON format

{
  "lineEnding": "LF",
  "numberRecordsFailed": 0,
  "externalIdFieldName": "External_Key__c",
  "numberRecordsProcessed": 0,
  "systemModstamp": "2021-09-08T12:22:31.000+0000",
  "errorMessage": null,
  "apiActiveProcessingTime": 0,
  "concurrencyMode": "Parallel",
  "retries": 0,
  "apexProcessingTime": 0,
  "createdDate": "2021-09-08T12:22:30.000+0000",
  "apiVersion": "50.0",
  "id": "75p0000XhzGAS",
  "state": "InProgress",
  "totalProcessingTime": 0,
  "jobType": "V2Ingest",
  "operation": "upsert",
  "contentType": "CSV",
  "createdById": "002w0008reAC",
  "columnDelimiter": "COMMA",
  "object": "Demo_Salesforce__c"
}

2. Get job state bulk api v2 

In Salesforce, we only have a job id. If we want a detailed job status, we need to use workbench and query.

Get Job ID connector

Usage: Get Job state bulk api v 2 is a connector we use to get the job status of a bulk upsert job id. It provides us detailed results in a JSON format.

Input Parameters: We need to provide a Job Id. Ex. 750p0000007X7ze

Bulk Job Flow

Connector Configuration:

job state bulk api

Output Parameters: The result of get job bulk state v2 in JSON format

 {
  "lineEnding": "LF",
  "numberRecordsFailed": 0,
  "externalIdFieldName": "External_Key__c",
  "numberRecordsProcessed": 1,
  "systemModstamp": "2021-09-08T12:22:33.000+0000",
  "errorMessage": null,
  "apiActiveProcessingTime": 177,
  "concurrencyMode": "Parallel",
  "apexProcessingTime": 0,
  "retries": 0,
  "createdDate": "2021-09-08T12:22:30.000+0000",
  "apiVersion": "50.0",
  "state": "JobComplete",
  "id": "75p0007hzGAS",
  "totalProcessingTime": 250,
  "jobType": "V2Ingest",
  "operation": "upsert",
  "contentType": "CSV",
  "createdById": "005w0008FreAC",
  "columnDelimiter": "COMMA",
  "object": "Demo_Salesforce__c"
}

3. Query:

Usage: Query is a connector which is similar to db query but this connector we use to execute salesforce query(SOQL). We use a query connector to get the details of the salesforce object and configure the listener to trigger the request.

Input Parameters: The SOQL query to retrieve the records

Example:

Account_Id_Salesforce__c, Demo_Salesforce_Id__c FROM Demo_Salesforce__c

Query/ Salesforce Connector/Flow

Connector Configuration:

connector configuration

Output Parameters: Result of the SOQL Query in JSON format.

[
  {
    "Account_Id_Salesforce__c": XYZ123,
    "Demo_Salesforce_Id__c": 67.0
  },
  {
    "Account_Id_Salesforce__c": "12JK345",
    "Demo_Salesforce_Id__c": 34.0
  },
  {
    "Account_Id_Salesforce__c": "12NJ455",
    "Demo_Salesforce_Id__c": "45.0"
  },
  {
    "Account_Id_Salesforce__c": "12BB455",
    "Demo_Salesforce_Id__c": "43.0"
  },
  {
    "Account_Id_Salesforce__c": "12RF55",
    "Demo_Salesforce_Id__c": "48.0"
  }
]

4. Upsert

Usage: In upsert operation, Salesforce internally validates the data based on Object’s Id or External ID. So, upsert takes a little bit longer time than insert or update. Using the upsert operation, we can either insert or update an existing record in one call.

Input Parameters:  We need to pass the Salesforce object name and external id. 

Example:

demoSalesforce:  

type: "Demo_Salesforce__c"

externalId: "External_Key__c"

Payload’s mime type is java.

Example:

[
{
"Demo_Id__r": {
"Demo_Number__c": "143",
"type": "Demo_Header__c"
},
"Demo_Line_Item_Id__c": "143-1",
"Site_Name__c": "DemoS1",
"Product__r": {
"Product_Id__c": "\ABCXY767",
"type": "Product2"
},
"Speed__c": "UC",
"Contract_Terms__c": "ContractTerms",
"Request_Types__c": "New Provision",
"Quantity__c": "5",
"Billing_OTC__c": "2",
"Billing_RC__c": "4",
"CurrencyIsoCode": "SGD"
}
]

Upsert Salesforce

Connector Configuration: 

Upsert Salesforce

Output Parameters: The result of upsert in JSON format.

{
"id": null,
"items": [
{
"exception": null,
"message": null,
"payload": {
"created": false,
"success": true,
"id": "a10000zOPQEA2",
"errors": [
]
},
"id": "a1p000PQEA2",
"successful": true,
"statusCode": null
}
],
"successful": true
}

5. Update

Usage: In update operation, Salesforce internally validates the data based on
Object’s Id. Update the corresponding Salesforce object with the new values.

Input Parameters: We need to pass the Salesforce object name.

demoSalesforce:
type: "Demo_Salesforce__c"

Payload in JSON Format
Example:

[
{
"External_Key__c": "_ACCUEN1414091|55789|202108",
"service_no__c": "55789",
"demo__c": "23",
"service__c": "#N/A",
"month_yyyymm__c": "202108",
"Id": "a12p000nAG"
}
]

Upsert_Mule_Salesforce_Connectors

Connector Configuration:

Upsert Connector Configuration

Output Parameters: The result of upsert in JSON format

{
"id": null,
"items": [
{
"exception": null,
"message": null,
"payload": {
"success": true,
"id": "a1200EAAG",
"errors": [
]
},
"id": "a10003SAG",
"successful": true,
"statusCode": null
}
],
"successful": true
}

Recent Blogs

Salesforce Pricing Automation: Boost Efficiency And Accuracy with Apex Triggers
BlogSep 9, 2025

Salesforce Pricing Automation: Boost Efficiency And Accuracy with Apex Triggers

Introduction In order to succeed in today’s fast-paced business landscape, precision and speed define competitive advantage. For businesses, especially those managing complex product catalogs, ensuring accurate pricing on sales orders or custom lines can be a time-consuming and error-prone task. To overcome this challenge, Salesforce trigger handlers offer a powerful solution to automate the entire… Continue reading Salesforce Pricing Automation: Boost Efficiency And Accuracy with Apex Triggers

Read More
Blog
6 min read

Salesforce Pricing Automation: Boost Efficiency And Accuracy with Apex Triggers

Introduction In order to succeed in today’s fast-paced business landscape, precision and speed define competitive advantage. For businesses, especially those managing complex product catalogs, ensuring accurate pricing on sales orders or custom lines can be a time-consuming and error-prone task. To overcome this challenge, Salesforce trigger handlers offer a powerful solution to automate the entire… Continue reading Salesforce Pricing Automation: Boost Efficiency And Accuracy with Apex Triggers

Read More
Connecting MuleSoft and Azure SQL with Entra ID
BlogJul 14, 2025

Connecting MuleSoft and Azure SQL with Entra ID

Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID

Read More
Blog
2 min read

Connecting MuleSoft and Azure SQL with Entra ID

Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID

Read More
Understanding Salesforce Flow Approval Processes
BlogJun 30, 2025

Understanding Salesforce Flow Approval Processes

Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes

Read More
Blog
5 min read

Understanding Salesforce Flow Approval Processes

Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes

Read More
Capturing Real-time Record Updation Using LWC
BlogMay 14, 2025

Capturing Real-time Record Updation Using LWC

Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC

Read More
Blog
5 min read

Capturing Real-time Record Updation Using LWC

Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC

Read More