In 1889, Riley was elected to the New York State Assembly, representing the Rensselaer County 1st District. He served in the Assembly in 1890, 1891, and 1892. While in the Assembly, he introduced a number of bills related to canals, including one for the improvement of the Hudson River, another for widening of the Champlain Canal, another for the dredging of the Erie basin, and another for the restoration of locks on the Black River Canal and Erie Canal. He also proposed several bills related to prison labor, including one to prohibit employing state prisons of more than 100 men from making collars and cuffs, one on the employment of convicts on roads, and one for the branding of goods made in state prisons as prison-made.
