0

Does a daily CSV upload using the Bulk API 2.0 require a new job created each day? Or can one job handle a new upload daily.

Having a hard time finding this on the docs. I see the sample process creates a job, but it also specifies that if a batch on a job is less than a week old it is not deleted.

https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_jobs_lifespan.htm

Also this is for the "old" bulk API, but i'm sure it still applies

2

Yes. You close the job (mark it "UploadComplete") to allow Salesforce to begin processing the job. You'll create a new job for each discrete Bulk API operation.

From the Walkthrough for Bulk Insert (Bulk API v2.0):

  1. Close the job.

Once you're done submitting data, you can inform Salesforce that the job is ready for processing by closing the job.

The overall job lifecycle runs like this:

Salesforce queues a new job for processing once you’ve created it, uploaded data for the job, and moved the job to the UploadComplete state. Once the job is de-queued, Salesforce starts processing the job operation and moves the job to the InProgress state. Once the job has been fully processed, Salesforce moves the job to the JobComplete state, or Failed state, depending on if the job was successfully processed or not

  • I've read all that, but can you upload again to a JobComplete or Failed status Job? – Stickyz Mar 14 at 12:37
  • @Stickyz No, you can't, but I'm not sure why you'd need to. Bulk API jobs are not an especially rare resource that you need to conserve at that level. – David Reed Mar 14 at 12:44

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.