RUNTIME_VALUES

RuntimeValue in Workflow Tool State

Date: 2026-03-27 Branch: wf_tool_state

What Is RuntimeValue?

{"__class__": "RuntimeValue"} is a native (.ga) tool_state marker meaning “user supplies this input at runtime.” It appears in place of a concrete value for a parameter, signaling that the workflow form should prompt the user when the workflow is launched.

Format2 has no equivalent concept — RuntimeValue gets folded into the in connection block during native→format2 conversion (same as ConnectedValue).

IWC Corpus Prevalence

259 occurrences across 84 of ~120 IWC workflows. RuntimeValue is pervasive in real-world workflows.

Three Patterns (from manual verification of 12 cases)

1. Stale/Vestigial (~1/3 of sampled cases)

RuntimeValue in tool_state plus an input_connections entry for the same parameter. The connection supersedes the RuntimeValue at execution time — the RuntimeValue is never consulted. This is leftover state from before the author wired the parameter to another step’s output.

Examples:

The current code handles these correctly — the walker checks input_connections first and injects ConnectedValue, which takes precedence over whatever is in tool_state. But the RuntimeValue is dead weight that could be cleaned.

2. Intentional Workflow Inputs (~1/3 of sampled cases)

RuntimeValue on an optional data parameter that is also exposed as a workflow-level input. The author intentionally surfaces this for the user to optionally provide at launch. No input_connections entry exists.

Examples:

3. Inert/No-Op (~1/3 of sampled cases)

RuntimeValue on an optional data parameter that is not exposed as a workflow input and has no input_connections. The parameter will be null at runtime. RuntimeValue is effectively meaningless here — the same behavior would occur if the key were absent entirely or set to null.

Examples:

Key Finding: All Disconnected RuntimeValues Are on Optional Parameters

Every disconnected RuntimeValue (patterns 2 and 3) in the sample was on a parameter with optional: true in the tool definition. No cases were found of RuntimeValue on a required data parameter without a connection.

Current Handling in wf_tool_state

RuntimeValue is treated as a sibling of ConnectedValue throughout the package:

ModuleHandling
_util.pyis_connected_or_runtime() returns True for both markers
validation_native.pyWalker encounters RuntimeValue → SKIP_VALUE (valid for any param type)
convert.pyRuntimeValue → entry in format2_in dict (same as ConnectedValue)
roundtrip.py_is_connection_marker() treats both as equivalent for diff classification; sections that are all RuntimeValue/ConnectedValue/None are “connection-only” → benign diff

There is no Pydantic model for RuntimeValue (ConnectedValue has one). The convergence plan’s unresolved question about whether RuntimeValue needs one remains open.

Open Questions