I frequently have issues with workflows which are dependent on fields which do not exist for a particular project/scenario.
For example I have a project which does not have a 'State' field, which is used for collating subtasks. If we add an issue as a subtask, and that issue belongs to a project with the 'jetbrains-youtrack-subtasks' workflow, then we cannot close the issue due to the 'State' field not existing on the parent issue.
Would it be possible to improve this behaviour? It stops users from doing what they want (which is normally correct) and makes the system look bad.
Obviously I could remove the workflow, but if we continue to expand our use of linking issue, the workflow system will be reduced to it's lowest common denominator.
I've seen the addition of red underlining of workflows when the system recognises that they will not work correctly, but obviously this particular problem is not highlighted and I imagine it would be difficult to codify.
I have some suggestions/options why may help with a catch all solution...
1) Add exception handling to workflows so they can detect problems and take alternative action
2) Mark workflows as optional, so if an error occurs, they get ignored and the sysadmin receives email notification.
3) Allow workflows to check for the existence of a field