Luis Enrique's side flirted with league-phase elimination on the way to reaching the Champions League final.