Forum Documentation Showcase Pricing Learn more

API Workflow on a list not completing items

I have an API Workflow on a list that works great sometimes, and other times doesn’t work. I’ve reviewed the logs and it doesn’t say that the app timed out or anything, and will show that the action completed, but it doesn’t. Such as this

It logs that it added the item, but in the database its not added. Sometimes this works, sometimes it doesn’t. This is the last item in the API Workflow, its also the only item that sometimes doesn’t work even though it says it does. All the other steps in the workflow work every time.

Any ideas on what to do?

How complex is this workflow? How many items are you sending to it?

You could be hitting some of Bubble’s limits. Josh highlights some of them here:

A couple of answers down I mention how I solved my issue by using recursive workflows. It might be helpful:

Its a complex API but doesn’t deal with large lists. It is copying multiple lists within lists and then also having to edit fields in those copied lists. But thats the weird part, it does all that perfectly every single time. The one thing it has a hard time with is the last item (which will only be a max of 5 times) and all it has to do is add the item to a thing. But even then, the logs will show that it completed the last item, but it doesn’t actually do it.

Either way, I have looked at the recursive workflows and they confuse me. I don’t understand how to set them up. Also these workflows don’t need to be completed within seconds, but It does need to be done within a couple minutes as this workflow is loading a schedule that the company needs on a future date. From what I can tell recursive is for stuff that doesn’t really have a time limit.

Here are some screenshots of the API. Not sure if it will help, but there it is.
This Endpoint will have a max of 5 items sent to it

This will normally have around 10-30 items sent to it

This will normally have around 1-10 items sent to it.

Anyone else got ideas on this issue? still having problems. We upgraded a plan in case it was maxing out and just not saying anything.

Still having problems with the last step randomly not actually completing even though it says it does. sometimes it works, sometimes it doesn’t

I struggled with a very similar problem for a long time. Backend/Workflow APIs that perform a sequence of data creation and/or update steps, especially those with “1 to N” list operations are very hard to get right, and frankly, unreliable. The basic concept of a workflow implies a sequence, with control over execution, but that is not the case here.

Your best bets:

  1. Make your tables “flatter”. If an update can work on a single row instead of a sub table your life will be easier.
  2. Write updates to tables as soon as possible in the UI or other workflow, so your big workflow has less work to do.
  3. Learn recursive workflow. They are tricky, and the examples given in some of the forum posts are, IMHO, weird and unhelpful. But learn how to - I can’t think of a better way to say this - create items using the same ‘Search for …’ query as the one that reschedules the workflow.

The day these workflows can be made reliable I will weep tears of joy. I have to believe the great people at Bubble can find a way to help their users in this area, or at least put limits in place that make the behavior reliable.