This sounds like execution/variable resolution scopes in programming languages. I wonder if there are ideas from programming languages you could pick up and use?
Yes exactly! A lot of our platform was inspired by programming languages - for loops, for each loops, custom variables, and environment variables in settings. If you have any more concepts, we'd love to hear them!