Let’s Build Choreo Webhook for Salesforce Events

Click the +Create button on the Components page
Select Webhook
Give webhook component details
Select choreo managed repository. Then the written code is managed in a git repo generated by choreo.
Waiting for component creation
Click on the Edit Code button
Diagram and source code
username — Salesforce login usernamepassword — Salesforce login password appended with the security token (<password><security token>)channelName — The channel name to which a client can subscribe to receive event notificationsreplayFrom — The replay ID to change the point in time when events are read
`-1` — Get all new events sent after subscription. This option is the default
`-2` — Get all new events sent after subscription and all past events within the retention window
`Specific number` — Get all events that occurred after the event with the specified replay ID
configurable salesforce:ListenerConfig config = ?;

Salesforce Configs

Click on the setup gear icon near the profile -> Setup.
Then Search ‘data capture’ in the “Quick Find” search box and click on the “Change Data Capture” result that you find.
In the Change Data Capture UI, Search for Lead in the “Available Entities” section and select the object and press the marked arrow to move it to “Selected Entities”. Then press save.
Reset Security Token
level = INFO module = anuradha/salesforce_webhook message = "{\"Status\":\"Working - Contacted\",\"LastModifiedDate\":\"2022-05-29T09:49:47.000Z\",\"ChangeEventHeader\":\"{commitNumber=224850856080, commitUser=0058d0000024tO5AAI, sequenceNumber=1, entityName=Lead, changeType=UPDATE, changedFields=[Status, LastModifiedDate], changeOrigin=com/salesforce/api/soap/54.0;client=SfdcInternalAPI/, transactionKey=00015f0c-de5f-2a0e-6ebc-9b926a2deab7, commitTimestamp=1653817787000, recordIds=[00Q8d000004DZf4EAG]}\"}"
Info logs for change data
time = 2022-05-29T09:57:01.922Z level = INFO module = anuradha/salesforce_webhook message = "SF status change: Closed - Converted received for the lead ID: 00Q8d000004CT2XEAW"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store