Call flow functions from Javascript node?

Hi,

is there a way to call an Appgyver Flow function like “Cache” from within the Javascript node?
This would be extremely helpful to put complex logic with lots of IF statements into a few lines of code instead of a really complex collection of flow functions with lots of connectors.

Thanks,
Jo

It’s a better idea to keep concerns separated if you can. Maybe have a custom JS node which runs your IF logic and outputs whatever you need to cache conditionally, then feed that as an input to a single Cache flow function.

Thanks! I would agree if looping would not be so clunky in flow functions…I am always working with arrays I need to go through one by one…

If you’re working with arrays then you should use the MAP formula function. You might also want to use the JavaScript map function within a custom flow.

Hm, how do I use the Javascript map function to execute a Flow function for each item?

I don’t think you can execute an AppGyver flow function within your own Javascript code, unless you copy and paste its underlying code into your own function and then handle it appropriately. Assuming the code is just vanilla Javascript, it should also work within your flow function.