You won’t be able to get the current URL of a page using Java unless it’s being called from a Request Handler.
This is because microflows are usually called from the client, so you will get the URL used to request the microflow, not the application.
Hey Pedro,
in my case one simple line of code did the job:
return window.location.pathname;
I used it in a Java Script Action.
Hope this helps you!