Skip to main content
Nintex Community Menu Bar

I am using SharePoint 2019.  I have a site for which I have created several site workflows using the Nintex workflow product.  Periodically, there will pe a problem where the workflow internal status shows “Failed on Start (retrying)” and the workflow instance continues to show up under “Running Workflows”, though the workflow appears to work correctly when I check the results.  Following is a screen shot:

I am looking for a method of canceling and removing all instances of this workflow (in particular those that show as “running” that are in a “failed on start” condition) in a batch mode with a tool like PowerShell or with some sort of timer job.  I want to do this in a batch mode rather than having to go into each job individually and terminate each one.  I have found PowerShell scripts to terminate running list workflow instances, but I haven’t found much on site workflows.

A bonus would be to schedule something to run automatically on a periodic basis, but I would be happy to have something I could run manually.

Does anyone have such a script or method for doing this?

Thank you!

Hi ​@jsupchurch,

Nintex has the NWAdmin tool to sync the Nintex workflow status with the SharePoint status, but unfortunately, in this instance, it looks like the reverse needs to occur.
Instead of patching the issue, it may be worth contacting Microsoft support to resolve the failed on starting issue. Nintex support may be able to help with the issue, but in the end, this appears to be an issue with the SharePoint workflow engine, which Nintex workflows also use.
 


I agree with Simon that trying to resolve the underlying cause of it giving an error should be the main goal rather than trying to remedy over faults. I have a similar issue with workflows sporadically (like once every few hundred runs) erroring when they should finish and go to completed status.

For the time being if finding an actual fix takes too long or is too difficult, you can do this automatically, at least for errored List workflows (I don't know how to do it for Site workflows). Your list workflow needs a Workflow status column enabled, this can be set in the workflow settings of that specific workflow. With the status column, you can query the contents of that column from another workflow through List Query. With this you should be able to find all items for which the workflow is in a “failed to start” state. You can then use a Webservice Query to forcefully terminate the list workflow.

Unfortunately the workflow status column does not work retroactively if it wasn’t enabled before, you can’t retrieve the workflow status of workflows run before it was enabled.

 

To use the webservice query, connect to {siteURL}/_vti_bin/NintexWorkflow/Workflow.asmx in the Call webservice action, and use web method TerminateWorkflowByNameForListItem. It will terminate that workflow instance and set the status to cancelled so it won’t be considered “running” anymore.


Hi ​@BobR 

Just an FYI, the Nintex workflow web service  TerminateWorkflowByNameForListItem changes the status of the workflow in the Nintex database. It does not change the status in SharePoint, as this column is owned by Microsoft.
 


Reply