The fragmentation of production across borders allows firms to make and export final goods, or to perform only intermediate stages of production by processing imported inputs for re-exporting. We examine how financial frictions affect companies' choice between processing and ordinary trade -implicitly a choice of production technology and position in global supply chains -and how this decision affects performance. We exploit matched customs and balance-sheet data from China, where exports are classified as ordinary trade, import-and-assembly processing trade (processing firm sources and pays for imported inputs), and pure-assembly processing trade (processing firm receives foreign inputs for free). Value added, profits and profitability rise from pure assembly to processing with imports to ordinary trade. However, more profitable trade regimes require more working capital because they entail higher up-front costs. As a result, credit constraints induce firms to conduct more processing trade and pure assembly in particular, and preclude them from pursuing higher value-added, more profitable activities. Financial market imperfections thus impact the organization of production across firms and countries, and inform optimal trade and development policy in the presence of global production networks.