Backend workflow reloads the page when changing the current user

Hello!
I built an n8n workflow that is triggered via an embedded chat in my Bubble app. This workflow deducts credits based on user actions and sends an HTTP request to a Bubble backend workflow to update the user’s credit balance.

Everything works fine—the credits are deducted correctly—but the page refreshes every time after the backend workflow updates the Current User. This causes the chat to reset, which is a big issue.

I suspect Bubble automatically refreshes the page when the Current User is modified via a backend workflow, even though I have removed all UI elements displaying the credit balance (but the issue persists).

My questions:

  • Can someone confirm whether Bubble refreshes the page when a backend workflow updates the Current User?
  • Is there a way to prevent this from happening?

If the answer is no I have an idea: I would create a separate thing in the database (call it “creditbalance” for example) that has a user connected to it and I make changes to this thing via the http request from n8n. But this would mean that I have to change many things in my app (for example the backend workflows that renews credits for the users every month and showing the balances on the frontend).

Thank you in advance!

Have you checked whether a “Do when condition is true” workflow is being triggered by the changes you’re making to the database via the backend workflow?

Try using the app’s search tool (top right corner of the design screen):

  1. Select Event Type
  2. Search for “Do when condition is true”

Then, check if any of these workflows are refreshing the page.

Thank you for your reply!
I did a search like you wrote and I have 6 “Do when condition is true” events, but none of them is refreshing the page unfortunately.

I found the cause of this problem. The BubbleBot helped me a lot when it mentioned this: “When a container’s content changes in Bubble, it effectively resets”. So only the container with the chat was refreshing after updating the user’s credits. And since it takes almost the entire page it seemed like the whole page was refreshed. The issue was that I was passing the user’s credit balance as dynamic data in the metadata sent to n8n. Whenever the credits were updated, the metadata changed, which caused the embedded chat to refresh.

Removing the credits from the metadata solved the problem. Hopefully, this helps anyone facing a similar issue! :slight_smile: