Inspiration more often comes during the work than before it, because the largest part of the job of an artist is to listen to the work.
Inspiration does not always precede the act of writing; it often follows it.
I know writers who write only when inspiration comes. How would Isaac Stern play if he played the violin only when he felt like it? He would be lousy.