temporal
temporal copied to clipboard
Update workflow search attributes outside of workflow context
Is your feature request related to a problem? Please describe. My use case is wanting to tag workflows with metadata based on an external system. For example, I want to run a cronjob (or another workflow) every minute which will check if a workflow has taken longer than X amounts of minutes time to finish running (the X value here is not available in the workflow or worker and only in this third party system so we couldn't just use a timer or search attributes in the workflow itself). I have access to the workflow ids because we can query Temporal with the client library.
Describe the solution you'd like
I would like the ability to update a workflows search attributes outside of the workflow context. Preferably with the ability to be able to update a set of workflows based on a query. For example we would like the ability to provide a query ExecutionStatus='Failed'
and to update all the workflows with this.
Describe alternatives you've considered I've considered storing the workflow id and the search attributes in another datastore but this feels wasteful when search attributes are so useful and accessible.
https://temporalio.slack.com/archives/CTRCR8RBP/p1669332033386459
- updating the ElasticSearch index manually using the ElasticSearch API directly.
Additional context
Also just curious if this does get implemented how this will be impacted on cloud (will it be classed an action per workflow updated or per operation).
@calum-stripe do you need to be able to update closed workflows as well as open ones?
I'd like to be able to update closed workflows.
When I add a new search attribute I'd like to migrate past workflows by setting the search attribute on the existing workflows