Stop a sharepoint workflow automatically
1 answer
I haven't tried it, but the SPWorkflowManager.CancelWorkflow Method should do what you want to do: "Cancels the specified workflow instance."
I hope this works and solves your problem.
+1
source to share