Skip to main content
December 20, 2021
Question

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

  • December 20, 2021
  • 4 replies
  • 0 views

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 ?

4 replies

stewart.burchell
December 20, 2021

In your process model can you not implement a loop with a short wait so as to ensure that the process report is successfully returning the required Task Id and only then returning control to the GET API?

December 20, 2021

Ok but AFAIK  a!startprocess is asynchronous process, even i add a timer and try delay process, web api will just trigger process and come back, it will not wait for timer activity to finish. Please suggest if i am wrong here and if there is any other way to delay response of a!startprocess in post api. 

stewart.burchell
December 20, 2021

According to the documentation you can chain the process model than thus prevent returning control to the calling WebAPI until it is completed:

docs.appian.com/.../Start_Process_Smart_Service.html

marcelp0001
December 21, 2021

If your GET is not without side effects (e.g., on a GET you just start creating tasks), wouldn't it be significantly easier to accept a POST and respond to that POST with a redirect?