Hi Barıs,
Hopefully others can respond with their own best-practices for maintaining tidy work queues, but I wanted to make sure you were aware of a direct database option for this. We in Support have a set of example "Housekeeping Scripts" you can request that may help here -- one such script is "trim_queues.sql", described below:
"Running this script will trim data in the BPAWorkQueueItem table and truncate the BPAWorkQueueLog table. The BPAtag table is also trimmed, removing any tags no longer being used by work queue items.
When clearing down the BPAWorkQueueItem table, the script uses a threshold of when the item was completed. It removes all BPAWorkQueueItemTag entries for the affected item records. As a result, queue items will no longer be accessible in the UI or a process.
The script will keep any items which were marked as finished a specific number of days ago, or have not been marked as finished yet."
If this sounds like it would meet your requirements, you can request these example scripts by opening a Support ticket with us. More information on the scripts themselves can be found in the KB, "
How do I get the database maintenance scripts?".