How to Fix Your Synchronicity Issues in Your Bubble App – ratio.dev

Dennis H. Lewis shows why Bubble workflows run steps in parallel by default, causing sync bugs. Use the result of a previous step to force ordering, or use Custom Events to block continuation until complete.
Chapters
Is your bubble app flaking out? Are you noticing weird glitches in the functionality that only occur every once in a while? If so, this video is a must watch for you because you're likely having synchronicity issues. Things aren't happening in the order and when you think they should be happening. And let me explain what I mean by that. So most bubble developers, especially when they just get started, they see a bubble workflow and they just assume that bubble does the steps, executes the steps of that workflow in order, from left to right, like you're reading a book. 1, 2, 3, 4, 5, 6. And they're wrong. It doesn't work that way. Okay, by default, bubble workflows execute all steps in parallel. That means that once a workflow gets called, Bubble will try to do everything in that workflow at the same time, Boom. As fast as possible.
And while that's great for making things go faster, for being multi, threaded, for being as responsive to the user's needs as possible, that's great. But sometimes it just doesn't do what you want it to do. And unfortunately.
There are times when you actually need for some steps to happen before other steps so that things don't get all quirky in your database. So don't worry, bubble has you covered. There is a way to do this correctly and to make sure that things happen when you want them to happen. But you need to be conscious of how bubble works and how to make your bubble workflow set them up correctly so that everything happens as expected. So how do we get this to happen? There are two ways to ensure the execution of the steps inside your bubble. Flow workflows goes in order. And the first way is to use the result of step two, end function that will. That's the easiest way that and it's the most intuitive way, and we'll see that in just a minute. And the second way is to use custom events. So let's jump into the bubble builder and let's actually look at a couple of workflows, a few workflows, and see how this fits together. Here we are. This is a just a typical backend workload, doesn't matter, back end, front end. This works the same way. And here I am, I'm creating a new. First thing I'm doing is creating a new row in one of my tables. And then the next thing I'm going to do is I'm going to trigger a workflow that I a custom event that I want to have happen, but I want to make sure that this happens after this has been completed. So what I've done here is inside here you can see that I'm passing this custom event a parameter which uses the result of step one. Okay? So that means that this can't happen until step one is complete because it needs the result of it. And you can chain as many of these along as you want and it can be result of step one, result of step three, result of step four. Bubble will respect your wishes, and we'll make sure that the that all of the previous steps finish before the next ones go on. So that is the most intuitive and the easiest way to order things around. But it isn't always enough. Okay. Because sometimes actions in your workflow don't actually have results, and if there's no result from the action, then you can't use the result of function. So with that in mind for you, your best friend is to use custom events Bubble. Make sure that if you trigger a custom event within a workflow, it will not continue until that custom event has completed. So think of a custom event as a subroutine, a subroutine that you can pass it parameters and it can now return results as well, which is really powerful. And we'll probably do a separate video exactly talking about this new return in values, because it is something that can make your workflows much more efficient. But for this video, the most important thing to understand is that if you trigger a custom event, then everything that happens in that custom event will be completed before it goes on. And in this case, this workflow that we're seeing, I'm using both of the options. I'm not triggering this custom event until the first step is complete because I'm using result of step one. But then it won't continue with step three until all of this, this custom event has been completed. And this can have all sorts of steps inside here. And that's great. And. And then it will continue on and finish the rest of the steps in the workflow.
So if you're struggling with workflow issues or you just like some clarity and you have problems that you're not sure what's going on, first of all, ask yourself is, could it be that my problems are being caused because something is happening out of order? And if it is, can I use one of these two methods that we've talked about to make your workflow process more organized and eliminate that danger? But if you get lost, if you're not sure, you can leave a comment in this video and we'll get back to you. Or you could just come to ratio.dev send us a contact request and we can set up a call. We can, we can help you get clarity on the mysterious workflow issues that you're having. Because this is fairly common. We see this fairly common, especially with less experienced bubble developers. And it can be tricky to figure out exactly how to structure your workflows so that you don't create problems that show out.
Down the road. Because maybe if there's not much data in your tables and there's there aren't many users working with your application, these issues don't show up because it just happens fast enough and, and so you don't fall into the trap. And then as your application grows and there's more users and there's more data magic, suddenly things that seem to be working in the past stop working. Or they work sometimes and they don't work other times. These are synchronicity issues, almost certainly. So I hope you've enjoyed this video. If you have, be sure to give me a subscribe and a like and all of that stuff that you're supposed to do on these videos and I will see you on the next one.
More from Dennis

Is Google Killing Websites? The Future of Search, SEO & Web Design After Google I/O

Something we're still looking forward to in Bubble: richer design experiences! #bubble #nocode #ai

Big mistake companies are making right now: firing employees instead of empowering them. #ai







