Finding the last updated time of an active process instance

Hello ,

I am planning to create an alerting mechanism for all the active process .
we have many user task and subprocess across the execution

how can I get the last updated or latest step execution time with API

can someone help me in this

thanks in advance
Roy