Monitor and Debug Asynchronous Callouts

Asynchronous callouts are monitored as jobs using the Background Operations app or with Apex log lines in the Developer Console. To debug your code at runtime, use Apex log lines.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions

Use the Background Operations app for the most detailed status information about your asynchronous callouts.

Use Apex log lines in the Developer Console when it's more convenient for your workflow.

External Services Asynchronous Callout States

Here are the External Services asynchronous callout states that appear in both the Background Operations app and in the Debug log.

State Description
Completed The initial synchronous response and processing of the asynchronous response are successful.
Running The job is waiting for the asynchronous response.
Error There are two possibilities: The synchronous, initial response from the external web service has encountered an error (40x, 50x, and so on). Or Salesforce has received the asynchronous response and encountered a processing error.

Monitor and Debug Asynchronous Callbacks Using the Background Operations App

For the most detailed status and debugging information, use a filtered list view in the Background Operations App.

  1. From the App Launcher, find and select Background Operations.
  2. To see all External Services asynchronous jobs, create a custom list. Using the List View Controls, select New.
  3. Give the new list view a name, for example, "External Services Asynchronous Callouts" and save your changes.
  4. Under Filter, click Add a Filter.
  5. Click Field, and select Type.
  6. Set Operator to Equals.
  7. Under Value, select ExternalServiceCallback, and then click Done.
  8. Save your changes.
    Optionally, pin the new list view to have it show right away when you open the Background Operations app.
  9. To review operation details, click the background operation name.

The Error Message field provides information for detailed debugging. If there are no errors listed, and the Status of the job is Completed, then the job and the resulting Salesforce processing (for example, "create Contacts") have finished successfully.

Monitor and Debug Asynchronous Callbacks Using Apex Log Lines in the Developer Console

Debug logs allow fine-grained logging for each logging category.

Note
Note If you have a top-level input parameter defined for callback URLs, and it's a valid callback expression, then in the Input Parameter column, the details of the input parameter has a callback URL description. For example, https://MyDomainName.my.salesforce.com/services/data/v60.0/externalservices/callback/ 0EXAMPLE0000000q/applicationOutcomeApproved.

Although External Services callbacks are inbound calls that don’t involve a named credential, External Services log under the category Callout as part of Named Credentials callout events. Use these events to log end-to-end asynchronous callouts.

Event Name Description Category Log Level
EXTERNAL_SERVICE_REQUEST Logs external service callout request. Schema version, protocol, operation, request payload in the JSON up to a given size. Callout INFO and above
EXTERNAL_SERVICE_RESPONSE Logs the initial, synchronous HTTP response. Schema version, protocol, normal output or exception, parameter name, operation. Logs the initial, synchronous HTTP response payload (output or exception) in JSON up to a given size. Callout INFO and above
EXTERNAL_SERVICE_CALLBACK Logs the asynchronous callback response. Includes Schema version, protocol, and the asynchronous callback payload in JSON up to a given size. Callout INFO and above

Find Debug Logs for Asynchronous Callouts

Use Apex logging for monitoring, troubleshooting, and debugging External Services Asynchronous Callouts.

To open debug logs, select the Logs tab in the Developer Console.
Logs open in the Log Inspector.