A sizeable level of non-Gaussianity in the primordial cosmological perturbations may be induced by a large trispectrum, i.e. by a large connected four-point correlation function. We compute the effect of a primordial non-Gaussian trispectrum on the halo mass function, within excursion set theory. We use the formalism that we have developed in a previous series of papers and which allows us to take into account the fact that, in the presence of non-Gaussianity, the stochastic evolution of the smoothed density field, as a function of the smoothing scale, is non-markovian. In the large mass limit, the leading-order term that we find agrees with the leading-order term of the results found in the literature using a more heuristic Press-Schecther (PS)-type approach. Our approach however also allows us to evaluate consistently the subleading terms, which depend not only on the four-point cumulant but also on derivatives of the four-point correlator, and which cannot be obtained within non-Gaussian extensions of PS theory. We perform explicitly the computation up to next-to-leading order.