Delete all workflows in Alfresco using Script

Recently Alfresco released a major version of Alfresco (version 5.0) offers a lot of new features and tweaks. They have also removed many obsolete features/code. In this article, we will go through how you can delete all workflows in Alfresco, using scripts.

I already have written this article related to feature which I like the most: Faceted Search in Alfresco

Now as they say you have to drop something to get something new. Alfresco has finally removed few items from the product. Some of them were quite obvious and expected from a long time. Jeff and Richard already have explained all those things in details in their posts, so I am not going to repeat all those stuff in this post.

Now with the removal of old Alfresco explorer we have lost many useful consoles which as a developer, we cannot live without. So, only option left as of now is to find some workaround to replace them.

Here I am posting one of the scripts which you could use to delete all existing workflows from your system, which earlier we were able to do through alfresco workflow console as I had mentioned in this post.

Script to delete all workflows in Alfresco system.

function main() {
	var workflowDefinitions = workflow.getAllDefinitions();
	for (i in workflowDefinitions) {
	   var workflowDefinition = workflowDefinitions[i]
	   logger.error("Def:" +;
	   var workflowInstances = workflowDefinition.activeInstances;
	   for (j in workflowInstances) {
	      wfInst = workflowInstances[j];
	      logger.error("   Inst:" +;

You can upload this script in your Scripts folder using Alfresco share client. Associate this script any rule and execute it once.

To know more about rules and execute Rule Refer these posts.

This is very useful workaround for workflow console replacement. You could leverage usage of Alfresco Javascript API to create such scripts.

Looking for quality Alfresco Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , | Posted under Alfresco | RSS 2.0

Author Spotlight


I love opensource technologies working with those technologies from the time I have stepped in to the Software Industry. Alfresco CMS is my area of expertise. I have worked on various complex implementations which involved integration of Alfresco with other technologies, extensively worked with JBPM workflows and Webscripts.

One Comment on Delete all workflows in Alfresco using Script

  1. Sujay Pillai says:

    The Administration console is back in 5.0.d –

Leave a Reply to Sujay Pillai Cancel reply

Your email address will not be published. Required fields are marked *