# About order of operations in workflows and best practices

**URL:** <https://forum.bubble.io/t/about-order-of-operations-in-workflows-and-best-practices/197040>\
**Category:** Tips\
**Created:** [March 17, 2022, 11:25am UTC](https://forum.bubble.io/t/about-order-of-operations-in-workflows-and-best-practices/197040 "2022-03-17T11:25:23Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![gallahad11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gallahad11/32/117017_2.png) [@gallahad11](https://forum.bubble.io/u/gallahad11)\
**Post date:** [April 4, 2022, 7:00am UTC](https://forum.bubble.io/t/about-order-of-operations-in-workflows-and-best-practices/197040/23 "2022-04-04T07:00:15Z")

</div>

A couple of weeks passed since the last post, thus a little update.

I put the test app offline since its behaviour changed. I think this statement recently found on the [official bubble docs](https://manual.bubble.io/help-guides/building-workflows/the-basics) is connected (I’m pretty sure it’s been recently added):

> **Tip:** If an end-user does something that kicks off the same workflow many times within a short window of time (e.g. clicking on a button repeatedly very quickly), Bubble tries to be smart about executing that workflow: any actions that make sense to repeat (e.g. changing a thing) will be repeated and any actions that don’t make sense to repeat (e.g. navigating to another page) should not be repeated.

A lot has been written in this forum about sequence in workflows, I suggest reading [this post](http://forum.bubble.io/t/force-workflow-steps-to-happen-in-order/125022/16) to understand a little more about what is triggered before (and actually yes, it’s API workflows) and what after.

The use of custom events is fundamental to control order of execution.  
But another thing has to be kept in mind, taken from [this post](http://forum.bubble.io/t/is-it-possible-to-control-the-sequence-of-steps-in-the-workflow/112665/11) of @keith 🙏:

> … Bubble has kind of an interesting optimization around database operations. When you “Create a New Thing”, the unique ID of the Thing is created client side and the values of the fields of the Thing actually _do exist for that user’s session_ . However, the _actual_ creation of the Things (back on the server) might be substantially delayed.

Here’s why “result of step X” is generally safe. But be careful that it doesn’t represent the modified underlying DB value, that could (and generally will be) updated later.

With so many constraint to consider, my conclusion is that the best way of organising complex workflows (ie with API calls, changes to DB, custom events) is using custom events and “do when condition is true” (as also Bubble support suggested me after being asked).

---

_[View the full topic](https://forum.bubble.io/t/about-order-of-operations-in-workflows-and-best-practices/197040)._
