Without creating a timer is there a way to have the client connection perform a call back to obtain the ApiKey (e.g Azure Token) before executing a workflow?
Seems to be same issue with Typescript-sdk.
Without creating a timer is there a way to have the client connection perform a call back to obtain the ApiKey (e.g Azure Token) before executing a workflow?
Seems to be same issue with Typescript-sdk.
Since workflows have to be deterministic, if you need an API key in the workflow, you need to either pass in the API key as workflow input or use an activity as the first step of the workflow to obtain it. Workflow timers should not be related this concern.
Sorry, I didn’t make my question clear.
When a client connection is made and an apikey is supplied (token) there is no way to inform the client connection when the apikey has expired and needs to be renewed.
Instead of supplying a string, a function would be preferred. Does anyone have any other suggestions other than a timer to set the apikey periodically?
Ah, I see now.
Due to the fact that it’s actually Rust code in a shared library making the repeated client calls, we do require that you push a new API key as opposed to it being pulled via .NET callback. This is why the myClient.Connection.APIKey
was made intentionally settable. You can also replace the entire client on the worker (say if you need to change something like mTLS keys and create a separate connection). Using a timer to set the API key is reasonable if you don’t want to restart the worker with a new client.