Omega Pharma Quick-Step rider Cavendish had the platform laid for him by his team-mates on the first ride from Peebles to Drumlanrig Castle but was boxed in and slipped off fellow OP man Alessandro Petacchi, who went it alone to follow Viviani across the line.
Sojasun’s Anthony Delapace had looked to go it alone with a breakaway with just over 40 kilometres of the 209.9k left but he was pulled back and Viviani took advantage.
It was a disappointment for Cavendish on a day in which the riders were given the full delights of the inclement Scottish weather, and he was not alone in failing to give the British fans something to cheer about.
Alex Dowsett (Movistar) made an attack that bore no fruit, although Sir Bradley Wiggins is likely to feel satisfied after crossing nine seconds off the pace for Team Sky.
In fact, surviving a crash 200 metres from the end may well have been of greater pleasure to Wiggins, with the rest of his team-mates just a second behind him in the peloton.
Cavendish was grouped in with the rest come the end, with Viviani timed as being four seconds quicker than Petacchi.
Today’s second stage takes the riders around the Lake District as they start in Carlisle and finish in Kendal.
In the wake of the finish, Wiggins’ team-mate Ian Stannard admitted there had been a conscious effort to keep the 2012 Tour de France winner out of trouble. “It was a long old day today and the conditions meant it was pretty hard work as well,” Stannard told Team Sky’s official website.
“We were riding into a headwind for most of the stage, which meant it was a slow average speed, but the weather improved as the day wore on and the sprinters were able to put on a show for the fans who turned out to see us at the castle.
“For us it was all about protecting Bradley, especially on that tight finishing circuit. Bernie [Eisel] deserves a mention because he controlled the pace for most of the day before [Mat] Hayman took over at the end.
“All in all I think we did a really good job and it was nice to see Brad pick up a bonus second as well.”