temporal-sdk
Safe HaskellNone
LanguageHaskell2010

Temporal.SearchAttributes

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.

NAMETYPEDEFINITION
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.
WorkflowTypeKeywordThe type of Workflow.
Synopsis

Documentation

class ToSearchAttribute a where Source #

Instances

Instances details
ToSearchAttribute Int16 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Int32 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Int64 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Int8 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Word16 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Word32 Source # 
Instance details

Defined in Temporal.SearchAttributes

(TypeError ('Text "Converting a Word64 to a search attribute can cause a signed value overflow") :: Constraint) => ToSearchAttribute Word64 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Word8 Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Text Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute UTCTime Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Bool Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Double Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Float Source # 
Instance details

Defined in Temporal.SearchAttributes

ToSearchAttribute Int Source # 
Instance details

Defined in Temporal.SearchAttributes

(TypeError ('Text "Converting a Word to a search attribute can cause a signed value overflow") :: Constraint) => ToSearchAttribute Word Source # 
Instance details

Defined in Temporal.SearchAttributes

newtype SearchAttributeKey Source #

Instances

Instances details
FromJSON SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

FromJSONKey SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

ToJSON SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

ToJSONKey SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Data SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SearchAttributeKey -> c SearchAttributeKey #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SearchAttributeKey #

toConstr :: SearchAttributeKey -> Constr #

dataTypeOf :: SearchAttributeKey -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SearchAttributeKey) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SearchAttributeKey) #

gmapT :: (forall b. Data b => b -> b) -> SearchAttributeKey -> SearchAttributeKey #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SearchAttributeKey -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SearchAttributeKey -> r #

gmapQ :: (forall d. Data d => d -> u) -> SearchAttributeKey -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SearchAttributeKey -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SearchAttributeKey -> m SearchAttributeKey #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchAttributeKey -> m SearchAttributeKey #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchAttributeKey -> m SearchAttributeKey #

IsString SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Show SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Eq SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Ord SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

Lift SearchAttributeKey Source # 
Instance details

Defined in Temporal.SearchAttributes

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:

  • As a Keyword it would be matched only by ProductId = "2dd29ab7-2dd8-4668-83e0-89cae261cfb1"
  • As a Text it would be matched by ProductId = 2dd8, which could cause unwanted matches.
KeywordList (Vector Text) 

Instances

Instances details
FromJSON SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

ToJSON SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Data SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SearchAttributeType -> c SearchAttributeType #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SearchAttributeType #

toConstr :: SearchAttributeType -> Constr #

dataTypeOf :: SearchAttributeType -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SearchAttributeType) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SearchAttributeType) #

gmapT :: (forall b. Data b => b -> b) -> SearchAttributeType -> SearchAttributeType #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SearchAttributeType -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SearchAttributeType -> r #

gmapQ :: (forall d. Data d => d -> u) -> SearchAttributeType -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SearchAttributeType -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SearchAttributeType -> m SearchAttributeType #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchAttributeType -> m SearchAttributeType #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SearchAttributeType -> m SearchAttributeType #

Show SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Eq SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Ord SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Lift SearchAttributeType Source # 
Instance details

Defined in Temporal.SearchAttributes

Orphan instances

Lift Day Source # 
Instance details

Methods

lift :: Quote m => Day -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Day -> Code m Day #

Lift DiffTime Source # 
Instance details

Methods

lift :: Quote m => DiffTime -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => DiffTime -> Code m DiffTime #

Lift NominalDiffTime Source # 
Instance details

Methods

lift :: Quote m => NominalDiffTime -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => NominalDiffTime -> Code m NominalDiffTime #

Lift UTCTime Source # 
Instance details

Methods

lift :: Quote m => UTCTime -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => UTCTime -> Code m UTCTime #