Deleting Workflow Processes Best Practices

Hello,
We are trying to figure out how to delete workflow processes that were halted at mid stream for internal business reasons. When we tried deleting the workflow we get the message / Error "Workflow cannot be deleted. Its used in workflow related_id "xxxxx". 

Question is: How does one delete the Relationships of any related item that is tied to the actual workflow? Looking for some specific examples on how we can accomplish this. 

Any help would be appreciated. If possible an AML sample would also go a long way in trying to resolve this issue.

Thanks in advance for your support.

    William E. 

Parents
  • Hi,

    If you wanted to delete workflow process one of the alternative way is to delete it from SQL by executing below queries you can sucessfully delete the workflow process.

    /* Delete all workflow items where workflow process is used as related_id. */
    DELETE FROM innovator.WORKFLOW WHERE RELATED_ID in (SELECT ID FROM innovator.[WORKFLOW_PROCESS])
     
    /* Delete all workflow process activities where workflow process is used as related_id. */
    DELETE FROM innovator.WORKFLOW_PROCESS_ACTIVITY where RELATED_ID is not null --in (SELECT ID FROM innovator.[WORKFLOW_PROCESS])
     
    /* Delete all workflow process items. */
    DELETE FROM innovator.[WORKFLOW_PROCESS]
Reply
  • Hi,

    If you wanted to delete workflow process one of the alternative way is to delete it from SQL by executing below queries you can sucessfully delete the workflow process.

    /* Delete all workflow items where workflow process is used as related_id. */
    DELETE FROM innovator.WORKFLOW WHERE RELATED_ID in (SELECT ID FROM innovator.[WORKFLOW_PROCESS])
     
    /* Delete all workflow process activities where workflow process is used as related_id. */
    DELETE FROM innovator.WORKFLOW_PROCESS_ACTIVITY where RELATED_ID is not null --in (SELECT ID FROM innovator.[WORKFLOW_PROCESS])
     
    /* Delete all workflow process items. */
    DELETE FROM innovator.[WORKFLOW_PROCESS]
Children
No Data