Invoke function AppScript

Hello!! I need help with the following. I will now comment on the case. Create an app, where I have control of device orders. One of the functionalities that I developed, allows modifying the quantity of devices of a particular order.
And on the other hand, create a function in appscript that calculates the status of a specific order.
My idea is to invoke this function, every time an order is modified, sending the order id as the input parameter of the function.

Can someone share knowledge with me, in order to do it?