We analyse the Planck full-mission cosmic microwave background (CMB) temperature and E-mode polarization maps to obtain constraints on primordial non-Gaussianity (NG). We compare estimates obtained from separable template-fitting, binned, and modal bispectrum estimators, finding consistent values for the local, equilateral, and orthogonal bispectrum amplitudes. Our combined temperature and polarization analysis produces the following results: f_NL^local = -0.9 +\- 5.1; f_NL^equil = -26 +\- 47; and f_NL^ortho = - 38 +\- 24 (68%CL, statistical). These results include the low-multipole (4 <= l < 40) polarization data, not included in our previous analysis, pass an extensive battery of tests, and are stable with respect to our 2015 measurements. Polarization bispectra display a significant improvement in robustness; they can now be used independently to set NG constraints. We consider a large number of additional cases, e.g. scale-dependent feature and resonance bispectra, isocurvature primordial NG, and parity-breaking models, where we also place tight constraints but do not detect any signal. The non-primordial lensing bispectrum is detected with an improved significance compared to 2015, excluding the null hypothesis at 3.5 sigma. We present model-independent reconstructions and analyses of the CMB bispectrum. Our final constraint on the local trispectrum shape is g_NLl^local = (-5.8 +\-6.5) x 10^4 (68%CL, statistical), while constraints for other trispectra are also determined. We constrain the parameter space of different early-Universe scenarios, including general single-field models of inflation, multi-field and axion field parity-breaking models. Our results provide a high-precision test for structure-formation scenarios, in complete agreement with the basic picture of the LambdaCDM cosmology regarding the statistics of the initial conditions (abridged).