Feature Request: have the Take Vars When Available block's No path run a subroutine
This sounds like a big feature ask, and perhaps a limited use case, so I doubt it will be a priority, let alone even considered, but I'm going to give it a shot anyway! 😄
I frequently have a use case where when I'm doing a task with Automate, I need to have prep and cleanup actions before and after the task. The task is triggered by calls to a waiting Take Vars block. If there are multiple queued up calls to Take Vars, this prep/cleanup only needs to be done once for a batch of such consecutive data. In other words, do a prep once before new data enters an empty queue, and then do a cleanup just once after a batch of calls have been processed and the queue becomes empty again.
Now, of course I could run the prep and cleanup with EACH individual execution of Take Vars. However, this is rather quite inefficient. Would rather want to do the cleanup only once when the queue becomes empty. But of course, when the queue becomes empty, the fiber will just pause on the Take Vars block, and you can't do anything at that point. I'm currently working around this with a kind of complex way of interweaving dummy calls to the Take Vars block. Real calls to it increment a running counter, and the dummy calls decrement the counter, and when the counter hits zero, I know the queue is empty.
So while this does work, it is messy, uses a lot of extra blocks, error-prone, etc etc. If you re-read the title of this post, maybe it will now make sense. Even for a "When available" Take Vars, maybe the No path can do something before the fiber goes into pause because of an empty queue?
Thanks for considering! 🙏🏽