Your best option is to run the microflow that takes a long time in the background. There is a java action from the community commons which allows you to pass a parameter and trigger a microflow to be called in the background. This will allow the page to close before the long running microflow has finished. This is quite a useful trick, especially if you have long running process but don't want to have a progress bar and the users have to wait.