Abstract Simplification of agricultural environments is linked to declines in biodiversity. Improving the floral diversity within and around these areas may result in more robust and diverse ecosystems. We investigated how floral resource abundance, diversity, and species composition in a cranberry agricultural system correlated to the abundance and overall invertebrate diversity and to the abundance and diversity of specific invertebrate groups of agricultural importance (e.g. parasitoids, phytophagous taxa, pollinators and predators). This study focused on habitats immediately surrounding cranberry production and included grassy dikes under a managed system (‘dike’), and semi‐natural areas growing on the surrounding support land (‘semi‐natural’). Floral resource availability and diversity tended to be similar between habitats, while invertebrate richness, diversity and composition differed. As the availability of floral resources increased, invertebrate abundance increased but diversity decreased. Overall invertebrate community composition differed with the specific species and availability of floral resources. The habitat type and floral resource composition impacted some agriculturally important groups, as pollinator abundance was higher in the semi‐natural habitat, and parasitoid abundance varied with floral resource composition across both habitats. These results suggest that managing the structural and floral resource diversity associated with agroecosystems can help support local biodiversity. However, these systems may disproportionately benefit more common taxonomic groups. The difference in responses of individual taxonomic groups also highlights the potential tradeoffs of focusing on only a subset of biodiversity aspects.