Workflow Issue: A workflow is struck in an activity and doesnot advance to its next activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2018 05:49 AM
I have a workflow that contains activities such as catalog tasks and switches.
My workflow has been working good for many months but recently I saw a workflow context that stopped at the catalog task, and doesn't advance to the next activity (a switch) upon the task closure.
I see a log entry in that context that says "After running a sequence of activities we expected a 'last executing' record to predict the future stages from".
I tried Nudge option but got the same log entry again in the content. Only one workflow context has this issue, others are just fine.
Can someone help me on this logged error?
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2020 04:56 AM
This is an old thread but I noticed this message in the Workflow Log of a Workflow Context that was stuck. In fact, every time I clicked on Nudge, this message would be dumped. As the message suggests, the Workflow Executing Activities tab was empty i.e. no activity was running.
In my case, the Workflow was stuck at a second Approval - User activity since its result was 'skipped' but the Conditions were only coded to accept '', 'approved', 'rejected' and 'cancelled'. The developers would fix it eventually but the question was how to nudge the existing requests / workflows ahead. This is the workaround I came up with up after a day of trial and error -
1. Create a record in wf_executing as below -
var wfExecuting = new GlideRecord('wf_executing');
wfExecuting.initialize();
wfExecuting.activity = '99f53e21dbd064d024c89806b9961955'; // Sys ID of the last or stuck wf_activity
wfExecuting.activity_index = 9;//The sequence of the above activity in the relevant wf_context
wfExecuting.context = '4e1bf043dbb0ec147805c23813961951';//Sys ID of wf_context record
wfExecuting.is_parent = false;//Not sure but existing wf_executing records had this. So that's what I went with
wfExecuting.notify_termination = false;//Not sure but existing wf_executing records had this. So that's what I went with
wfExecuting.previous_activity = '921bf043dbb0ec147805c23813961966'; // Sys ID of previous wf_history record in the relevant wf_context
wfExecuting.started = '2020-12-04 15:13:12';
wfExecuting.state = 'waiting';//Not sure but existing wf_executing records had this. So that's what I went with
wfExecuting.workflow_version = '19f5fa21dbd064d024c89806b9961913'; // Sys ID of wf_workflow_version
var id = wfExecuting.insert();
gs.print(id);
2. Open the wf_context record or refresh it. You should now see a Workflow Executing Activities record. Personalize the list and select Scratchpad and Output Data
a) Key in Output Data as {}
b) Scratchpad as {"approval_ids":["561bf043dbb0ec147805c23813961968"]}
That is the sys_id of the first sysapprover_approval record which had actually been approved. So, I knew that if I made the second Approval - User activity look at this, it should return 'approved' and proceed. You may need to improvise depending on where your workflow was last stuck. Look at existing wf_executing records for the same Workflow version.
3. On the wf_context record click on Nudge. The workflow came to life and actually nudged ahead.