REST Step Error Handling

Rachna S
Tera Guru

Hello All,

We have a REST step in our action that makes a POST call and comes back with a response.

We are trying to configure some error handling immediately after the REST step in the form of a simple script. If the status code is 200, the script sends a status message 'Success'. However, what we've observed is if the REST step fails,  it does not proceed further in the action/flow. It does not pass the error code or message which makes it difficult for us to handle error and create a ticket out of it. 

Has anyone experienced the same ? If yes, do we have a workaround for scenarios like this ?

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

refer this link

Flow Designer - Process on Action error

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Thanks for your response. However, I found a better workaround but just wanted to know if it will work fine in the future. So I've basically created a subflow and added my action (this makes the REST call) in the subflow. Then in the main flow, I'm using 'Dynamic flow' step and calling subflow here. As the dynamic flow returns context, I'm making use of the 'state' to handle errors. 

While this works just fine so far, I do not have 100% knowledge of how dynamic flows work. Can you please advise if this workaround above sounds okay ?

 

Hi,

Liked the approach but to be frank I haven't explored much on this so cannot provide more details.

Please share the detailed approach so that it would be beneficial for future readers as well.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Viraj Hudlikar
Giga Sage

Hi @Rachna S,

Did you tried to remove REST step and add it again as sometimes in Flow Designer some steps stop working even if condition pass. Not sure why but when I face such issue, we just recreate it and it works fine. It might sound weird but it really works !!
Also the rest step you are writing did you tried to call from Postman is it working fine there it can be sometime you are missing some parameter which the API must be expecting.

Also here is one article for REST step walkthrough which can be helpful to you.


Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.

Thanks & Regards,
Viraj Hudlikar.