This can be achieved using the _StopInstance method of Worflow Process Manager BS
An example usage of this technique occurs when you have an interactive workflow which needs to be cancelled but which is suspended in a Wait step. In this scenario, the Process Instance Id is already known.
To stop a workflow process instance from script
Invoke the _StopInstance method on the Workflow Process Manager business service, as in the following example, which uses a hard-coded Process Instance Id:
var bs = TheApplication().GetService("Workflow Process Manager");
Comes in handy while you want to dliberately stop that annoying instance:)