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

Designing for Reality: Integrating 837 Claims When X12 Meets Production
BlogFeb 11, 2026

Designing for Reality: Integrating 837 Claims When X12 Meets Production

Designing 837 Claim Integration for Real-World Healthcare Systems When it comes to 837 claim integration, most architects assume the X12 specification guarantees predictability. On paper, the 837 Professional, Institutional, and Dental transactions look clean and orderly. In production? Not even close. Real-world 837 files behave differently across trading partners. Loops appear conditionally. Repeatable segments shift… Continue reading Designing for Reality: Integrating 837 Claims When X12 Meets Production

Read More
Blog
5 min read

Designing for Reality: Integrating 837 Claims When X12 Meets Production

Designing 837 Claim Integration for Real-World Healthcare Systems When it comes to 837 claim integration, most architects assume the X12 specification guarantees predictability. On paper, the 837 Professional, Institutional, and Dental transactions look clean and orderly. In production? Not even close. Real-world 837 files behave differently across trading partners. Loops appear conditionally. Repeatable segments shift… Continue reading Designing for Reality: Integrating 837 Claims When X12 Meets Production

Read More
AI-Driven PDF Parsing in Salesforce
BlogDec 4, 2025

AI-Driven PDF Parsing in Salesforce

Introduction For the current digital ecosystem, data is an important aspect for decision-making. Yet, for many organizations, a significant portion of this valuable data remains locked away in unstructured formats. Organizations handle thousands of PDF documents daily — ranging from contracts and invoices to lab reports, quotations, and service agreements. Traditionally, extracting structured data from… Continue reading AI-Driven PDF Parsing in Salesforce

Read More
Blog
6 min read

AI-Driven PDF Parsing in Salesforce

Introduction For the current digital ecosystem, data is an important aspect for decision-making. Yet, for many organizations, a significant portion of this valuable data remains locked away in unstructured formats. Organizations handle thousands of PDF documents daily — ranging from contracts and invoices to lab reports, quotations, and service agreements. Traditionally, extracting structured data from… Continue reading AI-Driven PDF Parsing in Salesforce

Read More
Compression Namespace in Apex: A Powerful New Salesforce Feature
BlogNov 5, 2025

Compression Namespace in Apex: A Powerful New Salesforce Feature

Introduction Working with documents inside Salesforce has always challenged developers because of the platform’s multitenant constraints. Previously, packaging and sending files in a compact form required external services, like an AWS Lambda function, that retrieved files via API and then compressed them. With the introduction of the Compression Namespace and the powerful pre-defined Apex functions,… Continue reading Compression Namespace in Apex: A Powerful New Salesforce Feature

Read More
Blog
5 min read

Compression Namespace in Apex: A Powerful New Salesforce Feature

Introduction Working with documents inside Salesforce has always challenged developers because of the platform’s multitenant constraints. Previously, packaging and sending files in a compact form required external services, like an AWS Lambda function, that retrieved files via API and then compressed them. With the introduction of the Compression Namespace and the powerful pre-defined Apex functions,… Continue reading Compression Namespace in Apex: A Powerful New Salesforce Feature

Read More
Boost LWC Performance with Debouncing
BlogSep 18, 2025

Boost LWC Performance with Debouncing

Introduction Lightning Web Components (LWC) is a modern framework for building fast and dynamic user interfaces on the Salesforce platform. However, one common challenge in web development, including LWC, is efficiently handling user input, especially when dealing with rapid or repetitive events, such as typing in a search field. This is where debouncing becomes an… Continue reading Boost LWC Performance with Debouncing

Read More
Blog
7 min read

Boost LWC Performance with Debouncing

Introduction Lightning Web Components (LWC) is a modern framework for building fast and dynamic user interfaces on the Salesforce platform. However, one common challenge in web development, including LWC, is efficiently handling user input, especially when dealing with rapid or repetitive events, such as typing in a search field. This is where debouncing becomes an… Continue reading Boost LWC Performance with Debouncing

Read More