Refactored to work with workflow id