{"record":{"id":"c3c3d164f690182a","repo":"windmill-labs/windmill","slug":"path-is-required-if-no-value-is-not-provided","errorCode":null,"errorMessage":"Path is required if no value is not provided","messagePattern":"Path is required if no value is not provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-api/src/jobs.rs","lineNumber":9052,"sourceCode":"                    } = get_latest_deployed_hash_for_path(Some(db_authed), db.clone(), &w_id, &path)\n                    .await?\n                    .prefetch_cached(&db)\n                    .await?;\n                (\n                    Some(script_hash),\n                    Some(path),\n                    JobKind::Script,\n                    Some(language),\n                    dedicated_worker,\n                    runnable_settings,\n                    timeout,\n                    None,\n                    None,\n                    None,\n                    None,\n                )\n            } else {\n                Err(anyhow::anyhow!(\n                    \"Path is required if no value is not provided\"\n                ))?\n            }\n        }\n        \"rawscript\" => {\n            if let Some(rawscript) = batch_info.rawscript {\n                (\n                    None,\n                    None,\n                    JobKind::Preview,\n                    rawscript.language,\n                    None,\n                    Default::default(),\n                    None,\n                    Some(rawscript.content),\n                    rawscript.lock,\n                    None,\n                    None,","sourceCodeStart":9034,"sourceCodeEnd":9070,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-api/src/jobs.rs#L9034-L9070","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a `path` field pointing to an existing script/flow in the batch item.","Alternatively, provide the inline `value` (script/flow definition) instead of a path.","Double-check the payload field names — the code reads `path` and `value` exactly.","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\")."],"exampleFix":"// before\n{ \"kind\": \"script\" }\n// after\n{ \"kind\": \"script\", \"path\": \"u/admin/my_script\" }\n// or with inline value\n{ \"kind\": \"script\", \"value\": { \"content\": \"...\", \"language\": \"python3\" } }","handlingStrategy":"validation","validationCode":"if (!item.path && !item.value) throw new Error(`batch item ${i}: provide either path or value for kind=${item.kind}`);","typeGuard":"function resolvableItem(item) { return Boolean(item.path || item.value); }","tryCatchPattern":"try {\n  await batchCreate(items);\n} catch (e) {\n  if (String(e).includes('Path is required')) console.error('Add path or value to batch item', e);\n  else throw e;\n}","preventionTips":["Always set path for reference-based batch items","Validate payloads before submit","Watch for field renames (value vs script_path) between API versions"],"tags":["validation","jobs","batch","missing-field"],"backgroundTag":"missing-required-argument","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}