workflows: hotfix unittest

* Improves tests stability.

* Simplifies workflow engine.

* Fixes the endlessy working workflow engine bug.

Signed-off-by: Guillaume Lastecoueres <guillaume.lastecoueres@cern.ch>
Co-authored-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
Dear Jiri,

I am sorry but I think you misinterpreted the ouput of the request, indeed SQLAlchemy doesn't always get an output defining res[1](but define res[0]), sometimes it only define res[0], I agree it is quite counter intuitive, but I am not able to change it :worried:.
So except if I misunderstood what you mean I will keep the try except, because it is quite pythonic :wink: 

Have a good night and thanks for your time at this late hours.