Limit on sequential calls to API?

Hi all,

I am running into some strange behavior. I am developing an application that uses AI to generate sections of content. Each sections contains of multiple objects that need to be created and the sections need to be created in sequence as the content of each section depends on the previous ones. So essentially everything needs to happen sequentially and in the backend.

My current setup uses a recursive API call to loop through all sections that need updating. For each section an call to an AI is made to generate the content for that section. The AI responds with a JSON array that represent the multiple objects that need to be created for that section. The update of the next section cannot start before all objects have been created. I am using recursive API calls to create the objects based on JSON. To make sure these are done in sequence I am currently using the API connector to call my internal APIs which makes these calls being performed in sequence.

This setup is working as expected as long as the number of objects generated by the AI in the JSON is three or less. When there are more the API call in Bubble seems to ‘hang’ for lack of a better word.

Am I running into some kind of Bubble limitation here? I would like to stay away from building a more complex workflow management system if possible.

Any help or suggestions would be highly appreciated!

D.