NodeRED and python

Sounds like you can indeed call it from an exec node and process it, but have to design your flow in a way that the scripts get called at the moment(s) you want to... which there’s plenty of nodes available to take care of that depending on your needs