In the aftermath of Nicola Sturgeon’s abrupt resignation as first minister and SNP leader, it was clear the party had no obvious successor.
The leadership vacuum prompted a bitterly fought leadership contest, with Humza Yousaf emerging as the party’s reluctant continuity choice to replace Ms Sturgeon.
But even among some of his allies, there was concern shared privately about Mr Yousaf’s suitability for the top job.
“We weren’t prepared,” one insider told me following the contest, “It would have turned out differently if we were.”
While Mr Yousaf may have secured Bute House, the struggles inside the SNP, more divided than it has ever been in recent memory, mean his long-term position is far from assured.
And after a string of internal wins, including the ousting of his predecessor as leader of the SNP’s Westminster group, it seems Aberdeen South MP Stephen Flynn has emerged the real winner of the race to succeed Nicola Sturgeon.
Mr Flynn – who hails from Dundee where his father Mark is a councillor for Coldside – is credited with the most significant policy changes inside the SNP since Nicola Sturgeon stood down.
While the first minister has largely continued the legacy of his predecessor, he and Mr Flynn have adopted a different tack when it comes to oil and gas policy and the SNP’s relationship with business.
Insiders say Mr Flynn played a crucial role on both fronts, particularly in opposing a windfall tax on the profits of oil and gas companies.
Stephen Flynn credited with major policy changes crucial to election success
Acutely aware of the strength of feeling in the north-east, where the SNP have long fought to win support, the party has said it does not support extending the levy – a tax Nicola Sturgeon and Ian Blackford strongly advocated introducing.
And it is a move that proved to have some foresight.
In the face of dire warnings the extension could cost tens of thousands of jobs, and strong opposition from Scottish Conservative leader Douglas Ross, Chancellor Jeremy Hunt announced on Wednesday the tax would be extended.
It left the Scottish Conservatives, who the SNP will fight for a handful of north-east seats at the General Election, reeling.
Even though they are in coalition with the Greens at Holyrood and support an end to oil exploration, it allows the SNP to go into the election as the “friends” of the oil and gas sector, equipped with a ream of easy attack lines against the Conservatives.
As well as finding comfortable ground to accuse Westminster of using Scotland’s resources to finance the UK budget, they will also be able to appeal to independence-sceptics who are fearful of the move net zero and the impact on the north-east.
No surprise then that those inside the party who have one eye on the future, particularly if the SNP suffer a bruising set of results in the General Election, are looking to Mr Flynn as a potential leader and future first minister.
One SNP source in Edinburgh pointed out that most off all, members want to win elections and secure independence.
They said: “Stephen has some of the traits that made both Alex Salmond and Nicola Sturgeon hugely successful.
“He isn’t afraid of taking decisions, even if its means being ruthless. Party members want to win and that has been noticed.
“We weren’t prepared when Nicola Sturgeon stood down, there was no replacement, but Stephen has come forward as the clear choice if there’s another sudden vacancy.”
Fergus Mutch, the SNP’s former communications boss, told me: “Politics is a popularity contest, you have to be electable among your peers to get into leadership positions.
“But you need to have that ruthless streak. It has been a hallmark of successful SNP leaders in recent years, Alex Salmond and Nicola Sturgeon, in that they’ve known exactly what they wanted and how to get it.
“Maybe the big tests on that for Stephen are still to come.”
Mr Mutch also credits Mr Flynn’s popularity with his success in Westminster, both inside the chamber and out.
“Stephen has brought a really refreshing, pragmatic focus to the activities of the [SNP] at Westminster.
“It dovetails quite nicely with an eagerness in the Scottish Government to get back on a pro-business footing.
“He’s been successful. He’s punchy at Prime Minister’s Question, week-in-week-out, and capable of landing the blow and getting under the government’s skin, and a huge part of it is the showmanship.
“But also in terms of what he’s doing behind the scenes to keep a Westminster group that had a bit of division within its ranks more closely together working as team.
Conversation