The candle went out the moment the wind blew in.

Literal

Wind [subject-が] blew-in moment candle [subject-が] went-out.

吹き込んだとたんに means 'the instant the wind blew in.' ~とたんに marks an instantaneous consequence: the moment X happened, Y occurred. ロウソクが消えた means 'the candle went out.'