Web API - 500 server error - Process report not updating immediately

I have a GET web API which is consumed by third party, my GET API calls other POST API and there I am triggering a process and generating a user task, in my GET API i am also generating a process report to get task id using process id i get from POST API and than generating a url for  the task and redirecting url as response of GET API. 

But sometime i am getting 500 error message and after initial analysis I get to know process report is slow and by the time web api triggers process and query report, entry is not added in report and so task id is return as null because of this, third party getting 500 server error.

Any suggestion how can I resolve this error ?

  Discussion posts and replies are publicly visible