Lenin and Trotsky were entirely involved in the events of October 1917, particularly if those events were classified as a coup and not a revolution. Trotsky was a leading "organizer on the ground," while Lenin was the undisputed leader and essence of the Bolshevik Party.
To understand how Russian revolutionaries related to major unrest in Imperial Russia, it's worth noting how things had unfolded in prior events.
Russian revolutionaries tended to be out of touch with initial uprisings. The typical peasant revolts of old times generally had no political aims, and the unrest of the universities and even the lead-up of the revolution of 1905 were pedantic in nature: society began to snap at certain hot-button yet confined issues, for example, food strikes or university students wanting to get the police to loosen up on them.
The revolutionaries pulled a lot of theory from German idealists, which arguably did not help them much. German idealism and philosophy, such as that of Marx and others, of the late 1800s was esoteric and convoluted. The main effect was that as their theories ran like a rabbit through the woods, any listener would eventually hear what they wanted to hear to confirm their own beliefs. To the Russian revolutionaries, they took away some bits of theory of political revolution that would never occur in Russia. Their efforts to stoke a peasant uprising on these theories in the 1870s fell flat on its face because of this disconnect. When an uprising would occur, such as the 1899 university strikes, the revolutionaries would at first sit on the benches and play down the event because it was not in accordance with their German-derived doctrine. When the uprising showed signs of serious traction, they would then leap into action, try to wrest control of it (usually by setting up a leadership committee in the epicenter) and try to attach grand political aims to the movement. Usually these grand political aims, like overthrowing the monarchy, would alienate the masses involved and leave the revolutionaries stuck between a rock: the slow and ham-fisted government, and a hard place: an obstinate populace.
Thus the revolutionaries, including Lenin's Bolshevik Party - a party that he built and cast his entire life into - "missed" the Revolution of February 1917. In that case, the stresses of the war combined with a government that was completely out of touch with realities on the street came to a head due to weather: the winter had been unusually cold and food supplies dwindled, but a warm snap in February allowed everyone to turn out and vent their frustrations. Food strikes rapidly flared up and led to a serious rebellion among the troops (the troops being recent drafts who cared more about their grievances from their peasant days than being soldiers in the present). The Tsar's government was paralyzed against the mass rebellion and resigned.
Note that in February, Lenin was in Zurich. His diary of that winter showed frenetic yet unfocused efforts: pamphlet publishing, intriguing against the Swiss SD's, and studying Marx and Engels. He did not know of the seriousness of the revolution until the Duma had assumed power. He frantically plotted to return to Russia, and in the mean time sent cables to his associates in Russia with orders: Lenin was fearful that his colleagues would negotiate or find an agreement with the new government.
Following the abdication of the Tsar and during the days of the Provisional Government, a power vacuum formed that Lenin was desperate to seize. His initial strategy, from April to July, was to take to the streets with armed force and emulate in deed (but not in spirit) the events of February. This effort did not succeed and the Bolshevik Party almost collapsed in July. Going back to the drawing board, a more insidious plan was developed from August that put on a facade of hosting the Congress of Soviets (the bait), while focusing on a plan to have the party's armed wing seize certain centers of power by force (the coup). The facade of seeking to transfer power to the soviets was more of Trotsky's project.
Trotsky was an ideal complement to Lenin. Brighter and more
flamboyant, a much better speaker and writer, he could galvanize
crowds: Lenin's charisma was limited to his followers. But Trotsky
was unpopular with the Bolshevik cadres, in part [...] because he was
unbearably arrogant. [..] During the Revolution and Civil War he was
Lenin's alter ego, an indispensable companion in arms: after victory
had been won, he became an embarrassment.
- Pipes, The Russian Revolution, pg 439.
Trotsky's skill as a public whip began to place the Provisional Government - seriously weakened after the Kornilov Affair - on the horns of a dilemma with the upcoming Congress of Soviets. The strategy was expressed by Trotsky:
In essence, our strategy was offensive. We prepared to assault the
government, but our agitation rested on the claim that the
[government] was getting ready to disperse the Congress of Soviets and
it was necessary mercilessly to repulse him.
- Pipes, The Russian Revolution, pg 485.
The coup itself was exemplified by events of the night of October 24:
That night , the Bolsheviks systematically took over all the
objectives of strategic importance by the simple device of posting
pickets: it was a model modern coup d'etat as described by Malaparte.
Iunker guards were told to go home: they either withdrew voluntarily or
were disarmed. Thus, under cover of darkness, one by one, railroad
stations, post offices, telephone centers, banks, and bridges fell
under Bolshevik control. No resistance was encountered, no shots
- Pipes, The Russian Revolution, pg 491.
For Lenin's part, he is given credit because the Bolshevik Party was his and he was the Party. His life was so entwined with it that little material exists of who Lenin the Person was. However, he was not directly front and center during the coup: the disaster of July caused him to go into hiding and to make no public appearances until late October. While in "seclusion" he issued orders from afar but was also lagging in responding to events while being alone and designing the world to his liking - a typical position for Lenin throughout his life. However, his enormous force of will drove the party forward, as Lenin was almost alone in the Central Committee for his extreme stance and goal - yet it was achieved. During October 24-25, Lenin spent the time in disguise and making furtive movements. Shortly after, he was almost forced to take the chair of the new proto-government Sovnarkom.
In conclusion, Trotsky was responsible for "public agitation" and for running the "legitimate face" of the coup: pitting the Congress of Soviets against the government. Lenin lashed the party - often from a distance - for extreme goals and put out strategy that was often hit-and-miss with real events.
Coups are by definition events that can be placed at the feet of certain names and faces, and in this case Trotsky and Lenin were responsible.
This answer is a digest that is sourced from:
Pipes, Richard. The Russian Revolution. Vintage Books, 1990.
Pipes, Richard. Russia under the Old Regime. Penguin Books, 1995.