Why workflow Catalog tasks are not created when workflow run?

Lupita
Tera Contributor

I have an issue on my instance where workflows are getting auto completed after approvals are set, can somebody help?

i.e:

I raised a RITM where should create a task to my IT team but after manager approves request workflow seems that goes into all activities it looks like all of them ran successfully,  RITM is closed complete but the catalog task never was created.

14 REPLIES 14

SanjivMeher
Kilo Patron
Kilo Patron

Can you post the workflow context screenshot? Did it skip the catalog task creation?


Please mark this response as correct or helpful if it assisted you with your question.

Lupita
Tera Contributor

Hello,

 

It looks like it ran it but completed within a second.

 

If you see all tasks are completed in 1 second or less even when I have Wait for Completion on Catalog 'Task Activity.find_real_file.pngfind_real_file.png

find_real_file.png

Ok. You need to use a Wait for Condition to check if all the tasks are completed.

 

Add a Wait for condition to your workflow just before End. Wait for condition should point to End. And anything that is pointing to End should point to Wait for Condition.

 

Write a script on the wait for condition

 

var ctask = new GlideRecord('sc_task');

ctask.addQuery('request_item',current.sys_id);

ctask.addQuery('active',true);

ctask.query();

 

if (ctask.next())

{

answer = false;

}

else

{

answer = true;

}

 


Please mark this response as correct or helpful if it assisted you with your question.

Just to add. I think you also need to update the current record (RITM) to trigger and validate the condition given in "wait for condition" activity. The workflow evaluates the Wait for condition activity each time the current record is updated