It is narrated from Ibn Abbas (may Allah be pleased with them) that he said: When people would finish Hajj, they would depart in every direction, so the Prophet (ﷺ) said: "None of the pilgrims should leave until his last act is at the House of Allah (i.e., he performs the Farewell Tawaf)."
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 1029
Hadith Takhrijأخرجه مسلم، الحج، باب وجوب طواف الوداع وسقوطه عن الحائض (1327)۔