Filter Workflows based on Input Data

Hi,

If we have username, location as input data for workflow events. Is there any way to filter workflow executions based on these fields ?
Can custom search attributes should be used for this purpose ?

Hello @Sarvesh

yes, you can use custom search attributes, find an example here https://github.com/temporalio/samples-java/blob/main/src/main/java/io/temporal/samples/hello/HelloSearchAttributes.java, you will need to add the attributes to the cluster before using them tctl v1.17 admin command reference | Temporal Documentation

Please note that:

  • the rate limit for the visibility API is lower that the workflow execution API.
    The default value for visibility API is 10 RPS, you can change it by setting the dynamic config frontend.namespaceRPS.visibility
  • visibility data is eventually consistent, so the data could have small delays to get updated.

If you plan to run complex queries with high throughput, the general recommendation is to store the data in an external DB and update it from your workflow.

If we have username, location …

Also note that search attributes are not encrypted when using data converters, just in case this is something that concerns you