REST Step Error Handling
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 12:40 AM
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 ?
- Labels:
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 01:00 AM
Hi,
refer this link
Flow Designer - Process on Action error
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 11:53 PM
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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2021 01:41 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 01:24 AM
Hi
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.