It is unlikely (but possible) that the prophets were physically involved in the work of building. If you read Haggai and Zechariah, you will find out what messages the prophets shared with the leaders of Israel. They encouraged them to keep going in the work of building. The prophets brought the Word of God to the people; they spoke directly to the leaders.
2 Then Zerubbabel the son of Shealtiel and Jeshua the son of Jozadak arose and began to rebuild the house of God that is in Jerusalem, and the prophets of God were with them, supporting them.