Persist state machine