Fix SharePoint Server 2019 Workflow History and Approved Items Deletion
Question details
Completed workflow instances and approval history in SharePoint Server 2019 are disappearing automatically after several days, leaving the workflow status blank.

- Product
- SharePoint Server 2019
- Device & OS
- not provided
- Scenario
- Managing document approvals and maintaining permanent audit records of workflow histories in a SharePoint on-premises environment.
- Observed behavior
- Completed workflow instances and their associated approval history are automatically deleted from the system, usually by a timer job, causing the workflow status to become blank.
Ensure you have SharePoint Farm Administrator privileges or sufficient permissions to access the SharePoint server and run SharePoint Management Shell (PowerShell) commands.
Increase the Workflow AutoCleanupDays via PowerShell
Modify the default retention period for a specific workflow association using SharePoint PowerShell to prevent premature deletion.
SharePoint uses a Workflow Auto Cleanup timer job that automatically removes completed workflow data after a default 60-day retention period. You can extend this duration for specific workflow associations rather than disabling the cleanup job globally.
Log in to your SharePoint Server as an Administrator and launch the SharePoint Management Shell.
Run the command to store your site and list in variables, for example: $web = Get-SPWeb 'http://yoursharepointsite' and $list = $web.Lists['YourListName'].
Identify the workflow association and change its cleanup threshold. For example: $list.WorkflowAssociations[0].AutoCleanupDays = 365.
Commit the changes by executing $list.WorkflowAssociations[0].Update(). The workflow history will now be retained for the specified number of days.

Copy Approval Details to a Separate Audit List
Create a permanent record of workflow approvals by configuring your workflow to write final status data to an independent custom list before completion.
Looking for a simpler way to manage office documents? Try WPS Office
While resolving Microsoft SharePoint server settings requires IT administration and complex PowerShell scripts, managing your everyday office documents should be effortless. WPS Office provides a lightweight, highly compatible alternative to Microsoft Office for creating, editing, and sharing documents locally or via the cloud without complex retention policies.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your specific operating system.
- 2. Install the software: Run the setup file and follow the on-screen instructions to install WPS Office on your device.
- 3. Manage your documents securely: Create, save, and organize your documents locally or sync them to WPS Cloud to ensure your files are permanently retained and easily accessible.

Frequently Asked Questions
Why does SharePoint delete workflow history by default?
The Workflow Auto Cleanup timer job is designed to delete completed workflow instances and their associated history tasks automatically (typically after 60 days). This prevents the hidden Workflow History list from growing too large, which would eventually impact the performance of the entire SharePoint site collection.
Can I completely disable the Workflow Auto Cleanup timer job?
While you can disable the timer job in SharePoint Central Administration, it is highly discouraged by Microsoft. Disabling it applies globally across the web application and will eventually lead to severe performance degradation due to unbounded list growth in the workflow history lists.
Does changing the AutoCleanupDays affect currently running workflows?
No. The AutoCleanupDays retention period only applies to workflows that have reached a 'Completed' or 'Cancelled' state. Active, running workflows are ignored by the Auto Cleanup timer job regardless of how long they have been running.
How can I view the workflow history before it gets deleted?
You can view the workflow history of an item by navigating to the specific SharePoint list or document library, selecting the item, clicking on 'Workflows' in the ribbon or context menu, and then clicking on the name of the completed workflow instance.




