Unique three-component self-assembly of a cis-blocked 90° Pd(II) acceptor with a mixture of tri- and tetra-imidazole donors led to the self-sorting of a Pd7 molecular boat with an internal nanocavity, which catalyses the Knoevenagel condensation of a series of aromatic aldehydes with 1,3-dimethylbarbituric acid and Meldrum's acid in aqueous media.