Modelling the default performance of a large heterogeneous portfolio is a major topic in credit risk. One approach is to derive analytic or partly analytic approximations based on the law of large numbers and/or central limit theorem; examples are Vasiceks large homogeneous portfolio model or the saddle point approximations used in CreditRisk+. Here we introduce an approach based on ideas from stochastic networks. The portfolio members are thought of as particles that move around a number of credit risk states (credit ratings) before eventually defaulting. The transition rates are supposed to depend on an external environment process, thus introducing dependence between the particles. We study the limiting behaviour of this system as the number of particles increases, obtaining conditional fluid and diffusion limits from which portfolio performance can be predicted.