In our AEM 126.96.36.199 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?
Hi @anish-s . 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.
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.
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?
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.
Hi @kais46765928 ,
Alternatively this one could be a valid solution: https://medium.com/nirman-tech-blog/aem-jmx-solution-to-delete-packages-programmatically-50bdc61155e...
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.