Skip to content
Framework Docs

Cancel Batch Job

BatchCancelResponse beta().batch().cancel(BatchCancelParamsparams = BatchCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/beta/batch-processing/{job_id}/cancel

Cancel a running batch processing job.

Stops processing and marks pending items as cancelled. Items currently being processed may still complete.

ParametersExpand Collapse
BatchCancelParams params
Optional<String> jobId
Optional<String> organizationId
Optional<String> projectId
Optional<String> temporalNamespace
Optional<String> reason

Optional reason for cancelling the job

ReturnsExpand Collapse
class BatchCancelResponse:

Response after cancelling a batch job.

String jobId

ID of the cancelled job

String message

Confirmation message

long processedItems

Number of items processed before cancellation

Status status

New status (should be ‘cancelled’)

One of the following:
PENDING("pending")
RUNNING("running")
DISPATCHED("dispatched")
COMPLETED("completed")
FAILED("failed")
CANCELLED("cancelled")

Cancel Batch Job

package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.beta.batch.BatchCancelParams;
import com.llamacloud_prod.api.models.beta.batch.BatchCancelResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        BatchCancelResponse response = client.beta().batch().cancel("job_id");
    }
}
{
  "job_id": "job_id",
  "message": "message",
  "processed_items": 0,
  "status": "pending"
}
Returns Examples
{
  "job_id": "job_id",
  "message": "message",
  "processed_items": 0,
  "status": "pending"
}