Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

About the Salesforce Connector

The Salesforce connector lets you access and act upon data in Salesforce from within a Mule app. The connector exposes methods for exploiting the capabilities of Salesforce and working with Apex classes, and it supports all integration patterns that Salesforce recognizes for connecting to other systems.

Integration Pattern Description

Remote Process Invocation: Request-Reply

Salesforce kicks off a process in a remote system, waits for the remote system to finish processing, then accepts control back again from the remote system.

Remote Process Invocation: Fire and Forget

Salesforce initiates a process in a third-party system and receives an acknowledgement that the process has started. The third-party system continues processing independent of Salesforce.

Batch Data Synchronization

An external system accesses, changes, deletes, or adds data in Salesforce in batches, and vice versa (Salesforce to external system).

Remote Call-In

An external system accesses, changes, deletes or adds data in Salesforce, and vice versa (Salesforce to external system).

User Interface Update Based on Data Changes

The Salesforce UI updates in response to a change in a third-party system.

Requirements for using the connector:

  • Salesforce developer account (Salesforce)

  • Security token - You can receive a new security token by email if you run Reset Security Token through My Personal Information from the Salesforce Setup pages.

  • Consumer key and Secret - Required if you are using the OAuth API. 

  • Namespace and schema location: If you plan to create the XML for your Mule application by hand, you need to include the correct namespace and schema location in your XML file. Anypoint Studio adds this information to the XML file automatically when you add the Salesforce connector to a flow in a Mule app.

The connector supports a number of triggers to initiate the flow in a Mule app. In all cases, the channel or topic must be published to Salesforce before a subscription to that channel can be created.

  • Replay Channel: Subscribes to a streaming channel. This trigger provides channel-related notification settings for new events and events stored by Salesforce within the 24-hour retention period. Events that take place in the specified channel trigger the flow.

  • Replay Topic: Subscribes to a topic. This trigger provides topic-related notification settings for new events and events stored by Salesforce within the 24-hour retention period. Events that take place on records in the specified topic trigger the flow.

  • Subscribe Channel: Subscribes to a streaming channel. This trigger provides channel-related notification settings for new events that take place after you subscribe.

  • Subscribe Topic: Subscribes to a topic. This trigger provides topic-related notification settings for new events that take place after you subscribe.

The Salesforce connector provides a number of operations that you can add to a flow in a Mule app:

  • Abort Job

  • Batch Info, Batch Info List, Batch Result, Batch Result Stream

  • Close Job

  • Convert Lead

  • Create, Create Bulk, Create Job, Create Metadata, Create Single

  • Create Batch, Create Batch For Query, Create Batch Stream

  • Delete, Delete Metadata

  • Deploy Metadata

  • Describe Global, Describe Metadata, Describe Sobject

  • Find Duplicates

  • Get Deleted, Get Deleted Range

  • Get Mule Context

  • Get Server Timestamp, Get Session Id, Get Updated, Get Updated Objects, Get Updated Range, Get User Info

  • Hard Delete Bulk

  • Invoke Apex Rest Method, Invoke Apex Soap Method

  • Job Info

  • List Metadata

  • Merge

  • Non Paginated Query

  • Publish Streaming Channel, Publish Topic

  • Push Generic Event

  • Query, Query All, Query Result Stream, Query Single

  • Read Metadata

  • Rename Metadata

  • Reset Password

  • Retrieve, Retrieve Metadata

  • Search

  • Set Mule Context, Set Password

  • Update, Update Bulk, Update Metadata, Update Single

  • Upsert, Upsert Bulk, Upsert Metadata

Triggers and operations are described in Salesforce Connector Reference.

About Events

Each event that travels through your flows contains information about the Salesforce data that has changed, how it changes, and when. The connector parses this information and sends you information that a flow can work with.

Inbound properties of events:

  • payload

  • createdDate

  • replayId

About Message Retention in Salesforce

Salesforce stores events for 24 hours, so you can retrieve stored events during that retention window. A subscriber (to a topic or channel) can retrieve events at any time and is not restricted to listening to events at the time they are sent.

Each broadcasted event is assigned a numeric ID. IDs are incremented and not guaranteed to be contiguous for consecutive events. Each ID is guaranteed to be higher than the ID of the previous event. For example, the event following the event with ID 999 can have an ID of 1,025. The ID is unique for the organization and the channel. The IDs of deleted events are not reused.