Thanks for getting in touch!
Are you able to provide some more details for the scenario that requires variables to be updated prior to deployment?
The reason I ask is that variables are snapshotted when a release is created, so to amend these before a deployment would require a script to perform the change, and then a refresh of the release variable snapshot.
This isn’t overly recommended though, as the idea of the snapshot is to retain consistency as the release is promoted through each environment. The risk being that you could successfully deploy to your first environment, then change variables and update the snapshot and then the next deploy could fail and you have no easy way to re-deploy.
If the variables you’re wanting to change are ones that only need to exist during a deployment, then a better option would be to use output variables. This would allow you to generate variables using a process step at the beginning of a deployment and then use them in later steps without any additional API calls required.
I look forward to hearing from you.