It was Flannery's first appearence in the AIB League since October 2005 - but as they advert goes, behind every great player there is a great club.
Shannon got their title defence back on track with a bonus point win thanks to a five try haul.
A messy UCD lineout led to prop Tony Buckley barreling over for Shannon's opening try which out-half Tadhg Bennett converted.
Just five minutes later, the Shannon backs combined with two 'skip' moves together to set full-back Mossie Lawlor into space and he drew two defenders to send winger Stephen Kelly over for a well worked score.
UCD, with Ireland Under-21 back-row Sean O'Brien putting in a fine performance, pulled eight points back when out half Ian Keatley slipped through a midfield gap for his try and centre Fergus McFadden landed a penalty.
Just before the interval, prop Les Hogan started the move that led to the home side's third try.
Left winger Finn linked with him before the ball was hacked on and a poor clearance allowed Shannon number 13 Clogan the time and space to dive over.
UCD started the second half brightly and put themselves back in the game with 43rd-minute try from prop Brian McGovern.
Flannery was sprung from the bench for the second period and did enough, despite seeking treatment at one stage for a hamstring injury, to suggest that he could play some part in next Sunday's Six Nations opener against Wales.
Late in the game a sustained spell of pressure saw Shannon recycle the ball through 12 phases, with Flannery to the fore, and ended with Andrew Finn scoring his side's fourth try.
Replacement Andrew Thompson converted and then added the extras to lock Fergal Walsh's effort, two minutes into injury-time. Shannon, a point behind Clontarf, are in fifth place just outside the top four playoff places.