part 1: The immediate cause of World War I that made the aforementioned items come into play (alliances, imperialism, militarism, nationalism) was the assassination of Archduke Franz Ferdinand of Austria-Hungary. In June 1914, a Serbian-nationalist terrorist group called the Black Hand sent groups to assassinate the Archduke.
In my opinion what was the most important for provocking global conflict was assassination of Archduke Franz Ferdinand of Austria-Hungary.
hope it helps