There is an application method to set the profile attribute from the script but found a neat way to do this in workflow process as well.Just use the business service SIS OM PMT Service in your workflow and you can set the profile attribute as required.
Also, this business service has various other application methods that can be used in workflow process.