In 1968, on a trip to his native India, Alagappa Alagappan dreamed that an ancient Hindu god told him to visit a medium. So he did, and on his first visit the medium read palm leaves to tell him that the Lord Ganesha — another deity, this one beloved for his laugh and his elephant head — wanted to settle in a city beginning with the letter N.

On the medium’s instruction, by his account, Mr. Alagappan returned the next day, and he learned that Ganesha had asked for more: He wanted temples to be established throughout North America. On the third day, the medium told Mr. Alagappan that it was his job to arrange that. So he did.

By the time of his death, on Oct. 24 at the age of 88, Mr. Alagappan, a retired United Nations official who lived in Queens, had become “the father of the temple-building movement in North America,” as a Hindu leader in Texas wrote in an email to Mr. Alagappan’s family.

His work began in the wake of a landmark change in American immigration law in Congress in 1965: the replacement of a national-origins quota system, which had been in place since the 1920s, with a preference system, which favored immigrants with skills or with relatives in the United States.