Balancing Structure and Creative Chaos

I’m a creative person, and inspiration often hits me at the weirdest times. How do you stay productive with a routine while still making room for those random bursts of creativity?