Today, military personnel are often used as a labour force to fulfil various peaceful functions, given that most soldiers aren't preoccupied with fighting wars in the most peaceful period of human history. A prime example is the use of soldiers for humanitarian reasons, such as the execution of aid relief missions or as rescuers in disasters & crisis.
When and what is the first known recorded use of soldiers in all of history for peaceful purposes? These soldiers should be on active duty, the activities they are involved in should not have any relation to warfare whatsoever, and use of weapons technology should not be involved unless it is for a non-combat functionality (eg. dynamite). The soldiers should also be directly ordered to execute this peaceful action rather than being a side effect of some other order.
To clarify the eligibility criteria set above, here's a few examples of what kind of scenarios do not qualify under the above criteria:
- Soldiers retiring home after campaign season to farm and harvest, and returning to fight only in the next campaign season. They aren't on active duty while farming - we tend to call them farmers rather than soldiers during the harvest.
- Construction of Roman settlements around long-term garrisons. Those settlements originally exist to provide comfortable homes for soldiers stationed there to defend the region against potential invaders (and retired soldiers who stay). The construction of the town happened because of potential warfare - it probably wouldn't have happened if there's no war or soldiers in the world. It is also a side effect: soldiers were generally not ordered to build a town, they were only ordered to build a fort around which the town sprung up.
- Armed peacekeepers. They are there to fulfil a military role.