Overview
During the background task "Update object workflow states" the system is going through all workflows and workflow states where automatic state transitions or conditions are set. It is checking all the objects in workflows and sees if they match the conditions that would allow them to move forward. Depending on the number of objects that are sitting in workflows, this can take a long time. It depends on the number of objects, number of workflows, number of states, and complexity of conditions it needs to evaluate for each one. (Especially scripts may be complex.)
As the background task can take a relatively long time, it might start to influence performance.
This article will go through a few changes that can be made to optimize workflow performance so the background task "Update object workflow state" won't take so long time.
Optimizing vault performance is always necessary.
Suggest also checking this guide: Monitoring and Optimizing M-Files Performance (site.com)
Solution
Some tips that can be used to speed up this:
1) Reduce the number of Workflow states that have automatic state transition from it, but the objects sit there indefinitely as the conditions never come to completion. Instead, try, if possible, to have end states in workflows where constant transition checks are not needed.
2) Generally, reduce the number of automatic state transitions and objects in them, if possible. Maybe change some state transitions to require user interaction by notifications instead.
3) Replace some automatic transitions with Event Handlers. So, the transition is triggered by interaction and done by M-Files API.
4) Replace some automatic state transitions with the Custom vault application to scan for relevant objects and change states by M-Files API.
