摘要:Context. To better understand the formation of high-mass stars, it is fundamental to investigate how matter accretes onto young massive stars, how it is ejected, and how all this differs from the low-mass case. The massive protocluster G31.41+0.31 is the ideal target to study all these processes because observations at millimeter and centimeter wavelengths have resolved the emission of the Main core into at least four massive dust continuum sources, named A, B, C, and D, within 1″ or 0.018 pc, and have identified signatures of infall and several outflows associated with the core. Aims. We study the interplay between infall and outflow in G31.41+0.31, at a spatial resolution of a few 100 au, by investigating their properties and their possible impact on the core. Methods. We carried out molecular line observations of typical high-density tracers, such as CH3CN or H2CO, and shock and outflow tracers, such as SiO, with ALMA at 1.4 mm that achieved an angular resolution of ~0.′′09 (~340 au). Results. The observations reveal inverse P Cygni profiles in CH3CN and H2CO toward the four sources embedded in the Main core, suggesting that all of them are undergoing collapse. The infall rates estimated from the redshifted absorption are on the order of ~10−2 M⊙ yr−1. The individual infall rates imply that the accretion timescale of the Main core is an order of magnitude smaller than its rotation timescale. This confirms that rotating toroids such as the G31 Main core are non-equilibrium, transient collapsing structures that need to be constantly replenished with fresh material from a large-scale reservoir. For sources B, C, and D the infall could be accelerating inside the sources, while for source A the presence of a second emission component complicates the interpretation. The SiO observations have revealed the presence of at least six outflows in the G31.41+0.31 star-forming region, and suggest that each of the four sources embedded in the Main core drives a molecular outflow. The outflow rates are on the order of ~10−5–10−4 M⊙ yr−1, depending on the SiO abundance. The feedback of the outflows appears sufficient to sustain the turbulence in the core and to eventually disrupt the core or prevent its further collapse. The mass accretion rates onto the individual sources, estimated from the highest values of the outflow mass loss rates, are on the order of 10−4 M⊙ yr−1. The difference of about two orders of magnitude between the accretion rates and the infall rates suggests that the central stars and the jets and outflows might not be efficient in removing disk material, which could lead to gravitational instabilities, fragmentation of the disk, and episodic accretion events. Conclusions. Infall and outflows are simultaneously present in all four sources embedded in the high-mass star-forming core G31.41+0.31. This indicates that these sources are still actively accreting and have not reached their final mass yet, which confirms the youth of this massive core.