automate the flow