+ Start a Discussion

Batch Apex governor limits - callouts

We have a need to update an external system (through web service callouts) based on actions inside Salesforce. In order to limit the number of updates, we thought we could combine some updates together and use batch Apex. Unfortunately, there appears to be a limit in the number of callouts in batch Apex of one (1). The batch apex documentation states that it "uses the standard governor limits anonymous block, Visualforce controller, or WSDL method" which would give a limit of 10 callouts. This does not appear to be the case and the limit of 1 effectively forces a (fairly useless) max batch size of 1 in order to guarantee not hitting it. Has anyone hit this limit and used a different approach?


Also, does anyone know if there is a governor limit on the total number of callouts per day? I can't seem to find one in the docs.






I think you just have to  make your Batchable class implement Database.AllowsCallout


Let me know how it goes.


-Santosh Prasad

 Co-Founder, Trekbin

+1 (646) 652-6836




If you don't make your class implement Database.AllowsCallouts, you can't make any callouts. If you do, you only get one.


I did some testing and there does not appear to be any limit on callouts other than the per transaction one.

That's true. The per transaction - 1 is kind of really strange though.

If you set the batch scope to one it seems like you could technically do up to 50 000 000 callouts in a batch, one per record. Something tells me there's a limit though but I can't find what the daily callout limit is.