The Russian Revolution didn't happen overnight. The Bolsheviks had been getting their ducks in a row for years before 1917, infiltrating the institutions in Russia, waiting for the right opportunity to strike.
They tried. And the Russian secret police were trying to root them out.
As you know, the top leadership was in Switzerland and were permitted passage by the Germans.