The military victories of the Islamic state in Syria worry Iran. All the more so as neither Turkey (focused on the Kurds) nor Saudi Arabia (stuck in Yemen) seem to be really bothered by the western extension of Daesh. The modification of the military situation has spawned a diplomatic ballet that can be analyzed in the following terms.
On the one side, Russian diplomats, led by Sergey Lavrov, and Iranians, conducted by Javad Zarif, try to find a political solution that would safeguard Bachar-al-Assad's sovereignty while reducing the role of the Hezbollah. This inflection has been prepared for several months. It can be explained by the losses suffered by the Guardians of the Islamic revolution in Syria and the existing tensions with the Syrian General Staff.
Russians and Iranians are willing to make concessions but of course not as far as to accept that the Syrian citadel -- last bulwark against the Islamic state before the contagion to Lebanon -- falls. Positive consequence of the nuclear deal with Iran, discreet diplomatic contacts with Israel have been made. The aim would be to find a solution preserving relative peace at the gates of Israel.
On the other side, Saudi Arabia and Turkey want to take advantage of the weakening of Bachar Al-Assad in order to divide its territory into two zones of influence. They are even prepared to rely on the Islamic state to reach their ends. Even though every country pursues its own objectives (the struggle against the Kurds for Turkey or the religious standardization of Syria for Saudi Arabia) they have to cooperate. As far as the American diplomacy is concerned, the rebalancing on Iran's side allows it for the first time, to play the role of referee, and therefore to exist. The condition is of course that Washington guidelines be not too contradictory. On the Israeli side, a too weakened Bashar al-Assad regime would represent a threat for the security of the Hebrew state.
These power struggles naturally bring about tensions, for example incidents on the Iran-Turkey border. These tensions are all the more important as the Christian communities, which play a fundamental role in safeguarding peace in the Middle East, are systematically eliminated. From this point of view, if a diplomatic solution fails in Syria, we should expect an unprecedented upsurge of violence.