Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Why would removing an approval activity cause a workflow to fail?

jlaps
Kilo Sage

The below screenshot is the original workflow for updating CIs, and works; it has been working for several years now.

jlaps_0-1760551779609.png

We were asked to remove the Approval, so we did. The workflow APPEARS to work correctly-

jlaps_1-1760551910836.png

Despite the lack of errors, and despite the table of previous values and updated values showing in the notes, which historically was the indicator that it worked... the CI is not actually getting updated.

 

Add the approval back in, and it works when approving the approval.

 

I created a business rule that watched for approvals on this ITEM, and set them to approved... and again it fails to update the CI even though the workflow completes successfully (wth?!?)

 

What could be causing the workflow to not work, just by removing the approval? What is causing the workflow to not work even if leaving the approval in, and using a BR to approve it? <-- This makes no sense to me.

 

Just in case, below is the text of the APPLY PROPOSED CHANGES run script-

applyProposedChanges();
action.setRedirectURL(current);
function applyProposedChanges() {
	gs.log("top_wf "+new GEAMSacmUtils().geamApplyProposedChanges(current));
		//if(new GEAMSacmUtils().geamApplyProposedChanges(current)) {
			var base = new SNC.CMDBUtil();
	base.baselineProposedChangesApplyChanges(current);
        //var base = new SncBaselineCMDB;
//base.applyChanges(current);
		
	}
//}

Any ideas?

Thanks!

1 ACCEPTED SOLUTION

Subhendu1
Tera Expert

Trigger the CI update through an event or a separate transaction instead of running it inline.
Avoid using a business rule to auto-approve, as it doesn’t trigger the same workflow transitions.

 

View solution in original post

2 REPLIES 2

Subhendu1
Tera Expert

Trigger the CI update through an event or a separate transaction instead of running it inline.
Avoid using a business rule to auto-approve, as it doesn’t trigger the same workflow transitions.

 

I used a flow instead of the business rule and that did the trick. Thank you.