How to extract a number/status code from "Netflix Conductor" workflow output/task output parameters?

439 views Asked by At

I am using Netflix Conductor's HTTP task in my workflow to call one of the third-party APIs. For success scenarios, I am able to retrieve the status code as "200" in the task output, but for failure scenarios, the status code is not getting printed in the task/workflow output response. But, I am getting the error message in the "resonForIncompletion" parameter in the task summary which includes the error message in the string format, and this has a status code as well in a few cases. Below is the failure/error scenario response from the task output.

Sample:
{
  "response": "java.lang.Exception: 404 Not Found: \"{}\""
}

JSON response:
{
"taskId": "cd31283b-f209-4cfc-a024-02503300e9d8",
*"reasonForIncompletion": "Failed to invoke HTTP task due to: java.lang.Exception: 404 Not Found: \"{}\""*,
}

I would need to extract 404 from this "reasonForIncompletion" parameter and should send this as a status code in the workflow/task output prameters. Could someone please help me with this.?

0

There are 0 answers