add logic for generating run id and latest