A constitution is the foundation of any democracy, and its wording shapes the path of democratic development. Does deliberation in random groups affect the composition and ultimate development of a constitution? Here, we test deliberative theories of citizens assemblies in a legislative context. National policy was deliberated in randomly assigned groups of legislators, creating the 1849 June Constitution in Denmark. Using a panel of legislators and roll call votes, we find evidence for substantial and significant deliberative effects, but these go in different directions in different groups. Lottery-based procedures encouraged deliberation during a period of democratization without developed parties, resulting in the constitution that governs Denmark to this day. Our results highlight the need to better understand promising deliberative mechanisms driving behaviour in random assemblies, before transplanting randomisation to national arenas where the stakes are high.