1

Working in SP Online, we have a number of SPD developed workflows running against list items.

Most times, these WFs run happily but there are instances when a given WF instance ends up in a Suspended state.

After the event, we can debug the root cause and look to prevent further occurences, but it is not always possible to legislate for all eventualities and so I would be grateful if anyone could offer suggestions/resources available that will help identify WF instances that have got themselves into a 'Suspended' state.

Thanks

1

I have accomplished this the poor mans way by Creating a final Stage called Done. The only thing the Done Stage does is Transition to stage Go to End of Workflow.

Then it is easy enough in my List or Library to use views to show WF that are NOT in the Done Stage

  • I use the same method as Jeff. If one of the list items doesn't finish, I use the elipsis>Workflows for that item to identify what is going on with that workflow. Easy, out of the box way of finding problem workflows. – MonkeyWrench Apr 23 '15 at 17:47
0

You have to write a small program(using CSOM) to get all instance with status... Get all workflow instances

You can also use the Workflow Services instance service to view all workflow instances that are running on a SharePoint site, list, or document library. The instance object that is returned contains information on the instance, such as when it was last updated, the current status, and any errors that may have occurred when it ran previously. Additionally, it provides a collection of name/value pairs that were submitted to the workflow from the custom initiation form.

To do this, start by using the GetWorkflowInstanceService method to get a reference to the instance service. Note that the WorkflowInstanceService provides several methods for obtaining the collection of running workflow instances:

  • Enumerate . Accepts a workflow association (that is, a subscription) as a parameter, and can be used to get all the instances that have been created based on the specified association.
  • EnumerateInstancesForSite : Gets a list of all workflow instances that have been started on the SharePoint site that was set when creating the original WorkflowServiceManager object.
  • EnumerateInstancesForListItem . Accepts a list ID and item ID; use this method to get all workflow instances that have been created on a specific list item.

Read this article for more details and also examples.

http://msdn.microsoft.com/en-us/library/office/dn481315(v=office.15).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.