Skip to navigation

Globals provided by the orchestrator, available without loading a module.

Members

cluster_id

cluster_id()

Get the cluster ID.

Returns
idstringThe cluster ID.

datacenter_id

datacenter_id()

Get the datacenter ID.

Returns
idstringThe datacenter ID.

err

err(error)

Creates an error Result value.

Parameters
erroranyThe error value.
Returns
resultResultAn error Result value.

help

help(topic?)

Shows documentation for modules and functions. Call with no arguments to list all modules, or pass a module/function to see its details.

Parameters
topic?optionalmodule | function | stringA module, function, or string name to get help for
Returns
textstringFormatted help text

ok

ok(value)

Creates a successful Result value.

Parameters
valueanyThe success value.
Returns
resultResultA successful Result value.

param

param(module, key)

Retrieves a parameter value passed to an agent tool. Only available during agent tool execution context.

Parameters
modulestringThe module name to look up the parameter in
keystringThe parameter key within the module
Returns
valueanyThe parameter value converted to a Starlark type

print

print(message)

Print a message to the Temporal UI.

Parameters
messageanyThe message to print.

register_workflow

register_workflow(workflow_function, workflow_id?, on_failure?, on_cancel?, query?, max_concurrency?, circuit_breaker?)

Register a workflow.

Parameters
workflow_functionfunctionThe Starlark function to register as a workflow. The function must have a docstring with argument and return types.
workflow_id?optionalfunctionThe Starlark function used to generate a logical, tenant-local workflow execution ID. This should accept the same arguments as the workflow function. Tenant prefixes are applied by Remediation Orchestrator and must not be returned by this function.
on_failure?optionalfunctionThe Starlark function to call if the workflow fails. This should accept the same arguments as the workflow function. An additional argument, errors of type list[string] or string can be specified for the error history to be passed in.
on_cancel?optionalfunctionThe Starlark function to call if the workflow is canceled. This should accept the same arguments as the workflow function.
query?optionalfunctionThe Starlark function to call to query the workflow. This should accept the same arguments as the workflow function.
max_concurrency?optionalintThe maximum number of concurrent workflow executions. Defaults to infinite. This is best-effort enforced due to Temporal Count queries lack of strong consistency.
circuit_breaker?optionaldict[string:any]DEPRECATED: Circuit breakers are now managed through the web UI, not during registration
Returns
workflowworkflows.WorkflowThe workflow object.

result

result(value?, error?)

Creates a Result value with optional value and error fields.

Parameters
value?optionalanyThe success value.
error?optionalanyThe error value.
Returns
resultResultA Result value.

sha256

sha256(s)

Compute SHA256 hash of a string.

Parameters
sstringThe string to hash.
Returns
hashstringThe SHA256 hash.

sleep

sleep(duration)

Sleep for a given duration.

Parameters
durationstringThe duration to sleep.

struct

struct(kwargs?)

Creates an immutable struct with the given keyword arguments as fields. Fields are accessible as attributes.

Parameters
kwargs?optionalanyKeyword arguments that become the struct’s fields
Returns
resultstructAn immutable struct with the given fields

tenant_id

tenant_id()

Get the current workflow’s human-readable tenant ID.

Returns
idstringThe human-readable tenant ID.

tenant_uuid

tenant_uuid()

Get the current workflow’s canonical tenant UUID.

Returns
uuidstringThe canonical tenant UUID.