Configuring Error Callback Service Spec flow service by using an example

Know how to configure the Error Callback Service Spec flow service by using an example.

About this task

Create a flow service that sends an email notification for listener failure events where the ErrorCallBackFlowService is started. The listener captures the event logs from the Salesforce application, and the logs are formatted as document references. Image showing the event logs captured by the Salesforce listener from the Salesforce application in this example.

Image showing the event logs captured by the Salesforce listener from the Salesforce application in this example.

Procedure

  1. Go to the flow service editor and provide a name for the flow service, say, ListenerCallbackService.
  2. In the flow step, select the function JSON DocumentToJSONString to convert errorDetails that are in document format to jsonString format.
  3. In the next flow step, select the function JSON DocumentToJSONString to convert results that are in document format to jsonString format.
    Both the logs are converted to JSON string format.
  4. In the next flow step, select the function Concat to concatenate the logs that are converted to jsonString format in steps 2 and 3.
  5. In the next flow step, select flow LogCustomMessage to log the concatenated message.
  6. In the next flow step, select the Send Email action from the Simple Mail Transfer Protocol (SMTP) connector to send the logged message in step 5 as an email.
    The flow service has the following steps:Image showing the steps created in flow service.
  7. Save and run the flow service.
    You receive an email with the failure details. Also, view the logged message under Flow service executions on the Monitor page.