I define diplomacy as the art of protecting a polity’s interests. A polity is here a politically organized unit.
This unit has clearly established interests, like the protection of its territorial integrity.
Craft is the middle ground between art and science, and is grounded on experience.
In this respect diplomacy has a clear objective, to protect the polity’s interests, and a multitude of means. The means are determined on the go, as the threats to the polity’s interests develop and evolve.
Once the threats become substantial and large scale conflict is inevitable, diplomacy gives its position to armed conflict.