AEM 6.4 - How to purge workflow packages | Community
Skip to main content
Level 2
January 27, 2022

AEM 6.4 - How to purge workflow packages

  • January 27, 2022
  • 4 replies
  • 3581 views

In our AEM 6.4.3.0 Author instance we are seeing a lot of generated workflow packages (~1800) in /etc/workflow/packages. Much more than there are running workflow instances. The Workflow Purge is configured to remove COMPLETED workflows older than 30 days but this doesn't seem to remove associated workflow packages.

Is there a way to get rid of the old workflow packages?

4 replies

Anish-Sinha
Adobe Employee
Adobe Employee
January 27, 2022

Hi @kais46765928 ,
Please go through this link: https://adobe-consulting-services.github.io/acs-aem-commons/features/workflow-remover/index.html

You can do it manually or else schedule it.

Level 2
January 28, 2022

Hi @anish-sinha . I had a look at the Workflow Remover but I don't think it does what we need. If I understand correctly, the Workflow Payload Paths you can specify in the Workflow Remover configuration only act as an additional filter for determining if a workflow should be removed or not.

What we would like to have is that the payload of the workflow is removed together with the workflow, but only if the payload is a generated workflow package.

 

October 24, 2024

Any idea how do we change the location from etc/workflow/packages to var/workflow/packages?

lukasz-m
Community Advisor
Community Advisor
January 27, 2022

Hi @kais46765928, as far as I know there are no OOTB AEM mechanism or ACS Commons functionality that will allow to remove workflow packages. All above functionalities concentrate on workflow instance only. Looking on the number of workflow packages, I would assume you are using workflow packages on daily basis. In that case I would suggest to create some custom java functionality, i.e. using Scheduler that will periodically - e.g. every night look for packages that are connected to finished workflow instances (Completed or Aborted).

I would also consider to include mechanism that will take care of orphaned packages. You are using Workflow Purge mechanism so I am sure that for some of the packages workflow instance does not exist in the repository any more, but those packages should be removed as well.

Level 2
January 28, 2022

Thank you for your input. I find it quite hard to understand why there is no OOTB solution in AEM for this. Isn't this a common problem when using workflows? I mean that workflow packages are automatically generated and pile up in the repository? Or are we doing something wrong in our AEM/workflow setup?

lukasz-m
Community Advisor
Community Advisor
January 28, 2022

You are correct this is a common problem, I am not aware how exactly you have implemented your case, but I doubt you are doing something wrong. I have no idea why workflow package purging is not part of OOTB AEM functionality.

antoniom5495929
Level 7
January 28, 2022
Level 2
January 28, 2022

Thank you for your answer but I'm afraid it doesn't address my question. I was asking about generated workflow packages in /etc/workflow/packages and not about packages created by the package manager.

This shouldn't be marked as the correct answer.

antoniom5495929
Level 7
January 28, 2022

Hi @kais46765928 ,

you can use exactly the same approach for all the /etc/ packages.

Thanks,

Antonio

Wilnaweb1
Level 2
September 3, 2025

Hello friend,

I was able to delete the packages linked to the Workflows by using the following property in the XML configuration file:

"scheduledpurge.purgePackagePayload": true,

 

Configuration example:

{ "scheduledpurge.name": "Workflow Auto Purge", "scheduledpurge.workflowStatus": ["COMPLETED", "SUSPENDED"], "scheduledpurge.daysold:Integer": 7, "scheduledpurge.purgePackagePayload": true, "scheduledpurge.modelIds": [ "/var/workflow/models/scheduled_tree_activation", "/var/workflow/models/schedule-publish", "/var/workflow/models/scheduled_activation" ] }


I recently wrote a detailed article about this process, available at:
https://medium.com/@wilsoncavalcante/cleaning-routines-in-aem-part-1-workflows-465fc30875bd