Very often, you will find yourself in situation where a workflow should only run under specific circumstances. For instance, process an order and charge a credit card only if the current user is logged in, or only process a sign up flow if the user checked a box agreeing to some terms. To enable you to do this, Bubble offers the option to define some conditions on events and actions.
A condition can be applied at the event level. In this case, when a condition is evaluated to no, the workflow won't run, while if it's evaluated to yes, it will run. If an event does not have a condition, it will run all the time.
You can define such a condition using the Expression Composer, similarly to what you do for elements' conditional settings. Note that the condition must evaluate to a yes/no expression, and if it does not it will be reported as an issue by the Issue Checker and should be fixed before you run your app in Run-mode.
If you need more granularity in your conditions, you can add conditions to a particular action in a workflow. The Expression Composer will be similar to event conditions, and you can define an expression that evaluates to yes/no. If the condition evaluates to yes, or if there is not a condition, the action will run, while if the condition is evaluated to no, it will be skipped.
You will often have to debug events with conditions to understand why, in Run-mode, some events are running and some others are not. We recommend using the Debugger in step-by-step mode to understand which condition is evaluated to true and how it impacts the workflows.
Note that if a following action is using the result of an action that is skipped because of a condition, the Result of Previous action will be empty. This is your responsibility as an app builder to make sure you do not introduce issues in your app using conditions on actions. Here again, you should use the Debugger.