AEM workflow purge configuration failures

Workflow purge jobs don’t execute or don’t remove workflow instances and workflow packages even after purge configurations are deployed. Workflow counts remain high, workflow packages persist after purge operations, or purge execution differs across environments. To resolve the issue, validate scheduler settings and verify purge execution.

Description description

Environment

  • Adobe Experience Manager as a Cloud Service (AEMaaCS)
  • AEM Managed Services (AMS)
  • Workflow Purge Scheduler
  • Cloud Manager configuration pipelines
  • Workflow maintenance tasks

Issue/Symptoms

  • Workflow purge jobs do not remove RUNNING, COMPLETED, ABORTED, or ARCHIVED workflow instances.
  • Workflow packages remain after purge execution.
  • Workflow counts displayed in AEM do not match repository query results.
  • Purge executes successfully in the local SDK but not in an AEMaaCS Sandbox environment.
  • Archived workflows continue to accumulate after scheduled purge cycles.

Cause

Workflow purge jobs fail because the Workflow Purge Scheduler configuration is incomplete, incorrectly deployed, or running in an environment where maintenance-based purge tasks do not reliably execute. Missing mandatory scheduler properties prevent the purge job from running, while transient workflows can create discrepancies between workflow counts displayed in AEM and repository query results.

Resolution resolution

Follow these steps to resolve the issue:

  1. Identify whether the issue relates to scheduler configuration, environment limitations, workflow count discrepancies, or orphaned workflow packages.

  2. Run the workflow query and compare the results with the workflow count displayed in the workflow console. Determine whether transient workflows explain any discrepancy.

  3. Review the Workflow Purge Scheduler configuration and verify that all required properties are defined, including:

    • Workflow status
    • Retention period (days old)
    • Workflow model identifiers
    • scheduledpurge.purgePackagePayload(when workflow package deletion is required)
  4. Confirm the target environment. If testing occurs in an AEM as a Cloud Service Sandbox environment, validate the configuration in a Development environment because Sandbox environments do not reliably execute maintenance tasks.

  5. Deploy the purge configuration through a Cloud Manager configuration pipeline and verify that the configuration is visible in the Developer Console after deployment.

  6. Verify purge execution by reviewing maintenance task logs, JMX (AMS), or available purge execution logs. Confirm that the purge process completes successfully.

  7. If workflow packages remain after purge execution, remove orphaned workflow packages using the supported cleanup procedure and verify that package nodes no longer exist.

  8. Configure an appropriate purge schedule and retention period based on workflow volume:

    • High-volume environments: Daily purge with approximately 30-day retention.
    • Lower-volume environments: Weekly purge with 30–90 day retention.
  9. Validate that workflow counts decrease after the next purge cycle and that repository performance improves.

recommendation-more-help
experience-cloud-kcs-help-kbarticles