- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 03:14 AM
Hi all,
I am trying to write a generic error handler for flows that should cover if for example a task is skipped, fails or not resolved correctly (as stated so in the business requirement). If an error occurs an incident should be created. The creation if the incident is no problem at all. The problem is gathering information to put into the description-field of the incident.
I have made a subflow, and need to get as much information as possible about the parent flow. From what I can gather by googling and checking this site, not much is being exposed.
I have looked a bit at the FlowAPI without any luck, perhaps it's just a matter of putting the right things together in the right order. The FlowScriptAPI returns the context ID of the subflow, unfortunately not the parent flow.
It would be possible to add a call to the FlowScriptAPI in the parent script and relay that contextID to the subflow as an input, but I would like to keep as much error handling as possible within the subflow itself, so the persons building flows only need to add a call to the error handler subflow, and not having to worry about adding other steps but the call to subflow.
Has anybody done something like this, where the error handler should just be called from the parent flow without the need for a variable in the parent flow that states the flow name and so on? No life hack whatsoever on this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 04:33 AM
This video I made a while back should show you how to do it.
Create an Error Handling Subflow with ServiceNow Flow Designer
Includes how to get flow and parent flow contexts.
https://youtu.be/Br5p7inqbXw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2025 03:04 AM
@Uncle Rob Thanks for your willingness to help. I got it working (except for the "(Process Automation.2721c932fb562250bf98ff22aeefdcd6; line 3)" but that's alright) 🙂