I initially tried this with my app, then realised it was not viable in the long run - mainly because, if I was scaling up the app - it wouldn’t be on bubble, due to the WU pricing model, and the inability to create a “portable” export of my database and workflows. Prior to that pricing model change, I intended on bubble being my primary platform and wasn’t worried about the portability - but the pricing change proved a) I was at the mercy of a 3rd party in determining if my business could survive or not, and b) had no ability to move off the platform if things went south.
All this was the reason I moved to a Xano backend - as it solved all these concerns, as my WUs are now effectively just retrieving static pages, with some occasional queries to the database, thus very little - with the rest of it being driven client-side by a plugin that I wrote the logic in and could extract if needed. If Xano decided to do something damaging to my business, I can export all my APIs (the core logic is mostly in lambdas written in JS) and do a full DB export. Or if I went the other way, I could even go with a dedicated instance of Xano to handle insane scaling. With all of this, if I wanted to start “bubbling” away a build of a new UI in the background on some other platform - I could readily use the Xano backend without any issue whatsoever, so it gives front-end portability too.
So long story short - if I were in your shoes, I would just write the logic you are aiming for in Xano, it will probably save you a ton more pain in the future.