Delete workflow instancesWhen you are in the development phase, usually you will have lots of workflows started, but not always finished.
If you want to remove all the running workflow instances, you can use a simple command in the workflow console (http://server:8080/alfresco/faces/jsp/admin/workflow-console.jsp)
delete all workflows imeanit
But there is a problem with this command.
It won't remove the workflow historical registers on database, and you can find some problems accessing your completed tasks after you undeploy your old workflow definitions.
This is a bug, and it wasn't fixed until 4.2.f, as described here https://issues.alfresco.com/jira/browse/ALF-20522
All you need to do is to run a delete on the database to delete all historic data for no existing workflow definitions:
delete from ACT_HI_TASKINST where not exists (select pd.ID_ from ACT_RE_PROCDEF pd where pd.ID_ = PROC_DEF_ID_);
Avoid having users starting your custom workflowsIf you created custom workflows, but you are starting then using code, so maybe it's a good idea to hide those workflows in the Start Workflow form.
This can be done including the following section into your share-config-custom.xml file:
<config condition="Workflow" evaluator="string-compare">