0

I am using the Salesforce Bulk API in several solutions for working with Salesforce data outside of Salesforce. Based on experience and memory (which of course can be flawed), it seems to me that Salesforce Bulk API calls mostly complete within 2 minutes, but if they take longer than that, they are probably going to take more than 5 minutes.

Further anecdotal evidence suggests that when a Bulk API job is running longer than 2 minutes, you will get your results quicker by repeating your Bulk API call vs. waiting around for the original request to complete.

I'm tempted to methodize my bulk query logic to abort the original request and retry after 120 seconds without a result, but I don't have hard data or behind-the-scenes information about what Salesforce does with Bulk API requests to back this up.

Is a brand new Bulk API request really more likely to return a result in the next 2 minutes than one that was sent 2 minutes ago? Or is that totally irrational on my part?

1
  • I would be cautious about arbitrarily abandoning ongoing requests and would remind you that there are daily API request limits. I guess it depends on how heavily you use the APIs.
    – Phil W
    Dec 9, 2022 at 22:35

1 Answer 1

0

Have you tried monitoring the status of the jobs? Assuming it completed or failed without any response within that 2-minute window may be dangerous. It may not be likely, but the job could have completed, but the response could have failed. Hypothetical, but possible.

Monitor Bulk Data Load Jobs (on platform, manual)

HTTP GET request / API monitoring of a job (Can wait between retries on status - that's the way workbench does it, for example)

4
  • The library I'm using is (jsforce, a common tool for working with Salesforce APIs from Node.js) has polling built into its Bulk API functions, which I believe is similar to what Workbench does. I'm actually working on a script to test my hypothesis now... I will update once I have better data. Dec 9, 2022 at 19:46
  • 2
    Isn't this rather a comment on the original post, not an answer?! Dec 10, 2022 at 7:21
  • @FelixvanHove Sure, but aren't comments like yours and this also completely irrelevant to solving the original problem? Dec 13, 2022 at 20:30
  • There are many types of comments, often they lead to solutions. Answers must represent solutions. StackExchange is so useful, because it is not a forum or discussion board. Users should not need to browse through large amounts of text. Dec 14, 2022 at 6:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .