Skip to main content

Module selector

Module selector 

Source
Expand description

Server-side workflow-type/status selector filtering. Server-side selector filtering for filtered subscriptions.

FilteredSubscription advertises optional workflow_type and status selectors. The engine’s EventFilter has no type or status dimension, so the selection runs at the socket seam, after the namespace gate proved ownership and resolved the workflow’s recorded type from the same durable read.

Selector semantics (documented in docs/API.md):

  • workflow_type matches when the event’s workflow has that recorded type at the time the namespace gate resolved it: the initial durable read returns the head-of-history WorkflowStarted type at read time, which on a continue-as-new chain can briefly run ahead of an older delivered event (a one-event-loop forward-skew window) until the stream’s own WorkflowStarted refresh self-heals the cached type. A workflow whose history records no started run never matches a type selector.
  • status matches per event kind: each terminal lifecycle event matches exactly its projected status (WorkflowCompletedCompleted, WorkflowFailedFailed, WorkflowCancelledCancelled, WorkflowTimedOutTimedOut, WorkflowContinuedAsNewContinuedAsNew); every other LIFECYCLE event — including WorkflowStarted — matches Running. A LABEL-ONLY SearchAttributesUpdated (a rename) is not a lifecycle event (#211) and matches ANY status selector, because a workflow’s display name changes in every status and both forcing it into Running and withholding it from the other buckets would be wrong. The SearchAttributesUpdated carrying a run’s PLACEMENT is recorded atomically with WorkflowStarted and matches Running with it, so a terminal-status subscriber is not sent an attribute frame for every workflow starting in the namespace.
  • When both selectors are present they AND together.

Structs§

SubscriptionSelector
Validated subscription selectors applied before frame encoding.