Yes. You can pass the data through an API to wherever you’re hosting your custom algorithm and then you can pass it back to Bubble via the API as well.
We’ve used amazon Lambda to host our algorithms. It’s quick and easy to set-up, highly performant, and it happens to be super cheap too.
A general rule to help decide whether to put the calculation in javascript on the page vs through an API.
Javascript:
When all the data for the calculation is derived from the page or is from available to the user from your app.
API:
When you don’t want to share the calculation method with the user.
When the calculation uses additional data from your app that you don’t want to share with the user.
When the calculation uses other APIs, and your app isn’t retrieving them.
When the calculation needs to be initiated by the server (API workflow).