Thanks for getting in touch. It sounds like the Subscription feature via Configuration will let you achieve your objective of tapping into and acting on when a Release is created.
Subscriptions allow you to subscribe to events that are happening within Octopus, so you can be notified when events have occurred and react accordingly. Both email and webhook notifications are currently supported.
Thanks for getting back to me.
I did spot this subscriptions feature before, but I disregarded it as it is
an asynchronous notification mechanism, and I couldn't see a way to inject
the custom behaviour into the deployment pipeline (process).
The behaviour I'm hoping to achieve would be to generate a new GUID
variable per tenant every time I create a release. These variables would
need to be available for use during the deployment workflow.
Are there any other approaches to setting (or passing) variables into the
'create release' operation either by octo.exe, RestAPI or other?
Because there's no existing feature that does exactly what you want it will be asynchronous, is that of particular concern?
On the back of a subscription or if you use an automated process to create a release, could you add a variable to the project just before the release is created?
Example: you're about to make a release 1.0.1-cat, and you add a variable via the API or using octo.exe called Product-Code and you give it a GUID. Repeat for the next release 1.0.1-dog give that same variable a new GUID prior to it's creation.
This way for each release they snap shot their variables and will have in that same variable name different GUIDs.
Or am I not understanding your objective?
As another avenue to investigate, have you considered making use of the Tenants feature, if you use Tenants and Tenant Variables, those are not snapshotted, and you can have and change the variable representing the product code anytime, and at deployment time the release will fetch an "live" value for that variable?