Palladium atoms deposited by vapor deposition on a template of nalkane molecules on a Au(111) surface exhibit strongly anisotropic growth. In the initial stage, a Pd nanorod is grown with its length regulated by the chain length of the template molecule. Nanorod formation and subsequent anisotropic cluster growth are induced by interactions between the Pd atoms and unsaturated bonds created by the dehydrogenation of the n-alkane. Dehydrogenation is catalyzed by the deposited Pd atoms, which produce Pd trap sites. Dehydrogenation is confirmed by the change in the X-ray absorption fine structure spectra at the near carbon K-edge (C K-NEXAFS). The electronic states of the Pd clusters are considerably confined, which show d-band narrowing as observed in the Pd L3-NEXAFS spectra.