I’m using Bubble’s backend workflows to handle some API requests, and I noticed that the response always comes back with a 200 OK status, even when I want to indicate an error (like a 400 or 401).
Is there a way to change the HTTP status code returned by a backend workflow?
Ideally, I’d like to return proper error codes depending on the situation, instead of just sending an error message in the response body.
Has anyone found a workaround for this, or is this simply not possible in Bubble?
Last time I investigated this topic, it wasn’t possible. And I believe it isn’t still.
I recall I ended up setting Xano in the middle, acting as a proxy between my Bubble app and the third-party service, to be able to return the code I needed. A bit convoluted.
Technically yes. They will throw an error status code (I can’t remember exactly which one) if the workflow condition isn’t met. Sadly other than that, no.
One way I’ve gotten around this (although it’s a bit wonky) is to have the condition make an API call (via the API connector) to another API workflow. In the second workflow, return the success/failure as a field, and use that field as the condition for the first workflow.