I've given a bit of thought to these periods and the theme in them has a few factors that indicate one general one.
First factor was reading a book that changed my perspective. When I was a consultant, simply spending 5hrs reading a book on negotiation returned an additional 200k over the next 36mos.
Second is the time I took all my vacation at once and spent three weeks with a teacher learning a physical skill. It gave me the confidence to level up massively in my career.
Third was after taking a month long motorcycle trip across the US. I developed multiple decks and wireframes for startups I would return to and make the focus of my life today.
The theme in them was interrupting the nagging chatter of my ego and its anxieties and the need for external approval, which came from unstable relationships and social media (same thing).
The result was periods of pure performance where stuff comes out like you are singing it. The way I get into the zone today is to do something that pushes me past a limit of ego/anxiety resistance. Either by getting coaching and instruction, becoming absorbed in the complex ideas of a book or new area of knowledge, or physical accomplishment.
There was a comment here the other day about junior and intermediate programmers completing the fist %80 of a project, then leaving the remaining %20 to the next person - who recommends chucking it and refactoring, only to complete that initial %80 again.That %80 productivity that comes from learning something new is massive, but it's not sufficient to deliver the polished %20 that makes a product.
The zone for me today is bursts of staccato productivity against that last %20, with a view forward against where it will yield diminishing returns.
As a manager, the very best way to wreck flow is to put choices on staff and then criticize them for the results. There is this anti-pattern (I call it a false-Socratic dialogue) where ostensibly intelligent people present their staff with choices, thinking it's educating them to "choose right," when the overall effect is to just punish them randomly for making independent decisions.
The constant theme in 10x developers I have observed is that they don't internalize interruptions from others. Often this is because they miss or ignore the social cues of concern and approval that derail others flow, either because of a spectrum thing, confidence from better options, or the narcissism that helps some people succeed.
The flow I develop through these other factors is related to that state in that the anxiety from uncertainty in how I relate is silenced, and I can create freely. As a result, the last 4 months on my demo have been immensely productive.