pipeline: add a get_mode method.