Skip to main content

run_workflow

Function run_workflow 

Source
pub async fn run_workflow(
    workflow_path: &str,
    user_prompt: Option<&str>,
    disable_resources: bool,
    disable_memory: bool,
    disable_storage: bool,
    dry_run: bool,
    dry_run_format: DryRunFormat,
) -> Result<(), ZigError>
Expand description

Execute a workflow file (.zwf or .zwfz).

Parses the workflow, validates it, resolves the step DAG, and executes each step via the embedded zag_agent::builder::AgentBuilder (and zag_orch for pipe/collect/summary commands). The optional user_prompt is injected as additional context into every step’s prompt.

Resource advertisement (the <resources> block prepended to each step’s system prompt) is enabled by default; pass disable_resources = true to opt out, e.g. via zig run --no-resources.

Memory injection (the <memory> block) is similarly enabled by default; pass disable_memory = true to opt out via zig run --no-memory.

Storage injection (the <storage> block) is similarly enabled by default; pass disable_storage = true to opt out via zig run --no-storage.

When dry_run = true, the workflow is parsed, validated, and its plan is printed in the requested format — no agent invocation, session log, storage creation, or memory write occurs. The three disable_* flags are respected and surface in the plan output.