Hello Vewax
You may want to use the following reference / piece of code
context.getActionStack().get(i).getActionName().contains(currentMicroflowName)
There's a written blog here about it! Please click on this https://medium.com/@marcian.bondoc/how-to-determine-the-current-recursion-depth-of-the-microflow-that-calls-itself-1d50d2ac2db5
Hope this was of great help!