- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2019 12:05 PM
I have a somewhat complex workflow tied to a Service Portal request form that appears to be hanging inexplicably under certain situations.
When completing the request from on the Service Portal, the user first selects the type of request (Add/Modify/Delete), then selects the affected Applications. This Application field is a multi-select variable based on a table we created. So what my workflow does is it closes the original RITM that is created, then creates indviduals RITMs for each of the Applications that they select. So if they enter three Applications, four RITMs will be created; the original, which is closed, and then the three new ones for each of the three selected Applications.
So the workflow fine works most of the time. However, it does not seem to like one particular combination of Applications, particularly if I choose Application9 and Application16. The workflow just "hangs" at my Switch statement, like this:
As you can see, there is no error. It just doesn't progress to the next action.
My first thought was it is a data issue. However, if I do a request for Application9 alone, it works fine. Likewise, if I do a request for Application16 alone, it also works fine. So that seems to suggest it probably isn't a data issue, if each one works by itself.
So, I next thought maybe it doesn't like doing multiple ones together. So I tried a combination of Application3 and Application9 together, and it worked fine. Then I tried a combination of Application3 and Application16 together, and that worked fine too. So it doesn't seem like doing multiple ones together is an issue either. It just doesn't seem to like this one particular combination. I am at a loss at what the issue might be.
I don't expect anyone here to be able to tell me exactly what the problem is (without having access to my data and workflow, it would probably be very difficult to figure that out). What I am hoping is that someone can tell me some techniques I can use to discover why my workflow is hanging. Without any error messages, how can I figure out what the problem is?
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2019 12:20 PM
I will suggest you to add log statement using run script activity to print values of applications before switch activity.
This will help you to determine issues with any particular combination before switch activity.
Also, please check below useful KB article for troubleshooting stuck workflows
https://hi.service-now.com/kb_view.do?sysparm_article=KB0541991
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2019 06:13 AM
I mean in our Dev and Test environments. Those tend to be a bit slower than our Prod environment, especially in the afternoons.
I did add some log statements like Sachin suggested, and it appears that it may be hitting that Switch statement before that variable gets populated (sometimes). So I am trying to up my timer from 1 second to 3 and see if that makes a difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2019 09:43 AM
Sachin,
Thank you! Those tips help me diagnose the issue. The issue was that occassionally, the variables weren't updated by the time the Switch statement ran. So it got "stuck" there. I added another field to my "Wait for Condition" to make sure that the variable used in my Switch statement was populated, and things seem to be working well now. I was able to discover that by logging the values of those variables, just before the Switch statement.