Problem Description:
SharePoint Designer Workflows in version 2013 couldn’t be terminated on the GUI because they were in an undefined state
Resolution:
$web=get-spweb https://URL
$list=$web.lists[“ListName”]
$wfm=New-Object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($list.ParenWeb)
$wfm.GetWorkflowInstanceService()
$wfs=$wfi.EnumerateInstancesForListItem($list.ID,”$itemID”)
$wfi.TerminateWorkflow($wfs[0])