Considerable uncertainties exist on how increased biofuel cropping affects biodiversity. Regarding oilseed rape, the most common biofuel crop in the EU, positive responses of flower-visiting insects to plentiful nectar and pollen seem apparent. However, previous investigations on this insect guild revealed conflicting results, potentially because they focused on different taxonomic groups representing a narrow range of ecological traits and considered only short time periods. Here, using trap nests in landscapes with independent gradients in area of oilseed rape and seminatural habitats, we assessed the whole community of cavity-nesting bees and wasps, including early- and late-emerging species. Our study's temporal resolution allowed determination of flowering and postflowering effects of oilseed rape on these species' richness, abundance, and mortality. Species richness of cavity-nesting bees and wasps significantly increased with oilseed rape, although nesting activity was considerably higher after mass flowering. In addition to increasing richness independently of oilseed rape, the amount of seminatural habitat in the landscape was the sole positive driver of insect abundance once the community's dominant species was accounted for as a covariate. Thus, growth of the co-occurring species' community is not stimulated by the resource pulse provided by oilseed rape early in the year, but by persistent resources provided by seminatural habitats after mass flowering. Early individuals of bivoltine species' first generations accumulated in seminatural habitats when these habitats were scarce, but became increasingly diluted when habitat availability increased. Once established, later foraging females generally benefited from the resource availability of seminatural habitats when initializing the second generation. We conclude that mass-flowering crops, despite covering only a short interval of the community's main activity phase, benefit bee and wasp species richness. However, seminatural habitats are crucial in maintaining viable communities of flower-visiting insects at the landscape scale, mitigating potential negative effects of high land-use intensities in modern agro-ecosystems.