Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Steps to resolve an Approval Coordinator issue where the workflow is stuck because of a missing condition "activity.result=='skipped'" - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Steps to resolve an Approval Coordinator issue where the workflow is stuck because of a missing condition "activity.result=='skipped'"
KB0713624

Steps to resolve an Approval Coordinator issue where the workflow is stuck because of a missing condition "activity.result=='skipped'"


3151 Views Last updated : Sep 21, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


The workflow gets stuck on the Approval Coordinator activity if the activity doesn't result in any approvals or if the approvers are Inactive.

Cause


Prior to Jakarta the Approval Coordinator workflow activity did not include a condition "activity.result == 'skipped'".

As a result, if the Approval Coordinator has a result 'skipped' in the workflow context, it gets stuck and the workflow can not proceed to the next activity.

Resolution


Steps to follow:

1. Gather the list of workflow conditions which do not have the "activity.result =='skipped" condition and whose Activity Definition is an "Approval Coordinator".

   Try this URL: 

https://instance_name.service-now.com/wf_condition_list.do?sysparm_query=name%3DApproved%5Eactivity.activity_definition%3D283e8bb80a2581021d036a052ffc3433%5Eactivity.workflow_version.published%3Dtrue

2. From the list view, update the condition column with the following line: activity.result == 'approved' || activity.result == 'skipped'

    This will ensure that the workflow will not get stuck for the new records.

Now, to fix the workflow contexts which are stuck on the Approval Coordinator, follow the below steps:

3. Get the list of workflow activities that are stuck and has a result value ‘skipped’.

You can use the below URL to grab the list:

https://instance_name.service-now.com/wf_history_list.do?sysparm_query=result%3Dskipped%5Estate%3Dfinished%5Econtext.state%3Dexecuting%5Eactivity.activity_definition%3D283e8bb80a2581021d036a052ffc3433

4. From this list, we have to get the sys_id’s of the Workflow contexts that are stuck.

Run the below script in the Scripts-Background which will return a list of sys_id’s

******

var queryString = "result=skipped^state=finished^context.state=executing^activity.activity_definition=283e8bb80a2581021d036a052ffc3433"; 
var wh = new GlideRecord('wf_history'); 
wh.addEncodedQuery(queryString); 
wh.query(); 
while(wh.next()) 
{ 
gs.log(wh.context.toString()); 
} 

******* 

Once we have the sys_id’s ready, we should run a Script that updates all the stuck workflow contexts and move the workflow.

Attaching “Script_for_ApprovalCoordinatorGotStuck_v2.js” to the KB article.

5. Run the attached script in the Scripts-Background which will fix the workflow contexts that are stuck.

Note:

> This script will be require to add a comma-separated list workflow context to be fixed under variable "contextList"
e.g.: 
var contextList = "555a7e8a87311300a02fa1bb36cb0b80,855a3e8a87311300a02fa1bb36cb0be2";

> The workflows will be fixed after all records created under table ‘wf_command’ are processed.

> It takes some time for the script to update all the workflow contexts.



-Same steps to follow:

1. The script must be validated internally e.g.: using employee instance with a similar customer workflow (activities used) as possible. 

2. On customer side, the script must be validated on a test instance with a significative load of workflows contexts with the issue. 

3. Only after the script was successfully validated on a customer test instance then could be executed on a production instance.

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

Attachments

Attachments

No attachments found

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.