Search code examples
temporal-workflow

What is the value search limit for custom search attributes in temporal cloud?


The doc says

The maximum total Search Attribute size is 40 KB.

Can someone let me know

  1. Is this limit per workflow running in a namespace?
  2. or it is the total value size of all custom search attributes attached to all the workflows running in a namespace?

Solution

  • I get the feeling that the doc you are referring to may be a bit out of sync with code.

    According to the source code of the Temporal server (see default config and the validator), limits regarding Search Attributes are:

    • A maximum of 100 custom search attributes per Workflow Execution;
    • A maximum of 2 KB per custom search attributes value;
    • A maximum of 40 KB for the total size of all custom search attributes defined on a single Workflow Execution.

    Note that for the second criteria, search attribute values are determined based on the payload size of each search attribute value, while for the third one, the total size appears to correspond to the length of the Protobuf encoded message containing the complete custom search attributes map (ie. search attributes names also count toward the 40 KB limit, plus some very small overhead due to the Protobuf encoding).