Safe Haskell | None |
---|---|
Language | Haskell2010 |
Temporal.SearchAttributes
Contents
Description
A Search Attribute is an indexed field used in a List Filter to filter a list of Workflow Executions that have the Search Attribute in their metadata.
Each Search Attribute is a key-value pair metadata object included in a Workflow Execution's Visibility information. This information is available in the Visibility store.
Note: Search Attribute values are not encrypted because the Temporal Server must be able to read these values from the Visibility store when retrieving Workflow Execution details.
Temporal provides some default Search Attributes, such as ExecutionStatus, the current state of your Workflow Executions. You can also create custom Search Attribute keys in your Visibility store and assign values when starting a Workflow Execution or in Workflow code.
When using Continue-As-New or a Temporal Cron Job, Search Attribute keys are carried over to the new Workflow Run by default. Search Attribute values are only available for as long as the Workflow is.
Search Attributes are most effective for search purposes or tasks requiring collection-based result sets. For business logic in which you need to get information about a Workflow Execution, consider one of the following:
- Storing state in a local variable and exposing it with a Query.
- Storing state in an external datastore through Activities and fetching it directly from the store.
If your business logic requires high throughput or low latency, store and fetch the data through Activities. You might experience lag due to time passing between the Workflow's state change and the Activity updating the Visibility store.
Default Search Attributes
A Temporal Cluster has a set of default Search Attributes already available. Default Search Attributes are set globally in any Namespace. These Search Attributes are created when the initial index is created.
NAME | TYPE | DEFINITION |
---|---|---|
BatcherUser | Keyword | Used by internal batcher
Workflow that runs in
TemporalBatcher
Namespace division to
indicate the user who
started the batch
operation. |
BinaryChecksums | Keyword List | List of binary Ids of
Workers that run the
Workflow Execution.
Deprecated since server
version 1.21 in favor of
the BuildIds search
attribute. |
BuildIds | Keyword List | List of Worker Build Ids
that have processed the
Workflow Execution,
formatted as
versioned:{BuildId} or
unversioned:{BuildId} ,
or the sentinel
unversioned value.
Available from server
version 1.21. |
CloseTime | Datetime | The time at which the Workflow Execution completed. |
ExecutionDuration | Int | The time needed to run the Workflow Execution (in nanoseconds). Available only for closed Workflows. |
ExecutionStatus | Keyword | The current state of the Workflow Execution. |
ExecutionTime | Datetime | The time at which the
Workflow Execution
actually begins running;
same as StartTime for
most cases but different
for Cron Workflows and
retried Workflows. |
HistoryLength | Int | The number of events in the history of Workflow Execution. Available only for closed Workflows. |
HistorySizeBytes | Long | The size of the Event History. |
RunId | Keyword | Identifies the current Workflow Execution Run. |
StartTime | Datetime | The time at which the Workflow Execution started. |
StateTransitionCount | Int | The number of times that Workflow Execution has persisted its state. Available only for closed Workflows. |
TaskQueue | Keyword | Task Queue used by Workflow Execution. |
TemporalChangeVersion | Keyword List | Stores change/version pairs if the GetVersion API is enabled. |
Te mporalScheduledStartTime | Datetime | The time that the Workflow is schedule to start according to the Schedule Spec. Can be manually triggered. Set on Schedules. |
TemporalScheduledById | Keyword | The Id of the Schedule that started the Workflow. |
TemporalSchedulePaused | Boolean | Indicates whether the Schedule has been paused. Set on Schedules. |
WorkflowId | Keyword | Identifies the Workflow Execution. |
WorkflowType | Keyword | The type of Workflow. |
Synopsis
- class ToSearchAttribute a where
- toSearchAttribute :: a -> SearchAttributeType
- newtype SearchAttributeKey = SearchAttributeKey {}
- data SearchAttributeType
Documentation
class ToSearchAttribute a where Source #
Methods
toSearchAttribute :: a -> SearchAttributeType Source #
Instances
newtype SearchAttributeKey Source #
Constructors
SearchAttributeKey | |
Fields |
Instances
data SearchAttributeType Source #
A search attribute is a key-value pair that can be used to filter workflows.
Search attributes are indexed by the Temporal server
See https://docs.temporal.io/visibility#types for more information about search attributes.
Constructors
Bool Bool | |
Datetime UTCTime | |
Double Double | |
Int Int64 | |
KeywordOrText Text | Keyword and Text types are concepts taken from Elasticsearch. Each word in a Text is considered a searchable keyword. For a UUID, that can be problematic because Elasticsearch indexes each portion of the UUID separately. To have the whole string considered as a searchable keyword, use the Keyword type. For example, if the key ProductId has the value of 2dd29ab7-2dd8-4668-83e0-89cae261cfb1:
|
KeywordList (Vector Text) |