  We study the link between gas flow events and key galaxy scaling relations:
the relations between star formation rate (SFR) and stellar mass (the main
sequence, MS), gas metallicity and stellar mass (the mass-metallicity relation,
MZR) and gas metallicity, stellar mass and SFR (the fundamental metallicity
relation, FMR). Using all star-forming galaxies (SFGs) in the 22 MUSE fields of
the MusE GAs FLOw and Wind (MEGAFLOW) survey, we derive the MS, MZR and FMR
scaling relations for 385 SFGs with $M = 10^8 - 10^{11.5}$ $M_\odot$ at
redshifts 0.35 < z < 0.85. Using the MUSE data and complementary X-Shooter
spectra at 0.85 < z < 1.4, we determine the locations of 21 SFGs associated
with inflowing or outflowing circumgalactic gas (i.e. with strong MgII
absorption in background quasar spectra) relative to these scaling relations.
Compared to a control sample of galaxies without gas flows (i.e., without MgII
absorption within 70 kpc of the quasar), SFGs with inflow events (i.e., MgII
absorption along the major axis) are preferentially located above the MS, while
SFGs with ouflow events (i.e., MgII absorption along the minor axis) are
preferentially more metal rich. Our observations support the scenario in which
gas accretion increases the SFR while diluting the metal content and where
circumgalactic outflows are found in more metal-rich galaxies.
