Herrera, 20, went 8-7 with a 4.08 ERA in 26 combined starts between High-A Lake Elsinore and Double-A San Antonio in the Padres organization last season. Herrera owns a 23-24 record with a 3.79 ERA in 82 career games over four minor league seasons.
Pirela, 25, hit .230 with one homer and five RBI in 37 games played with the Yankees in 2015. He missed one month on the concussion disabled list after a collision in spring training. In 64 combined minor league games with High-A Tampa, Double-A Trenton and Triple-A Scranton/Wilkes-Barre, he hit .310 with three homers and 23 RBI.
The Yankees currently have 38 players on their 40-man roster.