pub struct Variable {
pub var_type: VarType,
pub default: Option<Value>,
pub default_file: Option<String>,
pub description: String,
pub from: Option<String>,
pub required: bool,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
pub min: Option<f64>,
pub max: Option<f64>,
pub pattern: Option<String>,
pub allowed_values: Option<Vec<Value>>,
}Expand description
A workflow variable — shared state between steps.
Variables can be referenced in step prompts via ${var_name} and updated
by agents through the zig MCP server during execution.
Fields§
§var_type: VarTypeVariable type: “string”, “number”, “bool”, or “json”.
default: Option<Value>Default value (as a TOML value). If absent, the variable must be provided at runtime or set by a preceding step.
default_file: Option<String>Path to a file whose contents become the default value (relative to .zwf file).
Mutually exclusive with default.
description: StringHuman-readable description of this variable’s purpose.
from: Option<String>Bind this variable to an input source. Currently only "prompt" is
supported, which assigns the CLI user prompt to this variable.
required: boolIf true, the variable must have a non-empty value before execution.
min_length: Option<u32>Minimum string length (only valid for type = "string").
max_length: Option<u32>Maximum string length (only valid for type = "string").
min: Option<f64>Minimum numeric value (only valid for type = "number").
max: Option<f64>Maximum numeric value (only valid for type = "number").
pattern: Option<String>Regex pattern the value must match (only valid for type = "string").
allowed_values: Option<Vec<Value>>Restrict value to one of these specific values.