Refactored to separate execution and returned promises from flow configuration