It depends on a few things. Such as, are you recording everything yourself, that is, are you playing all the instruments ? How 'complete' is the song that you are about to record ? In what way does it flow from section to section ? If you're walking about can you hum or sing the song all the way through ? If other players are playing on it with you, is there space and freedom to go in unforseen directions ? Or are you definite and prescriptive about how you want the song to go ? Incidentally, I see both the improvisational and the rigid as strengths. Different strengths, either can be lousy and not work. It depends on the song. I have many songs that did not adhere to my original structure but turned out better. If not, I've just redone them. Also there's many that stuck fairly rigidly to the way I conceived it. Also, many occurred in jams where I wasn't thinking about writing a song but listening to the tape after, realized a song could be made. And the hard bit was getting the drums to repeat because if you're not recording or playing live, you may do things in a jam that you might not do otherwise and forget how it was done.
But I digress.
Even when I dealt exclusively in tape I was notorious for adding to songs, usually at the start or end because no way was I going to cut tape, but now I record digitally, I'm even worse ! I may have tracked a song and it's finished but then I get an idea and can add it wherever I like, providing there's no cymbal spill because it would sound artificial for the cymbal to finish so abruptly. But basically, I always know how the song goes before I start to record. I record the basics in one of four formats ~ bass/drums, guitar/drums, guitar/percussion {usually congas, bongos, djembe or some frame drum or skin drum} or bass/percussion. Much of the energy is set when my friends and I do this bit and it's here that unforseen directions may be charted. Once this part is done, there may be a little editing here and there but by and large this is the basis and everything is built on this. However the overdubs happen to fall is how they fall.
On very rare occasions, I may start off with just the acoustic guitar and the drums come in later. It differs from song to song.
What has been said by others is really good stuff and you will get used to it and soon it'll become second nature. It's part of the fun of recording and navigating your way towards a finished creation.
This may yield some answers.