1. The decline of managed honeybees and the rapid expansion of mass-flowering crops increase the risk of pollination limitation in crops and raise questions about novel management approaches for wild pollinators in agroecosystems. Adding artificial nesting sites, such as trap nests, can promote cavity-nesting bees in agroecosystems, but effectiveness could be limited by the availability of floral resources in the surrounding landscape and by natural antagonists. 2. In two European regions, we exposed artificial trap nests in paired field boundaries adjacent to oilseed rape (OSR) fields or non-flowering crops for two years within 32 landscapes covering two independent gradients of OSR cover and semi-natural habitat (SNH) cover in the landscape. We analysed the effects of local and landscape-wide floral resource availability, land-use intensity, landscape complexity and natural antagonists on community composition and population dynamics of trap-nesting bees. 3. Number of brood cells showed a strong, three-fold increase in response to the additional nesting sites. Species richness and abundance of cavity-nesting bees that were active during OSR flowering increased significantly with increasing amount of early-season landscape-wide floral resource availability, such as the cultivation of OSR. Later foraging species benefited instead from the availability of late-season alternative flower resources or SNH cover once the mass-flowering had ceased. Density-dependent parasitism increased following mass-flowering, while no density-dependent effect was found during mass-flowering. 4. Structural equation modelling revealed that the influence of floral resource availability on community growth rate was mediated by community size. Community size showed a strong negative effect on community growth rate. Despite positive density-dependent parasitism, antagonists had only weak regulating effects on community growth rate. 5. Synthesis and applications. Trap-nesting bee populations grow markedly with the increasing availability of food resources in the landscape and effectiveness of trap nests is only marginally limited by natural antagonists. Thus, trap nests could be a simple pollinator-supporting strategy to accompany the current expansion of mass-flowering crops, and to ensure pollination services for insect-pollinated crops. Trap nests benefit not only early season active generalist bees during oilseed rape flowering but also species with later phenology if accompanied by other pollinator-supporting practices.