A multicomponent reaction between H(2), CO, an unsaturated carboxylic acid derivative, and binucleophiles has been discovered. This process represents a combination of diversity-oriented synthesis and multicomponent reactions including amidation and hydroformylation, followed by nucleophilic addition to an N-acyliminium ion allowing the generation of six new bonds. Using pi-nucleophiles, the sequence turns into a multicomponent Pictet-Spengler reaction.