2

Looking at Bulk API 2.0 and Bulk API Developer Guide, I did the following:

  1. Create a job
  2. Upload Job Data
  3. Closed Job

I am now interested in knowing how many batches have been created for the job. The problem is that for Bulk API v2 that information is not available.

Only thing I saw was

/services/async/APIversion/job/jobid/batch

But that is for v1 bulk API and will not get the batch info for v2 bulk api jobs.

The only thing I have to use is: /services/data/vXX.X/jobs/ingest/jobID

But that does not give batch count info.

Going crazy I even looked at the limits endpoint for DailyBulkApiBatches and that gives no indication or breakdown of batches. Just limits as it says :)

I saw a similar question at how to query job batches info bulk api 2.0 but that does not seem like the right answer as that is getting info about bulk api query jobs only.

And between the 3 API's that are provided dealing with Bulk API jobs, this inconsistency by Salesforce is a bit odd.

Any tips?

1

A big difference between Bulk API and Bulk API 2.0 is that in the former, you decide how to divide the data set into batches while the latter automatically does it for you (10,000 records).

This is mentioned in How Requests Are Processed:

While processing ingest jobs, Salesforce Bulk API 2.0 automatically divides your job’s data into multiple batches to improve performance.

Salesforce creates a separate batch for every 10,000 records in your job data, up to a daily maximum of 150,000,000 records.

Your specific question is actually answered in Work with Batches

Salesforce provides an additional API, Bulk API 2.0, which uses the REST API framework to provide similar capabilities to Bulk API. Bulk API 2.0 removes the need for creating and monitoring batches, and lets you load record data for a job directly.

This explains that what you're noting is expected and there is no mechanism for monitoring batches in Bulk API 2.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.