Add spec and terminate_pipeline function.