The former world number one trailed 3-1 and 5-3 before rallying with breaks of 66 and 121 to set up a last-frame decider.
The 2019 world champion took the final frame to win 6-5 and deny Snooker Shoot-Out champion Vafaei a chance to lift the the Ray Reardon trophy and admitted he had rode his luck against his Iranian opponent.
Trump, 32, told wst.tv: "I think he will be disappointed. He was the better player and his safety was brilliant. Every time I came to the table I seemed to be in trouble and his potting was better than mine.
"I don't know how I got through that one in the end. I just saved my best until last."
The 47-year-old Perry survived a scare of his own as he too won a final-frame decider to beat Jack Lisowski 6-5.
World number 42 Perry revealed he had battled a "bad headache" in his nail-biting semi-final success.
'The Gentleman' had led 3-0 and 4-2 before Lisowski staged a spirited fightback to draw level at 5-5 with a break of 123.
Perry missed a pink when on 28 in the decider but was given a reprieve and took advantage to win 6-5 and book a place in his sixth ranking final.
"It was the worst I've ever felt in a game of snooker," said Perry.
"I had a bad headache and I actually went to put my fingers down my throat when I went 4-2 up because I knew I had to do something as I couldn't see the edges of the balls and anything from six foot away was a complete guess."
He added: "It's a good job I got the start I did. If I play like I've done all week minus that game then I've got a chance."
Day six semi-final results:
Judd Trump 6-5 Hossein Vafaei
Jack Lisowski 5-6 Joe Perry
Day seven - Final (times GMT)
13:00 & 19:00: Judd Trump v Joe Perry