[deleted]
Although some public offices were indeed assigned by lot, when these weren't ad-hoc positions like special judges or ambassadors they tended to be rapidly rotating, with tenures of around a month. Candidates were nonetheless pre-selected by the leaders of the various Arti; and here lay the power and influence of Cosimo.
In the city of Florence the major bourgeois professional associations, commonly referred to as the Arti Maggiori (roughly translatable as "Major Guilds") were the primary writers of laws, rules, and regulations. Each *Arte Maggiore elected a Priore who sat in a council called Priorato delle Arti, more colloquially referred to as Signoria, which was Florence's powerful executive body. Cosimo, through his great wealth and influence, was able to influence the leaders of the Arti directly, modifying their shortlist of candidates for the Priorato. Plus, the Arti and their leaders were associations of working artisans who made ample use of credit lines from the Medici bank; much like credit windows used by modern businesses to plug gaps between purchase of raw materials and sale of finished goods. Even when Cosimo was exiled from the city of Florence by the Balìa, a powerful ad-hoc intradepartmental committee of prominent politicians, it was only a matter of time until the Priorato's rapid rotation meant his sympathizers (and debtors) were in the majority and reversed his sentence. Soon the Balìa too would be reconstituted and include a majority of Cosimo's allies.
Cosimo's good relations with the leaders of the Arti, tight control over the shortlist for important positions drawn by lot, and diversified investments and business interests, allowed him to pull the strings behind the scenes. The system wasn't perfect, nor did it allow for total control, but it was sufficiently effective that before long, foreign ambassadors, after a token appearance at the Palazzo Vecchio, went straight to Cosimo's home in the Via Larga.