replate state workflow with return values instead of exception