PurposeThe purpose of this study is to investigate the interaction between magnetotactic bacteria and Fe3O4–water nanofluid (NF) in a wavy enclosure in the presence of 2D natural convection flow.Design/methodology/approachUniform magnetic field (MF), Brownian and thermophoresis effects are also contemplated. The dimensionless, time-dependent equations are governed by stream function, vorticity, energy, nanoparticle concentration and number of bacteria. Radial basis function-based finite difference method for the space derivatives and the second-order backward differentiation formula for the time derivatives are performed. Numerical outputs in view of isolines as well as average Nusselt number, average Sherwood number and flux density of microorganisms are presented.FindingsConvective mass transfer rises if any of Lewis number, Peclet number, Rayleigh number, bioconvection Rayleigh number and Brownian motion parameter increases, and the flux density of microorganisms is an increasing function of Rayleigh number, bioconvection Rayleigh number, Peclet number, Brownian and thermophoresis parameters. The rise in buoyancy ratio parameter between 0.1 and 1 and the rise in Hartmann number between 0 and 50 reduce all outputs average Nusselt, average Sherwood numbers and flux density of microorganisms.Research limitations/implicationsThis study implies the importance of the presence of magnetotactic bacteria and magnetite nanoparticles inside a host fluid in view of heat transfer and fluid flow. The limitation is to check the efficiency on numerical aspect. Experimental observations would be more effective.Practical implicationsIn practical point of view, in a heat transfer and fluid flow system involving magnetite nanoparticles, the inclusion of magnetotactic bacteria and MF effect provide control over fluid flow and heat transfer.Social implicationsThis is a scientific study. However, this idea may be extended to sustainable energy or biofuel studies, too. This means that a better world may create better social environment between people.Originality/valueThe presence of magnetotactic bacteria inside a Fe3O4–water NF under the effect of a MF is a good controller on fluid flow and heat transfer. Since the magnetotactic bacteria is fed by nanoparticles Fe3O4 which has strong magnetic property, varying nanoparticle concentration and Brownian and thermophoresis effects are first considered.