Skip to navigation

featureflags

View as MarkdownOpen in Claude

Experimental. For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Manages tenant-scoped feature flags for workflow behavior.

Prerequisites

  • None.

Setup

  • Loads automatically; no configuration required.

This module provides functionality for managing feature flags.

Members

is_enabled

featureflags.is_enabled(flag_name)

Check if a feature flag is enabled.

Parameters
flag_namestringThe name of the feature flag to check.
Returns
enabledboolWhether the feature flag is enabled.

list_flags_in_store

featureflags.list_flags_in_store()

List all feature flags and their values in the store.

Returns
flagsstringA string representation of feature flag names and their boolean values.

poll_until_flag_disabled

featureflags.poll_until_flag_disabled(flag_name)

Poll until a feature flag is disabled.

Parameters
flag_namestringThe name of the feature flag to poll until disabled.

restore_workflow_flags

featureflags.restore_workflow_flags()

Restore all feature flags in the calling workflow to their current store values, removing any local overrides and unlocking all flags. Flags not present in the store are set to false. Note: the store is read via a Temporal activity, so on replay the recorded result is used rather than re-reading the store.

set_and_lock_workflow_flag

featureflags.set_and_lock_workflow_flag(flag_name, enabled)

Set a feature flag value for the calling workflow only, without changing the store or signalling other workflows. The flag is locked so batch signals will not overwrite it. Use set_flag to unlock, or restore_workflow_flags to unlock all flags.

Parameters
flag_namestringThe name of the feature flag to set.
enabledboolWhether the feature flag should be enabled.

set_flag

featureflags.set_flag(flag_name, enabled, force_signal?)

Set a feature flag value. By default, when the new value matches the existing stored value, the call short-circuits and no batch signal is broadcast. Pass force_signal=True to broadcast the signal even on a no-op write (useful for drift correction).

Parameters
flag_namestringThe name of the feature flag to set.
enabledboolWhether the feature flag should be enabled.
force_signal?optionalboolIf True, fire the batch signal even when the value did not change. Default False.