Error API POST branch: project already has running operations, scheduling of new ones is prohibited
Strangely I seem to be getting the above mentioned error when creating a new branch and endpoint through a POST to /projects/{project_id}/branches, but when I try it with the exact same configuration on the README docs, it seems to work.
What am I missing? (the creation of the project was already successful earlier in the same function)
Details of my request (see image)

6 Replies
variable-lime•2y ago
Can you expand on what you mean by "the exact same configuration on the README docs"?
My understanding is that this error occurs if you try to perform too many operations in a specific window of time. @Conrad Ludgate (or maybe he can tag someone else) knows more than me about the inner workings of the API.
rival-blackOP•2y ago
Thanks for getting back to me
With the configuration I meant I was using the exact same properties in body for the POST request as I was using while testing out the endpoint in the API documentation
However I realised that I needed to wait until all the "operations" for that project had finished until I started with my next API request to create a branch:
Not sure if this is a good way of handling but this seemed to solve my error
variable-lime•2y ago
Seems reasonable. If this code is in a program that can have other tasks happening then removing the do/while might be best since it will block the event-loop. If the program is doing just this, then it's no big deal
xenial-black•2y ago
To avoid that issue, it's possible to poll for operation status:
https://neon.tech/docs/manage/operations#poll-operation-status
Neon
Operations - Neon Docs
An operation is an action performed by the Neon Control Plane on a Neon object or resource. Operations are typically initiated by user actions, such as creating a branch or deleting a database. Other ...
rival-blackOP•2y ago
Ah I see, it was described there in the documentation. My bad for jumping too fast into the API reference. Thanks for the support guys! Appreciate it 🙏
xenial-black•2y ago
You bring up a good point. This should be mentioned in the API reference.