[hrms] workflow : put into 1 function