How to query for "Processes with Errors"

Certified Lead Developer

Hi everyone, 

We have a requirement where we need to clean up old process instances from our Production environment as we have around 20,000 instances with errors in them that are taking up disk space. Instead of having our help desk team delete 25 instances at a time from the "Monitoring" View, I thought that we could create a process report that would contain all process instances with errors and have an automated process that queries that report and deletes those instances. However, I can't seem to find a filter criteria for "Processes with Errors". I know there are "Active", "Paused by Exception" etc. I also know that there is a report called "Processes with Problems" but that only filters by "Paused by Exception". How can I query for all the instances that have an error in them? Has anyone encountered this blocker? And if so, how did you get around it?

Thank you, 

Rajiv Nelvoy

  Discussion posts and replies are publicly visible

  • This can be tricky since AFAIK we cannot pull process instances into a report automatically when they are active (not paused), with any nodes that have encountered an error (such as a DB truncation error, or null function error).  Paused by Exception is reportable, but otherwise we will do this per application when performing a bulk cleanup.  Some things can be helpful such as creating reports for any active process instances that have 0 active tasks (only applicable for processes that always should have a task active).

    Due to this, we make it a priority to review and resolve server alerts as they are thrown.  In most cases, the processes can be adjusted to prevent future errors. 

  • 0
    Certified Lead Developer
    in reply to Chris

    Sorry for the late reply, Chris. Yea, the project I am on is rather old and has broken instances from several years ago. A lot of them have broken on script tasks and there doesn't seem to be a way to query for those kinds of instances. Is there? 

  • Depends - should there always be a task active in this process?  (then you can query for active processes with 0 active tasks).

    Should there be instances still running from years ago?  (then for instance, you could kill anything still running which was started prior to 2022, etc)

    Also to note, from the monitoring mode you can access a process report which you can increase the rows per page on, to mass cancel/delete that way when needed.  I've used this on thousands at a time prior (I want to say I started seeing performance issues around 6,500 per page but don't quote me, was a few years ago - either way you should be good to go for 1k or 2k per page).

  • 0
    Certified Lead Developer
    in reply to Chris

    Hmm, you have given me an idea, Chris. Especially regarding the "querying for active processes with 0 tasks". I think that will work for a good portion of it. We have several different kinds of active processes - some broken on a UI task, some broken on a non-UI task, some on a quick task with no exception flow etc. It just requires some analysis on those. Since this is production, we are being extra careful to make sure we are not deleting instances that should remain active. 

    Thanks for the help! I will keep you posted.