CFY-1232 extract remote/local workflow context logic to seperate handlers