windmill-labs/windmill · error

Path is required if no value is not provided

Error message

Path is required if no value is not provided

What it means

In the batch job-creation code for kind "script" (and reused for kind "flow"), the code requires either an inline `value` or a `path` pointing at an existing script/flow. When both are absent it throws this (typo'd) message. It is an input-validation error for the batch endpoint.

Source

Thrown at backend/windmill-api/src/jobs.rs:9052

                    } = get_latest_deployed_hash_for_path(Some(db_authed), db.clone(), &w_id, &path)
                    .await?
                    .prefetch_cached(&db)
                    .await?;
                (
                    Some(script_hash),
                    Some(path),
                    JobKind::Script,
                    Some(language),
                    dedicated_worker,
                    runnable_settings,
                    timeout,
                    None,
                    None,
                    None,
                    None,
                )
            } else {
                Err(anyhow::anyhow!(
                    "Path is required if no value is not provided"
                ))?
            }
        }
        "rawscript" => {
            if let Some(rawscript) = batch_info.rawscript {
                (
                    None,
                    None,
                    JobKind::Preview,
                    rawscript.language,
                    None,
                    Default::default(),
                    None,
                    Some(rawscript.content),
                    rawscript.lock,
                    None,
                    None,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Add a `path` field pointing to an existing script/flow in the batch item.
  2. Alternatively, provide the inline `value` (script/flow definition) instead of a path.
  3. Double-check the payload field names — the code reads `path` and `value` exactly.
  4. If you control the code, fix the misleading message ("Path is required if no value is not provided" → "Either path or value must be provided").

Example fix

// before
{ "kind": "script" }
// after
{ "kind": "script", "path": "u/admin/my_script" }
// or with inline value
{ "kind": "script", "value": { "content": "...", "language": "python3" } }
Defensive patterns

Strategy: validation

Validate before calling

if (!item.path && !item.value) throw new Error(`batch item ${i}: provide either path or value for kind=${item.kind}`);

Type guard

function resolvableItem(item) { return Boolean(item.path || item.value); }

Try / catch

try {
  await batchCreate(items);
} catch (e) {
  if (String(e).includes('Path is required')) console.error('Add path or value to batch item', e);
  else throw e;
}

Prevention

When it happens

Trigger: POSTing a batch item with kind "script" (or "flow") where `path` is null and no inline `value` is provided — jobs.rs around line 9052/9103.

Common situations: Batch-import tools omitting `path` when intending to reference an existing script; JSON payloads with the field misspelled (e.g. `script_path` instead of `path`); template-generated requests where the value placeholder was never filled.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/c3c3d164f690182a. Report an issue: GitHub.