To properly answer this question, we have to begin with the Russian jet incident in November 2015. Because it was one of the most important incidents in recent Turkısh history that proves Ankara is all alone in its fight in Syria.
Let's remember, after warning Moscow about the repeated Russian violations of its airspace, Turkey shot a Russian Su-24 down. I think what followed after this was enlightening for Ankara. First, a U.S. official speaking to Reuters said that Turkey shot down the jet over Syrian territory, contradicting Turkey's statements, sending a signal to Ankara that it shouldn't rely on Washington's support.
Then NATO allies started to release some interesting statements.
"NATO cannot allow itself to be pulled into a military escalation with Russia as a result of the recent tensions between Russia and Turkey," Luxembourg Foreign Minister Jean Asselborn told Der Spiegel last February.
"We are not going to pay the price for a war started by the Turks," said a German diplomat.
Next, American officials told various U.S. outlets that the Turkish response to Russian incursions was an overreaction. Senior Obama administration officials told Washington-based journalists that Turkey should de-escalate and instead both parties should focus on Daesh.
Of course, Russian sanctions that cost Turkey exports and Russian tourists put Ankara in a corner in the middle of a heated domestic arena. However, it was the U.S. partnership with the People's Protection Units (YPG) and their territorial overreach along the Syrian border that pushed Ankara to review its relations with Russia.
The Turkish government was finally able to convince the military that it needed to intervene in northern Syria to create a buffer zone that would remove Daesh from the border and prevent the YPG from connecting its cantons.
The failed coup in July further strengthened the Turkish government's oversight over the military, which severely opposed a planned Turkish intervention in the summer of 2015.
Without Russia's approval, due to its advanced air defense systems located in the west of the country and Russian air assets, Turkey wouldn't have been able to set foot in Syria. And there was, of course, no U.S. or NATO backing whatsoever. Finally Turkey did what it had to do to convince Moscow, and in return Turkey entered Jarablus, seized Dabiq and ended up in al-Bab.
Obviously, the Russians had other plans in mind. By aligning themselves with Turkey, they smoothly took over Aleppo, and re-deployed Assad regime forces to the south of al-Bab. Eventually the Assad regime with the backing of the Russian air force and special forces closed off Turkey's way to Raqqa.
A couple of weeks later, the Russians deployed troops in Manbij, a soft spot for the U.S.-backed alliance, and a tacit coordination with the coalition prevented Turkish forces from entering the town. Finally the Russians deployed forces in Afrin to train YPG forces, or safeguard them against Turkish attacks.
Russia is quietly enjoying and preferring the YPG-led Syrian Democratic Forces' (SDF) operations to capture several cities and territories. Better than the Turkey-backed Free Syrian Army (FSA) forces anyway, since holding those territories in the future would be a very painful problem for Russia.
Not surprisingly, everyone is aware of the fact that the YPG has been cooperating with both the Assad regime and the Russians since the beginning. Many scenarios in Washington that were speculated on by U.S. officials suggested that the U.S. wouldn't stay in Syria for a nation-building effort. Meaning, in a highly likely scenario, most of this territory would be left for the Assad regime.
Going back to the question asked in the title; Turkey needed Russia to remove Daesh from the border, and prevent a full scale YPG takeover near the Turkish border. Turkey has succeeded in its essential objectives.
However the recent Russian moves have also put Turkey in a rather stressful position. Let's face it. Turkey has almost no leverage against Moscow in Syria. Even when the Russians "mistakenly" killed some Turkish soldiers a few weeks ago, the Turkish government avoided escalating the situation. And now the Russians and Americans are coordinating their efforts, making sure that Turkey won't disrupt the Raqqa operation by distracting the YPG.
We are yet to see Turkey's response to all of this.