pub struct Workflow {
pub workflow: WorkflowMeta,
pub roles: HashMap<String, Role>,
pub vars: HashMap<String, Variable>,
pub steps: Vec<Step>,
pub storage: HashMap<String, StorageSpec>,
}Expand description
A complete workflow definition parsed from a .zwf file.
A workflow describes a DAG of agent steps with shared variables, conditional routing, and data flow between steps. It maps directly to zag orchestration commands at execution time.
Fields§
§workflow: WorkflowMetaWorkflow metadata.
roles: HashMap<String, Role>Reusable role definitions that can be referenced by steps. Keys are role names; values define the role’s system prompt.
vars: HashMap<String, Variable>Shared variables that flow between steps. Keys are variable names; values define type, default, and description.
steps: Vec<Step>Ordered list of workflow steps. Each step maps to a zag agent invocation.
storage: HashMap<String, StorageSpec>Declared storage — structured, writable working data for the run.
Each entry is a named folder or file the workflow’s steps can read and
write. Declaration is a hint to the agent, not a schema — the author
describes what should live there and steps use their normal file tools
to access it. Paths resolve relative to <cwd>/.zig/; absolute paths
are used as-is.