I don't know how it works for others, but I write in layers. In the initial draft, the main plotline consumes my attention: what happened and how did it happen, and of course, who did it and how is he/she caught. In a mystery, that's the Big Idea.
What follows that is a lot of rereading and editing. As I reread, I see how my characters think and appear to others (No, I don't always know that ahead of time). Once I "see" their personalities, I can fine tune their thoughts and behaviors. I can allow other characters to comment on them to define them. In other words, I introduce them to the readers and let them get acquainted.
Of course I "ideate" before beginning a story, picturing characters before I write them. I make a little biography of them so I have an idea of their personalities. But it is only in seeing them act in the plot that I find out what the reader needs to know about them. Does Bob the Assassin have a lot of free time between Crime 1 and Crime 2? What would he do to fill in the time? In his bio, I gave him only a minimal education. So putting his background together with what happens in the plot, I have to come up with a passtime that fits his profile. Not reading, probably. Okay. So the hotel clerk claims that someone called to complain that the guy in room 345 watched Spike TV at top volume all night long. That didn't come to me when I was concentrated on the story, but it works in nicely in a second reading, adding the image of a loner in a barely-occupied hotel room, watching WWF and waiting to kill again.
Maybe some writers can do both detail and general writing at once, but I can't. For me the details go in later: the senses other than sight are often neglected in the first draft, so I do a whole edit where I concentrate on nothing but making sure the readers get sound, smell, taste, and touch descriptions. Dialogue is another edit all its own: I check to be sure that each character sounds like him/herself and no one else, often reading it aloud. Still another trek through the MS assures that chapters are not too long or too short, and that each one ends with a teaser that makes the reader want to go on. Crafty, right?
So for me, plot is first, but that isn't all by a long shot. If you're writing and you get to "The End" once, good for you, because a lot of people never get that far. Just understand that you'll be revisiting that phrase many, many times before you've got it all together. There aren't many Mozarts among us who get it perfect the first time.