We study the determinants of the firm-level choice to produce following an order placed by a downstream firm (production to order) or to produce in advance. We rationalize this choice through a simple theoretical model and apply it to a firm-level empirical analysis. Relying on a large dataset of Italian manufacturing firms, we show that two main variables affect this choice: the extent of spatial clustering of the industry, and the degree of product complexity and relationship-specificity of the goods that are traded. The sign of the impact of clustering on the choice of producing to order crucially depends on product complexity. If product complexity is high, production to order prevails when firms are clustered together. On the contrary, clustering is associated to production in advance for sectors where goods are standardized.