Filter Workflows based on Input Data


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 samples-java/ at main · temporalio/samples-java · GitHub, 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