Update flows.py

add flow functionality