Built-in flow stack variable
Posted: 29 Nov 2018 07:09
My main automagic use is to handle home/personal automation tasks like acting on voice commands, speaking aloud reminders/info, turning on/off things, and accessing the net for news/weather/misc info.
To achieve this I use a couple dozen flows (along with a python backend server). Most of the flows call other flows. Sometimes 3+ levels deep.
To handle error conditions (e.g. a target device isn't responding to a http get command) I have a generic "Ooops, an error occurred" flow that says (aloud) what flow caused the error. The Ooops flow gets called from the flow where the error occurred. To know which flow this was, I set a global variable (e.g. global_prev_flow) in every flow where I might end up calling the Ooops flow.
Having to set the global variable in each flow works, but it's a bit tedious and I wonder if I've missed a more obvious/elegant way to do this?
Also... I wonder whether there's already an internal flow stack/list that could be exposed as a builtin variable (hi Martin) which could be more readily available for use?
I just noticed there's a previous topic (viewtopic.php?f=4&t=3793) that seems to be onto the same thing.
To achieve this I use a couple dozen flows (along with a python backend server). Most of the flows call other flows. Sometimes 3+ levels deep.
To handle error conditions (e.g. a target device isn't responding to a http get command) I have a generic "Ooops, an error occurred" flow that says (aloud) what flow caused the error. The Ooops flow gets called from the flow where the error occurred. To know which flow this was, I set a global variable (e.g. global_prev_flow) in every flow where I might end up calling the Ooops flow.
Having to set the global variable in each flow works, but it's a bit tedious and I wonder if I've missed a more obvious/elegant way to do this?
Also... I wonder whether there's already an internal flow stack/list that could be exposed as a builtin variable (hi Martin) which could be more readily available for use?
I just noticed there's a previous topic (viewtopic.php?f=4&t=3793) that seems to be onto the same thing.