Hi ACC Friends,
My Recurring Campaign workflow getting into paused state and in the journal ,i am seeing below warning.
02/20/2023 5:46:02 AM Automatically resuming workflow 82678309 (number of consecutive times: 1).
at the end of workflow, we are calling stop method using queryDef (xtk.workflow.Stop(wf.@id)) .
And this issue not happening with every workflow, most of our recurring workflow running fine with above method, but few of them getting paused with above warning no other error.
Does anyone know why this warning is throwing in the workflow?
Thanks!!!
@ParthaSarathy @Shubham_Goyal__ @_Manoj_Kumar_ @david--garcia @Craig_Thonis @Denis_Bozonnet @akshaaga
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Sukrity_Wadhwa ,
I had implemented different solution. did not try Manoj's, solution
using sqlExec("UPDATE Xtkworkflow SET istate ='"+20+"' WHERE iWorkflowId ='"+instance.id+"'");
Our requirement was marked that workflow finished intensely.
Thanks!!
Pradyumn
Share the whole script.
Views
Replies
Total Likes
Hi @Prady12,
The warning message suggests that your workflow (number 82678309) was paused and then automatically resumed by the system, with one previous occurrence of this happening.
Without more information, it is difficult to pinpoint the exact cause of the pause.
Regarding the warning message, it is the normal behavior of the system to automatically resume a paused workflow after a certain amount of time. This is usually done to prevent the workflow from pausing indefinitely or
The "xtk.workflow.Stop()" method is used to stop the workflow from running further. However, if the workflow is already in a paused state, calling this method may not have any effect.
To further diagnose the issue, we would need to have the complete logs and detailed error messages.
Views
Replies
Total Likes
Hi @akshaaga , please find above few more logs, as the workflow getting in paused state at end activity where we had written the JS code to Finish the workflow forcefully. And end activity task is also in pending state:
However, if the workflow is already in a paused state, calling this method may not have any effect?--> are you saying that if the workflow in pause state , calling xtk.workflow.Stop(wf.@id) method , will make any change in the workflow state ?
Views
Replies
Total Likes
Hi @Prady12 ,
Based on the additional information you provided, it looks like the workflow is getting paused at the end activity where you are calling a custom JavaScript code to finish the workflow forcefully, and the end activity task is also in a pending state. Regarding your question about the xtk.workflow.Stop() method, if the workflow is already in a paused state, calling this method will not have any effect on the state of the workflow.
In other words, calling xtk.workflow.Stop(wf.@id) will not resume a paused workflow or change its state from paused to another state.
Views
Replies
Total Likes
Hi @akshaaga , you got the logic correct, but we can stop the workflow by calling Stop method, even though workflow is in paused state.
So this statement is false for my case: In other words, calling xtk.workflow.Stop(wf.@id) will not resume a paused workflow or change its state from paused to another state.
Views
Replies
Total Likes
Hi @Prady12 ,
That's right. The xtk.workflow.Stop() method can be used to stop a workflow even if it is in a paused state.
When the xtk.workflow.Stop() method is called, it will terminate the workflow and set its status to "stopped." This is useful in situations where you want to forcefully stop a workflow that is not progressing or is causing issues. In your case, if the workflow is already paused and you call xtk.workflow.Stop(wf.@id), it should terminate the workflow and set its status to "stopped." However, keep in mind that if the root cause of the pause is not addressed, the workflow may still encounter the same issue again if it is restarted.
Views
Replies
Total Likes
Yes , that's what i am trying to understand, why some of the workflow getting into paused state instead of Finish state. When we call xtk.workflow.Stop() method.
Views
Replies
Total Likes
@Prady12 ,
When you call the xtk.workflow.Stop() method, it will stop the current workflow execution and put it in a paused state. The reason for this behavior is to allow the user to intervene manually and resolve any issues that caused the workflow to stop.
For example, if the workflow is trying to access a resource that is unavailable, you may need to fix the resource or update the workflow configuration to point to a valid resource.
Once the issue is resolved or the manual intervention is completed, the user can resume the workflow execution using the xtk.workflow.Resume() method.
At this point, the workflow will continue from the point where it was paused and proceed to the finish state once all steps have been completed successfully.
Views
Replies
Total Likes
Hello @Prady12 ,
Sometimes the xtk.workflow.stop does not work within the same workflow.
Use these two methods:
xtk.workflow.Stop(wf.@id);
xtk.workflow.Kill(wf.@id)
Views
Replies
Total Likes
Hi @_Manoj_Kumar_ so are you recommending to use Kill method instead of Stop ?
Views
Replies
Total Likes
Hello @Prady12
I am not sure what else is happening in your workflow. But if you want to stop the workflow and STOP is not working, then Kill will stop the workflow.
I have used this in one of my use cases where the workflow was started on demand with Start and was stopped/killed at the end of the workflow.
Views
Replies
Total Likes
Kill is used for the unconditional stop, which is commonly used when the workflow fails to stop normally.
Views
Replies
Total Likes
Thanks for suggestion @_Manoj_Kumar_ , i will try test kill method .
Views
Replies
Total Likes
Hi @_Manoj_Kumar_ , I had tried to use Kill method instead of Stop , but it did not stop the workflow.
yes, it's true Kill is used for the unconditional stop, It worked when i called it from different workflow. But within same workflow Kill did not work for me. It was kept on running based on the value set for option variable (NmsOperation_LimitConcurrency) .
Views
Replies
Total Likes
Hello @Prady12,
Which activity are you using before this javascript function? Try adding a wait of 5 minutes before stopping/killing the WF.
Views
Replies
Total Likes
NmsOperation_LimitConcurrency represents the number of workflows you can run simultaneously. it should not let you stop the WF.
Hi @_Manoj_Kumar_ , i am calling JS function at end the workflow in End Activity (advanced tab) .
Views
Replies
Total Likes
Hello @Prady12
Here is the solution:
Please create a new workflow. Let's call it a workflow stopper. It will start with an external signal and then a javascript code.
In this Javascript activity, add the following code.
xtk.workflow.Stop(vars.wfid);
xtk.workflow.Kill(vars.wfid)
Now in your the workflow that you want to stop:
Call this stopper workflow by the postevent and pass the current workflow id as a variable.
xtk.workflow.PostEvent("INERTNAL_NAME_OF_STOPPER_WORKFLOW", "signal", "", <variables wfid={wf.@id} />, false)
Let me know if that works for you.
Views
Replies
Total Likes
Hi @Prady12,
Was @_Manoj_Kumar_'s solution helpful to resolve your query? In case it was helpful, then kindly choose it as the 'Correct Reply'. If not and you still need more help, then do let us know.
Thanks!
Views
Replies
Total Likes
Hi @Sukrity_Wadhwa ,
I had implemented different solution. did not try Manoj's, solution
using sqlExec("UPDATE Xtkworkflow SET istate ='"+20+"' WHERE iWorkflowId ='"+instance.id+"'");
Our requirement was marked that workflow finished intensely.
Thanks!!
Pradyumn
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies