It is narrated from Ibn Abbas (may Allah be pleased with them) that he said: People were commanded that their last act (before leaving) should be at the House of Allah (in the form of the Farewell Tawaf), except that the Prophet ﷺ granted concession to menstruating women.
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 1036
Hadith Takhrijأخرجه مسلم ، الحج، باب وجوب طواف الوداع وسقوطه عن الحائض (1328)۔