What’s your method for debugging complex workflows with multiple conditional steps?

How do you check and fix issues when your Bubble workflow doesn’t run as expected because of too many ‘only when’ conditions?

I generally test with the debugger mode on if a client-side workflow. If it’s a backend workflow, then there are a few ways of testing (either the logs or by adding intermittent actions to make changes in the DB)

You may have a suboptimal build and I would invest in changing that. With more context, I could try to help.

With regards to your question, I would run in step-by-step mode on the frontend, or the server logs for the backend as @Zeroic pointed out.

this is what the support AI said. Does it help?

When workflows don’t run due to complex “only when” conditions, here’s how to troubleshoot and fix the issues:

Use the Debugger Our debugger is your best friend for this! It lets you run workflows action-by-action and inspect each step in real-time. When you preview your app, the debugger will show you exactly which conditions are being evaluated and whether they’re returning “yes” or “no.”

Check Condition Logic Remember that “only when” conditions use dynamic expressions that must return a “yes” to allow the action to run. If any condition returns “no,” that specific action gets skipped, but subsequent actions continue.

Debugging Steps: • Preview your app and trigger the workflow

Use the debugger to inspect each element and see which conditions are active

Check conflicting conditions - multiple conditions can be active simultaneously, and they’re read top-down

Common Fixes: • Simplify complex conditions by breaking them into separate actions

Review condition order - bottom conditions override top ones

Test individual conditions using the preview feature in the editor

The debugger will show you exactly where your workflow logic is failing, making it much easier to identify and fix the problematic conditions!

Is this a backend workflow or front end. If front end @Zeroic and @betteredbritain gave the right guidance using step by step debugger and @fede.bubble came in with AI spitting same idea, but nobody said anything about backend.

@boston85719 - do you suggest a better way? Would be cool to get your thoughts

On the frontend - step by step - but be wary that sometimes it behaves differently than when clicking the button - especially if you assume the step 1 will finish before step 2 (as this is not how the workflow works on the frontend).
On the backend - create a database with logs, and log each step and each crucial element (ex a search which buffers main item in some process etc.). Launch and watch the logs.
Generally - for every complex workflow I always use logs.
If it’s very complex - split into main workflow launching steps - depending if you need to return values from the steps or not. As on the backend you have to think how to chain them properly if you are going to split them - and how to return data between each workflow.
You can also check bubble native logs, but they are bad in general, and usually lack a lot of information.

// also some good practice - never change data source with a workflow - I recommend always set custom state and trigger a condition - this way inspector can catch it, otherwise you will see wrong data in the inspector
(— correct me if this was changed, but around 2 years ago this costed me 2 days of work, when i was beginning with bubble).

2 Likes

As my friends mentioned above, on the front end we usually rely on the built-in debug_mode with step-by-step execution. You can also set breakpoints on specific steps or workflows if you want to jump directly to them during debugging. At each step, you can inspect every condition and its evaluated values, that helps a lot.

But when it comes to backend workflows, things get a bit trickier.

Usually, the first thing I do is check the Bubble logs to understand how the flow is running. If I need to debug a specific condition or piece of logic more deeply, I create a log item in the database. Basically, I take the conditional expression I’m testing and write it as text into the database, so I can see exactly what’s happening. I might do this for one or more steps. Creating these log entries in the database helps me evaluate how the conditions and values are behaving. If possible, I also try to replicate the same logic on the front end to confirm everything works properly before relying on the backend workflow.

In short, what helps me the most is creating these log items, they give me a clear picture of how the workflow is actually running.

@michal.friedrich and @carlovsk.edits got to it with creating our own logs in database, both provide great ideas. @michal.friedrich dropped great tip on issue with display data. As @carlovsk.edits suggest try recreate front end, I just add a bit and suggest trying the conditionals in text element on front end to see how they evaluate.

2 Likes