"adding" to a list from 2 separate workflows at the same time is inconsistent

In our app we have been running some workflows at the same time.

For example, we turn “transactions” (essentially owed bills) into “cart items”.

We run branching workflows on transactions depending on some other fields, and then the end result of all these workflows is that the “current user’s cartitems (list of cartitems)” has this newly created cartitem “added” to the list.

It works great if you run them all in one workflow, but if you run DIFFERENT workflows, about 50% of the time or more the cartitem is created but the “user’s cartitems (list)” is NOT updated with one of the items.

I believe this is happening because multiple workflows are trying to change the same field (user’s cartitems (list)) at the same time.

Is this expected behaviour? Any ideas for ways to work around this? We can space out the workflows more which seems to reduce the 50% failure rate proportionally to the delay, but it still happens occasionally.

It would make sense if you were using set list or anything, but “add” should just add.

Thanks!

1 Like

I think under the hood the add list takes the current list, loads it into RAM, adds the list you want, and then does a set list to your thing with the new list.

Meaning if both are “loading into RAM” at the same time you could have some odd results… if I am correct on how that works.

Curious if anyone else has an answer to this because I actually have a similar setup but I’m currently not having any issues as of right now…

Have you tried to run everything sequentially using custom events?

It seems strange to me as well. We’ve been using Bubble for some pretty heavy stuff for almost 2 years now, and after never running into this issue, we’ve seemingly hit it twice in the last week or so with two different projects - unless something else is going on.

Right. I always forget you can do custom events on the back end as well. If they behave the same as the front end, and guarantee sequential execution, then that will work perfectly. Thank you very much. I’ll see what happens.

1 Like

Actually this might not exactly work because the thing happening inside the workflow is “schedule API workflow on a list”, etc

So the workflow will schedule everything sequentially, but that will happen near instantaneously and then they’ll still be more or less running at the same time.

It’s still probably the answer but it’s going to require a bit of tweaking to set up.

If only you could do “trigger a custom event on a list”.

1 Like

Hi, I am experiencing exactly same issue: Two scheduled backend workflows are adding items to same list. As a result some items seem to be replaced due to another workflow adding an item on its place. I’ll be investigating this now. My temporary fix is to delay one of the workflows, however, obviously this is not a solution.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.