Salesforce Real Time Events

List of Events Supported by SalesForce

Event IDSupportNotes
crm_accounts_newYes
crm_accounts_modifiedYes
crm_contacts_newYes
crm_contacts_modifiedYes
crm_deals_newYes
crm_deals_modifiedYes
crm_leads_newYes
crm_leads_modifiedYes
crm_engagements_newYes
crm_engagements_modifiedYes
crm_custom_objects_newNo
crm_custom_objects_modifiedNo

Subscribe to SalesForce Real Time Events

Step 1: Subscribe to events and Get the Webhook URL

To subscribe to real time events in SalesForce, you can use the Subscribe to Real Time Events API. A cURL for the same would look like:

curl --location 'https://api.getknit.dev/v1.0/events.subscribe' \
--header 'X-Knit-Integration-Id: <YOUR_INTEGRATION_ID>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
    "events": [
        "crm_accounts_new",
        "crm_accounts_modified",
        "crm_contacts_new",
        "crm_contacts_modified"
    ]
}'

The response for this would look like the following:

{
  "success": true,
  "data": {
    "webhookUrl": "https://workflows.getknit.dev/webhook/wt_6Vp9G5Xc3YVsJGbLMpRa8x"
  }
}

This would give you the webhook URL that needs to be registered on the Salesforce dashboard.

Now, let's proceed to the Salesforce Dashboard.

Step 2: Create Outbound Messages

  1. Navigate to Setup in Salesforce.
  2. In the Quick Find box, search for Outbound Messages.
  3. Click New Outbound Message.
  4. Select the desired Object (e.g., Account, Contact, Deal) and click Next.
  5. Enter the following details:
    • Name: Provide a unique name for the outbound message.
    • Endpoint URL: Enter the webhook URL where the data will be sent. This is the webhook URL received in the response above
    • Fields to Send: Select the required fields from the object. It is recommended to select all the fields in the dropdown.
  6. Click Save to create the outbound message.

Refer to the following video on how to create an Outbound message: https://www.loom.com/share/1d51bedd3fa141909da6d3e49eb83bcd

Step 3: Create a Workflow Rule

  1. Go to Setup and search for Workflow Rules in the Quick Find box.
  2. Click New Rule.
  3. Refer to the following video on how to create a Workflow in the flow builder and attach it to the Outbound Message created above: <https://www.loom.com/share/1d51bedd3fa141909da6d3e49eb83bcd>