On demand complex computation involving backend service hosted on GCE

I am trying to provide some on-demand calculation service to my customers.
For example, my customers can input (1, 2) on the web app.
I will first search my database to see if (1, 2) as input has been there
if so, then the result is returned.
else, then will send (1,2) to call some endpoints of some backend services hosted on google cloud. The service finishes the calculation and send the result back. The result is presented to the customer and also is stashed into the database.

Does this sounds sensible? Is there any existing example/template similar to the design?