This article traces the origins of European legislation during the legislative policy-making process. It identifies three phases where parts of the text of legislative acts can be developed: (1) agenda-setting; (2) intra-institutional decision-making and (3) interinstitutional negotiations, depending on whether the content of the legislation originates respectively in the Commission proposal, the co-legislators’ positions or trilogue negotiations. Using a newly developed text-mining technique which computes in which phase each word of a legislative act originally appears, the article examines the relative importance of each phase and explores how it is affected by interinstitutional conflict. Applying this method to 219 legislative acts adopted between 2012 and 2018, it finds that most EU legislation originates in the agenda-setting phase, and that the new content developed during trilogue negotiations is limited. However, the importance of the agenda-setting phase decreases in cases with high levels of interinstitutional conflict.