Tries from Cammy Taylor and Frazier Climo with the stand-off converting both scores and adding three penalties saw Ayr through to the final where they will take on Melrose.
The result was in doubt until injury time when Glasgow Warriors’ target Climo jinked through the tiring Heriot’s defence to secure the win.
In the Shield National Two champions Greenock Wanderers added a Murrayfield final spot to their fine season after a 30-16 win over Dalziel at Fort Matilda. The Wanderers take on Lasswade in April’s final.
At Old Anniesland Glasgow Hawks ran out 33-22 winners over Watsonians securing a bonus point in the process.
The home tries came from Mat Whittleston, Robbie Hair, Marc Taylor, John MacLay and Gavin MacDonald with Andy White adding the rest with the boot.