  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 by investigating at a
spatial resolution of a few 100 au 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 have revealed 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
red-shifted absorption are on the order of 1E-2 Msun/yr. 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, ...
