Alfresco Content Services - Blog

Showing results for 
Search instead for 
Did you mean: 

Alfresco Content Services - Blog

Active Member


My goal was to delete all active and completed tasks and workflows in ACS and here is some information what i found out untill i could reach my goal. 


  • Workflow Console "delete all worfklows imeanit" command only delete active tasks and workflows
  • Trying to undeploy and redeploy a workflow definistion name with workflow conolse will delete completed workflows related to that workflow definition but it will not remove the completed tasks - undeploying a workflow definition will cause you a problem - completed task without deployed definition  (link
    Exception (with status template): 01030136 Failed to execute script 'Javascript Console Script': null
    org.springframework.extensions.webscripts.WebScriptException: 01030006 Wrapped Exception (with status template): 01030136 Failed to execute script 'Javascript Console Script': null
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(
  • With Alfresco RestApi you are not able to manage completed tasks/workflows only active tasks/workflows
  • I also found out someone managed to delete completed task/workflows with deleting records directly in the DB, how ever i did not investigate this deeply.


So the solution what worked for me is to write a custom javascript code what i could run with javascript console to remove completed task and workflows in the repository.

Here is the script:

var ctxt =;
var service = ctxt.getBean('WorkflowService',;
var activitiProcessEngine = ctxt.getBean('activitiProcessEngine',;

var activitiUtil = new org.alfresco.repo.workflow.activiti.ActivitiUtil(activitiProcessEngine, false);
var historyService = activitiUtil.getHistoryService();

var completedWorkflows = service.getCompletedWorkflows();

while(completedWorkflows.size() > 0){
    var wfToDelete = completedWorkflows.remove(0);
    var id = wfToDelete.getId();

    logger.log("WF deleted: " + id);

    completedWorkflows = service.getCompletedWorkflows();


The script tested with ACS 5.2 CE AND ACS 6.2 CE

I would like to thank my colleagues at BroadBit Hungary and @angelborroy  @openpj for their help

Ps.: If you have any comment or suggestion please dont hasitate to post it.

Read more
1 1 1,022
Active Member II



I am pleased to announce that the brand new Alfresco Mobile Workspace is live in the app stores! Links in the article.


Read more
2 0 1,057
Active Member II

The source code for the Alfresco Mobile Workspace is now available on GitHhub!



Read more
3 1 1,047
Alfresco Employee

Some repos were recently made read-only - here's why...


Read more
4 0 1,892
Active Member II


It is with great excitement that I can announce this early access release of the Alfresco Mobile Workspace, a brand new mobile app for content management.

What is the Alfresco Mobile Workspace?

The Alfresco Mobile Workspace is a brand new mobile application with a similar look and feel to the Alfresco Digital Workspace. Out of the box the Mobile Workspace is the perfect companion for the Digital Workspace allowing users to seamlessly interact with content across the web and mobile.


Read more
6 2 4,092
Alfresco Content Services Blog