From Graham Greene’s The End of the Affair (quoted by Rachel Toor in her Chronicle of Higher Ed piece on the habits of productive writers):

“I was trying to write a book that simply would not come. I did my daily five hundred words, but the characters never began to live. So much in writing depends on the superficiality of one’s days. One may be preoccupied with shopping and income tax returns and chance conversations, but the stream of the unconscious continues to flow, undisturbed, solving problems, planning ahead: one sits down sterile and dispirited at the desk, and suddenly the words come as though from the air: the situations that seemed blocked in a hopeless impasse move forward: the work has been done while one slept or shopped or talked with friends.”

Absolutely– but there are some activities during which “the stream of the unconscious continues to flow” more easily, and others in which it gets bottled up. This is the difference between deliberate rest and ordinary rest.