Tracing the physical and astrochemical assembly of planetary systems in the far-infrared at high angular resolution