RAZ-3334 : Workflow is now executing on batch operations. Re-factored code so workflow is always executed in function itself