Sunday, 18 October 2020

 Understanding Salesforce Outbound Messages

Outbound messaging allows you to specify that changes to fields within Salesforce can cause messages with field values to be sent to designated external servers.

After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it.

Outbound messaging uses the notifications() call to send SOAP messages over HTTP(S) to a designated endpoint when triggered by a workflow rule. 


Outbound messages need an endpoint URL which we need to mention while configuring outbound messages. 

You can use a postman or any of the following to create your own endpoint.

1. Requestbin 

2. Hookbin

3. Requestcatcher 

4. Integration Playground

for our example, we will use Integration Playground

Defining Outbound Messaging:

1. From Setup, enter Outbound Messages in the Quick Find box, then select Outbound Messages.

2. Click New Outbound Messages.

3. Choose the object that has the information you want to be included in the outbound message and click Next.

4. Configure the outbound message.

4.a. Enter a name and description for this outbound message.

4.b. Enter an endpoint URL for the recipient of the message. Salesforce send a SOAP message to this endpoint.

4.c. Select the Salesforce user to use when sending the message by specifying username in the User to Send as a field. The chosen user controls data visibility for the message that is sent to the endpoint.

4.d. Select 'Send Session ID' if you want a sessionId to be included in the outbound message. Include the sessionId in your message if you intend to make API calls back to Salesforce from your listener.

NOTE: The sessionId represents the user-defined in the previous step and not the user who triggered the workflow.

4.e. Select the fields you want to be included in the outbound message and click Add.

5. Click Save, and review the outbound message detail page.





To test Outbound Message, we created a workflow and our outbound message as an action.



Our workflow rule runs anytime any change happens on the Account record and once an Outbound message action sends the information to an endpoint.

Our Request and acknowledged response on the Integration playground looks like 



On Integration playground change the returned response from true to false using the 'Toggle' button, this will sends the failed response back to Salesforce.




we can verify this from salesforce, In Salesforce go to Setup > Monitoring > Outbound Messages.