There has been great progress in understanding how bacterial groups coordinate social actions, such as biofilm formation, swarming and public-goods secretion. Less clear, however, is whether the seemingly coordinated responses observed at the group level actually mirror what individual cells do. Here, we use a microscopy approach to simultaneously quantify the investment of individual cells of the bacterium Pseudomonas aeruginosa into two public goods, the siderophores pyochelin and pyoverdine. Using gene expression as a proxy for investment, we initially observed no coordination but high heterogeneity and bimodality in siderophore gene expression across cells. With increasing cell density, gene expression became homogenized across cells, accompanied by a shift from pyochelin to pyoverdine expression. We found positive correlations in the expression of pyochelin and pyoverdine genes across cells, and show that cell-to-cell variation is driven by differences in cellular metabolic states. We propose a model explaining how variation in internal iron stocks can spur initial erratic gene expression, while siderophore-mediated signalling and intra-cellular feedbacks later on can induce highly coordinated gene expression and synchronized shifts from pyochelin to pyoverdine. Our work provides new insights into bacterial collective decision-making processes and reveals a three-phase chronobiological siderophore investment cycle in P. aeruginosa.