Discussions

Ask a Question
Back to all

BatchCmd limits

I need to create 450 work orders. For each of those, I need to create 5 additional child work orders. That about 2300 work orders.
I'm using the /Batch/Cmd endpoint with a "CommandName" : "woCreateCommand" section for the parents first, then making a separate call to using that same format for the child work orders.
The API calls I'm making work exactly like I want them too when I do it in small batches, but there appear to be some limits on the size of the body maybe?

I built the script just testing 3 at a time. That runs without error on the initial wo creation calls for those 3 work orders and the 15 children for each of those 3 parents.

If I put all 450 into a single body, it won't even create the parent work orders. I get a "(500) Internal Server Error."

If I only do 50, it creates the parent work orders correctly, but then the payload for the children (250 WOs) is too much.

Any advice on how to create them all?
I could, of course, create the parent work orders 50 at a time, and then process child work orders for 5 parent work order at a time. That brings the number of calls to 9 for the parent work orders and 90 for the child work orders.
Just curious if there is a better way.