workflows.services.context_catalog

Helpers to build a flattened catalog of context keys for the UI.

Attributes

Functions

_is_scalar(v)

_sample(v)

_flatten(obj[, prefix])

build_catalog(ctx)

Build catalog rows (key/label/sample) for use in the UI.

Module Contents

workflows.services.context_catalog.MAX_SAMPLE_LEN = 160[source]
workflows.services.context_catalog.MAX_ITEMS = 500[source]
workflows.services.context_catalog._is_scalar(v)[source]
Parameters:

v (Any)

Return type:

bool

workflows.services.context_catalog._sample(v)[source]
Parameters:

v (Any)

Return type:

str

workflows.services.context_catalog._flatten(obj, prefix='')[source]
Parameters:
  • obj (Any)

  • prefix (str)

Return type:

list[tuple[str, Any]]

workflows.services.context_catalog.build_catalog(ctx)[source]

Build catalog rows (key/label/sample) for use in the UI.

Parameters:

ctx (dict[str, Any]) – The workflow context dictionary (ctx) as produced by build_context.

Returns:

A structure containing usage information and a list of variable descriptors under the "vars" key. Each descriptor has "key", "label", and "sample" fields.

Return type:

dict[str, Any]