But that looked some way off as Townsend's men led 16-3 at half-time thanks Corey Flynn's try and the boot of Finn Russell.
However, the Dragons came storming back and found themselves one point ahead following quick-fire tries from Sam Hobbs and Jack Dixon.
The home side's lead was short lived as Alex Allan went over at the other end and Russell added a late penalty to seal a 26-17 victory and put a smile back on Townsend's face.
"I'm delighted for the players, they have put in a lot of effort over the past two or three weeks with no reward and they'll feel better on the journey home," Townsend said.
"In the first half we really stamped our authority on the game. Maybe we missed a couple of opportunities to take points in the opposition 22 and then we had to deal with that yellow card, but I was pleased going into half-time.
"The next 15 minutes wasn't so good and we allowed the Dragons back into the game.
"But the final quarter was much better as we worked hard to get back in front then push to increase our lead. Our set piece work was really disciplined and the line-out and scrum functioned really well.
"The team have shown their character time and time again. Last week against Ulster was a really good example and this game we had to dig deep with players who hadn't played much for us in recent weeks, with a couple more players making their debuts, and a few others coming back from injury.
"It was really pleasing but there is a lot to work on. Possession and territory won us the first-half but we have to be more clinical when we get close to the opposition try line."
Guinness PRO12 Final 2017 Ticket Information: Fans can save up to 20% on selected tickets, and prices start at just €30 adults and €5 child, and be booked via www.ticketmaster.ie. For further information visit http://www.pro12rugby.com/final