temporalio / temporalio/temporal

Update workflow search attributes outside of workflow context

Open
#3,665 3 comments 0 reactions 1 assignee View on GitHub

@rodrigozhou is already working on this.

Since Dec 2, 2022.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.