# Handling failure response codes in Workflow

**URL:** <https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [July 16, 2024, 7:22am UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861 "2024-07-16T07:22:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yunus\_merck](https://avatars.discourse-cdn.com/v4/letter/y/22d042/32.png) [@yunus\_merck](https://developer.sailpoint.com/discuss/u/yunus_merck)\
**Post date:** [July 16, 2024, 7:22am UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/1 "2024-07-16T07:22:48Z")

</div>

Hi,  
I am working on a workflow where I am using the HTTP request action to create the campaign and then the action for activating the campaign.  
My objective is to capture the non 2xx response i.e.basically the failure response and send the notification. Currently the workflow will fail at the very step and don’t go further..  
Now I have explored over the community and found this limitation of the workflow.  
On several links it has been mentioned that the idea is in backlog for SailPoint.

> [@HTTP Response Fails Workflow Execution](https://developer.sailpoint.com/discuss/t/http-response-fails-workflow-execution/6575/7):
>
> Hi Colin, has this idea gotten any traction? This issue of an HTTP action failing the whole workflow severely limits the action’s capability. Ideally if the workflow HTTP action receives a JSON based error message back one would expect the response to be parse-able to allow for graceful handling. Are there any suggested workarounds?

> [@Workflow - HTTP REQUEST](https://developer.sailpoint.com/discuss/t/workflow-http-request/14461/4):
>
> Looks like the API will return a 404 instead of an empty tags array if you are looking for an object that doesn’t have any tags. Workflows doesn’t yet have the ability to handle non 2xx response codes from the HTTP request, so you can’t catch the 404 and deal with in a comparison operator. However, you can use the filters query param to search for a tagged object that matches the campaign ID, and if none exists it will return an empty array. Use this endpoint instead, replacing {campaignId} w…

So do we have this capability implemented or it is still in consideration.

---

<div class="post-metadata">

**Author:** ![shaileeM](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/shaileem/32/15314_2.png) [@shaileeM](https://developer.sailpoint.com/discuss/u/shaileeM)\
**Post date:** [July 16, 2024, 9:16am UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/2 "2024-07-16T09:16:51Z")

</div>

Hi Yunus,

I am not sure if you are looking for capturing status code of HTTP request action or of the workflow itself.

To capture the status code of HTTP request action, you can use “Compare Numbers” operator with value1 as `$.hTTPRequest.statusCode` and compare it with if its equals to value2 as 200.

---

<div class="post-metadata">

**Author:** ![yunus\_merck](https://avatars.discourse-cdn.com/v4/letter/y/22d042/32.png) [@yunus\_merck](https://developer.sailpoint.com/discuss/u/yunus_merck)\
**Post date:** [July 16, 2024, 9:43am UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/3 "2024-07-16T09:43:28Z")

</div>

Hi Shailee,  
I am aware of this snippet to get the status code. The idea is to capture the failed status code like 504,400 etc… so that we can continue the workflow execution rather than abrupt ending. Even after putting the compare number code=200 or 201, if any other failed response happen, the workflow won’t continue to go for the false condition and it will end instantly. I want to avoid this and send the notification of the failed status code.

---

<div class="post-metadata">

**Author:** ![shaileeM](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/shaileem/32/15314_2.png) [@shaileeM](https://developer.sailpoint.com/discuss/u/shaileeM)\
**Post date:** [July 16, 2024, 9:54am UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/4 "2024-07-16T09:54:51Z")

</div>

Hi Yunus,

Understood, in the same operator, when the result is false (i.e. HTTP action has failed), proceed to send the failure notification and/or continue with the further processing. Hopefully subsequent workflow blocks are not referencing to any fields from the HTTP action response, since it has failed.

---

<div class="post-metadata">

**Author:** ![chrishogan](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/chrishogan/32/41505_2.png) [@chrishogan](https://developer.sailpoint.com/discuss/u/chrishogan)\
**Post date:** [August 7, 2024, 7:01pm UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/5 "2024-08-07T19:01:31Z")

</div>

Hi Yunus,

Were you able to determine a solution for this problem? It is unfortunate that the HTTP action terminates the workflow on a 400 instead of allowing for retry or handling and thus I am running into the same issue.

---

<div class="post-metadata">

**Author:** ![yunus\_merck](https://avatars.discourse-cdn.com/v4/letter/y/22d042/32.png) [@yunus\_merck](https://developer.sailpoint.com/discuss/u/yunus_merck)\
**Post date:** [August 20, 2024, 2:12pm UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/6 "2024-08-20T14:12:49Z")

</div>

No Chris…don’t have a solution yet.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 12, 2024, 6:58pm UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/7 "2024-09-12T18:58:25Z")

</div>

At this time, HTTP Requests will fail the entire workflow if a non-2xx response code is returned. There currently is no way to prevent this. Error handling is a broader concept that is being explored by the workflow engineering team that will account for use cases like this. There is no ETA on when the improved error handling features will be available.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 11, 2024, 6:58pm UTC](https://developer.sailpoint.com/discuss/t/handling-failure-response-codes-in-workflow/72861/8 "2024-11-11T18:58:44Z")

</div>

Closed on November 11, 2024, 6:58pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
