It is narrated from Ata (may Allah have mercy on him) that a man asked Ibn Abbas (may Allah be pleased with them): "I have taken employment with a people so that I will perform Hajj with them. Will my Hajj be valid?" Ibn Abbas (may Allah be pleased with them) said: "Yes, for them is their share of deeds, and Allah is swift in taking account."
Hadith Referenceمسند الإمام الشافعي / كتاب الحج / 936
Hadith Takhrijأخرجه البيهقي : 4 333 - وابن أبي شيبة (15141) وصححه الحاكم : (1/ 481)۔