(FR #1817) Fix automatic state changes

We were reconstructing the workflow spec without including conditions.

Change-Id: Ic2e9a28c020d5bc124261b7ce5fbc5975819f64e