In this case, you might consider running the current task in the workflow. The MVC loop must complete in order to return the response to the caller. Please note: background threads will not have access to the request context, so you must capture everything you need. Also note that you cannot return anything to the caller after the http context has logged out - you will need to call to get additional data.
source
share