Forecasting eruption is the ultimate challenge for volcanology. While there has been some success in forecasting eruptions hours to days beforehand, reliable forecasting on a longer timescale remains elusive. Here we show that magma inflow rate, derived from surface deformation, is an indicator of the probability of magma transfer towards the surface, and thus eruption, for basaltic calderas. Inflow rates ≥0.1 km3 yr−1 promote magma propagation and eruption within 1 year in all assessed case studies, whereas rates <0.01 km3 yr−1 do not lead to magma propagation in 89% of cases. We explain these behaviours with a viscoelastic model where the relaxation timescale controls whether the critical overpressure for dyke propagation is reached or not. Therefore, while surface deformation alone is a weak precursor of eruption, estimating magma inflow rates at basaltic calderas provides improved forecasting, substantially enhancing our capacity of forecasting weeks to months ahead of a possible eruption.