Where to find the running activities?

Hi

I’m trying to trace each step of my process and showing running/completed/error status of them.
I created a task with a 100 seconds sleep time, I expected that while this task was running I can get it via the REST API /history/activity-instance?processInstanceId=procId .
However, it won’t be listed by the API above until it finished (with the endTime and durationInMillies values).

I also tried REST API process-instance/{procId}/activity-instances, no luck there too.
I checked the runtime tables (act_ru_*) in the database, can’t find anything.
So where this activity is while it’s still running? And do we have the REST API to get it?

Thanks

The process engine flushes changes to the database at the end of a transaction. If you have a task that is not a wait state, you will never see it persisted in the runtime database. In the history database, you will see it once the transaction has been committed, which is when the process instance reaches a wait state or finishes.

Cheers,
Thorben