How we can use custom apps to do a multi step action

I’d be interested in how we can use custom apps to do a multi step action.

Eg, do a query call of a sales data over 12 months, and then aggregate it so it shows the monthly sales data per month

Or similar to the above, essential a multi-step action (i.e it might be 3 api calls when looked at individually, but combined and showcased as “one action”) for a custom app