Showing results for 
Search instead for 
Did you mean: 

How to purge dbo.WorkflowLog table

Not applicable
10 5 6,302


The tracking data for each action and task are stored in the dbo.WorkflowLog table when you have verbose logging enabled.  This allows you to see additional variable information and other details in the Workflow history page.

The “dbo.WorkflowLog” table on Nintex databases stores the verbose logging that is set per workflow. We highly recommend that you turn Verbose Logging off unless we have specifically asked you to turn it on to diagnose an issue due to the amount of system resources it consumes.

To disable verbose logging globally

1.  Go to Central Admin > Nintex Workflow Management > Global Settings and un-tick the “Enable Verbose Logging” option. This will disable the option on all current and new workflows.

To clean up the dbo.WorkflowLog tables

Open SQL Server Management Studio, connect to the Nintex Workflow databases and truncate the databases by performing the following steps:

1. Make sure that verbose logging is OFF, Central Admin > Nintex Workflow Management > Global Settings and un-tick the “Enable Verbose Logging” option.

2. Perform an IISReset

3. Restart the SharePoint Timer Service

4. Execute the following SQL command on you Nintex Databases:

USE [YourNintexDatabase]


DECLARE @return_value int

EXEC @return_value = [dbo].[PurgeVerboseLogs]
@DaysToKeep = 0

SELECT 'Return Value' = @return_value


This above command will clear all of the records from that table (should be 0 after it is finished). If anything is still trying to write to that database when you run the stored procedure, it will lock the table and anything else that is relying on it. Performing an IISreset/timer service restart will ensure that the verbose logging is truly off and help prevent this from happening.

Nintex Newbie

Hi ‌ - Thanks for sharing this post. I was able to get the Nintex Workflow Scheduler timer job restored after cleaning up my database. However, I noticed that there are still 5k records and 600MB in the dbo.workflowlog table. Is this normal? The return value did indicate 0. The records originally were like at 800k and 96GB so it did make a vast difference.

Not applicable

Greetings ,

What happens when you rerun this operation?  It is possible there was some lock still on those records.

Kind regards,

Nintex Newbie

I went ahead and ran the stored procedure again and it removed about 200 records. Returned value was 0.

The lock on those records you are referring the state = 2?

The instances where the I.State<>2 are deleted from the workflow log. This appears that the workflows that are still running are not purged from the log. Here is my guess...any workflow in the farm that had verbose logging enabled and the workflow is not completed it cannot be purged yet from the workflowlog table.

Nintex Newbie

Hi Pavel, 

When I run the SQL command it does not delete all records from the workflowlog table. I started cleaning up old workflow data a while ago (in Test environment), but i was noticing that the database is not getting smaller (~130GB). The workflowlog table does not seem to be decreasing, not after deleting completed workflows and also not after running your command. 

Could it be a problem that the workflows were deleted prior to running the SQL command? If this is the problem, how should we proceed? 

Thanks for your help. 

Nintex Newbie

Hi there,

The above procedure brought my 85.000 records back to 70.000 records, in stead of back to 0 records.
Could anyone tell me why it won't go back to 0 records? And how I can get it back to 0 records?