Saturday's 17-15 defeat to Leinster was particularly hard to take because Glasgow had the chances to put themselves into the RaboDirect PRO12 final - which will take place on May 25 at the RDS.
Stuart Hogg missed a late conversion which would have levelled the scores, but despite the disappointment, Townsend urged his troops to take the positives from a much-improved season.
"Elite sport is all about fine margins and we came so very close to creating a bit of history and pulling off what would have been a tremendous victory over Leinster on their soil," he told the Glasgow Evening Times.
"But although we are bitterly disappointed to have lost, we will learn from this and come back all the stronger.
"I felt that Leinster's greater experience in really big games just shaded it for them and earned them some penalties that kept them in front.
"But I can't fault the level of effort we got from the guys. It was absolutely immense and to be still playing the quality of high-tempo, off-loading rugby as we were going into the final-quarter was fantastic.
"We knew it would take something special to beat Leinster at the RDS to make the final and we came so close. But we will be back.
"We can't allow that to go to waste and we must use it as motivation next time around. But there were things we will have to learn from this game.
"When we come back we will make sure we build on this."