Mishkat al-Masabih 1510
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: خَرَجَ نَبِيٌّ مِنَ الْأَنْبِيَاءِ بِالنَّاسِ يَسْتَسْقِي فَإِذا هُوَ بنملة رَافِعَة بعض قوائهما إِلَى السَّمَاءِ فَقَالَ: ارْجِعُوا فَقَدِ اسْتُجِيبَ لَكُمْ من أجل هَذِه النملة . رَوَاهُ الدَّارَقُطْنِيّ
From Abu Hurayrah, may Allah be pleased with him, who said: I heard the Messenger of Allah ﷺ say: "One of the prophets went out with the people to pray for rain, and there he saw an ant raising some of its legs towards the sky. He said: 'Go back, for you have been answered because of this ant.'" Reported by ad-Daraqutni.