In what part of the writing process does a writer decide on a topic

The decision on a topic typically occurs during the prewriting or planning stage of the writing process. This is when a writer brainstorms ideas, conducts research, and ultimately selects a topic that is of interest to them and aligns with the purpose of their writing. Once the topic is chosen, the writer can then move on to developing an outline, organizing their thoughts, and ultimately writing their piece.