Abort a Job Chain

Stops the running job chain worker for a sales org.

Use this feature when a job chain is stuck or when a large number of jobs was scheduled by mistake. A job chain is a set of processing jobs that depend on each other. CG Cloud Processing Services runs job chains outside Salesforce. A job chain worker picks up the jobs and runs them in order. Aborting a job chain ends the job chain worker.

Aborting takes two steps. First, get the job identifier of the running job chain worker. Then, delete the job by its identifier.

Both steps use the global <namespace>.OffPlatformCallout class. Pass the sales org to the constructor. The sales org is required. For more information about the effect of the sales org, see Abort Behavior.

This request returns the job identifier of the running job chain worker.

Resource

Available version

68.0

Apex Request Example

The response body contains the k8sJobId, jobState, and launchId fields. Use the value of k8sJobId in step 2.

This request deletes the job and ends the job chain worker.

The resource path contains the :k8sjobid variable. To set its value, pass a map to execute(). The map key must be k8sjobid, with the same spelling and case. If the key does not match, the variable is not replaced and the request fails.

Resource

Available version

68.0

Apex Request Example

The response body contains the message, k8sJobId, and abortedAt fields.

The response object has the following properties.

  • status is an Integer that holds the HTTP status code.

  • result is a String that holds the response body.

  • message is a String that holds the status message.

  • Abort Behavior

    Understand what an abort stops and what it leaves unchanged.

  • Abort Endpoint Configuration

    Review the endpoint records that route the abort requests.

  • Troubleshoot an Abort

    Learn why an abort request can fail and how to check that a job chain stopped.

  • Update Batch Run Status Records After an Abort

    Change the state of Batch Run Status records that stay in the Running state after an abort.