locked
Deleted workflow is sending alerts RRS feed

  • Question

  • Workflow tasks are deleted by accessing the workflow task list. Its document is deleted. But, the alerts are being send to the end users.

    How can I complete/ cancel a deleted workflow?

    Please help.

     


    Sara
    Thursday, April 22, 2010 6:15 PM

Answers

All replies

    • Marked as answer by GuYuming Saturday, May 1, 2010 7:23 AM
    Thursday, April 22, 2010 8:03 PM
  • It would be great if the official document is also referenced: http://office.microsoft.com/en-us/sharepointserver/HA101722641033.aspx

    Saturday, May 1, 2010 7:25 AM
  • Thank you all for reply.

    I am having a problem with a cancelled workflow. The workflow is cancelled, there is not active tasks, and the document is deleted also.

    But, end users are recieving email on  completed and deleted tasks related to a workflow ended in March 17th.

    How can I find the source of this calprit? The hyperlinks in the overdue alert email returns http 404.

    The workflow feature works fine for all the visible tasks.

    This message comes back when end user click on "Edit this task" button from the alert email.

    Microsoft Office Outlook:

    An error occurred while retrieving the workflow task details. This could be caused by not having connectivity to the server of because the task no longer exists. If this error persists , contact your system administrator.

    Please help.

    Please help.

     


    Sara
    Monday, May 10, 2010 5:17 PM
  • I am afraid there is no good OOTB solution to “kill” running workflow instance if the associated list item was deleted.

     

    Can you still find the deleted item in site or site collection recycle bin?

    Tuesday, May 11, 2010 3:58 AM
  • No. The error appeared 45 days after it was deleted.

    Deleting the document cancels all the running workflow tasks. The said case ran to error during deleting.

    The case reappears whenever the end users performs many creating and deleting workflows with no elapse time.

    Now, I am collecting the workflow ids whenever I find an error in the workflow error log.

    Is there any command to end an workflow by its ID?

     


    Sara
    Wednesday, June 2, 2010 4:58 PM
  • I am a little bit confused with this issue.

     

    If you delete a list item, workflow instance associated with this list item will be canceled (there won't be email sent out by the workflow instance any more). If the workflow instance created some task list items, the task list items will be canceled (not deleted). If there is workflow associated with the task list, the workflow instance associated with canceled task list item can still be running and sending out email. If you delete the task list item, the workflow instance associated with it will also be canceled.

     

     

     

    Deleting the document cancels all the running workflow tasks. The said case ran to error during deleting.

     

    The case reappears whenever the end users performs many creating and deleting workflows with no elapse time.

     

    My understanding of your statements above is that workflow instance can still be running instead of been canceled after the list item is deleted (ran to error during deleting), the existence of orphaned workflow instance.

     

    And you can reproduce this by performing many creating and deleting workflows with no elapse time. What does this mean? Could you please be more specific on the steps to reproduce?

     

    Workflow instances are stored in the Workflow table of SharePoint content database, you can run the following SQL in SharePoint content database to list all workflow instances.

    SELECT AllLists.tp_Title as ListName,[ItemId],[ItemGUID],[Id] as WKFLinstanceID,[Modified],[Created],[InternalState]

      FROM [Workflow] with (nolock)

                    inner join AllLists on workflow.ListId =AllLists .tp_ID

     

    And the field ItemGUID  links the workflow instance to list item in AllUserData table. If the list item is deleted and also deleted in the recycle bin, the record will be deleted in the AllUserData table. So, to prove the existence of orphaned workflow instance, you may use the following SQL to find out all workflow instances without a corresponding list item record:

    SELECT AllLists.tp_Title as ListName,[ItemId],[ItemGUID],[Id] as WKFLinstanceID,[Modified],[Created],[InternalState]

      FROM [Workflow] with (nolock)

                    inner join AllLists on workflow.ListId =AllLists .tp_ID

                    left join AllUserData on ItemGUID =AllUserData .tp_GUID

      where AllUserData .tp_GUID is null

    And you can find out the status of the workflow instance from the InternalState field. For more about the InternalState field, please take a look at the following thread and document:

    http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/f295bdbe-9f85-4be2-870b-c55551b0954d

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.workflow.spworkflowstate.aspx

     

    BTW, I found the following articles about the SQL server stored procedure used to delete a Workflow from a List Item:

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

    http://msdn.microsoft.com/en-us/library/dd957676.aspx

     

    Notices that direct access to SharePoint content database is not supported:  http://msdn.microsoft.com/en-us/library/bb861829(office.12).aspx

    • Marked as answer by Sara_111 Tuesday, June 22, 2010 1:50 PM
    • Unmarked as answer by GuYuming Friday, December 10, 2010 8:34 AM
    • Proposed as answer by Mathew Inkson Tuesday, February 5, 2013 10:32 PM
    Thursday, June 3, 2010 5:40 AM
  • If you delete document library item, workflow instance associated with it is not deleted. The document item and workflow instance is permanently removed if you delete it from the site collection recycle bin.

    It works the same way in SharePoint 2007 and 2010. Please read this thread: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/2b763502-cb4e-4715-9b1d-d0f2639d2bfe/

    • Marked as answer by GuYuming Friday, December 10, 2010 8:40 AM
    Friday, December 10, 2010 8:39 AM