{"record":{"id":"bb474bbf32219e78","repo":"windmill-labs/windmill","slug":"rest-parameters-are-not-supported","errorCode":null,"errorMessage":"Rest (...) parameters are not supported","messagePattern":"Rest \\(\\.\\.\\.\\) parameters are not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-nu/src/lib.rs","lineNumber":136,"sourceCode":"                        )?),\n                    )\n                } else {\n                    bail!(\"Parsing error `:` should be before `=`\\nit likely means you are trying to set default value to record or table which is not supported at the moment.\")\n                }\n            }\n        };\n\n        // Check if it is optional\n        let optional = {\n            let Some(element) = name.chars().last() else {\n                bail!(\"Internal error, cannot check if argument is optional\")\n            };\n            element == '?'\n        };\n\n        // Rest parameters are not supported\n        if matches!(name.get(0..3), Some(\"...\")) {\n            bail!(\"Rest (...) parameters are not supported\")\n        }\n\n        // Flags are not supported\n        if matches!(name.get(0..2), Some(\"--\")) {\n            bail!(\"Flags are not supported\")\n        }\n\n        sig.args.push(Arg {\n            name: if optional {\n                name.get(..name.len() - 1).unwrap_or(\"Error\").to_owned()\n            } else {\n                name.to_owned()\n            },\n            typ: typ.unwrap_or(Typ::Unknown),\n            otyp: None,\n            has_default: default.is_some() || optional,\n            default: default.or_else(|| if optional { Some(json!(null)) } else { None }),\n            oidx: None,","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-nu/src/lib.rs#L118-L154","documentation":"Nushell rest parameters (`...rest`) collect variadic extra arguments. Windmill's job model requires a fixed argument signature, so when the parser sees a parameter name starting with `...` in `def main`, it bails. Rest parameters cannot be mapped to Windmill's typed args.","triggerScenarios":"Declaring `def main [...args]` (or any parameter beginning with `...`) in a Nushell script deployed to Windmill.","commonSituations":"Scripts designed for CLI-style variadic invocation being reused as Windmill scripts; copy-pasted Nushell commands that use rest args for passthrough.","solutions":["Replace `...rest` with a fixed list parameter, e.g. `def main [items: list]`, and pass a list as one arg.","Remove the rest parameter and enumerate the explicit parameters Windmill callers should pass.","Handle extra inputs inside the script via a single `any`/list input rather than variadic capture.","Split the script so the variadic part is done in a flow (Windmill flow steps) instead of inside one script."],"exampleFix":"// before\ndef main [...args]\n// after\ndef main [args: list]","handlingStrategy":"validation","validationCode":"function validateNoRestParams(code) {\n  const m = code.match(/def\\s+main\\s*\\[([^\\]]*)\\]/);\n  if (m && /(^|,\\s*)\\.\\.\\./.test(m[1])) return 'rest (...) parameters are not supported; use a fixed list parameter like `items: list`';\n  return null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const sig = parseNuSignature(source);\n} catch (e) {\n  if (String(e).includes('Rest (...) parameters')) {\n    throw new Error('Replace ...rest with an explicit list parameter and pass a list as a single argument');\n  }\n  throw e;\n}","preventionTips":["Never use ...rest params in def main for Windmill scripts","Model variadic input as a single list/any parameter","Do variadic fan-out with Windmill flows instead of within one script"],"tags":["nushell","parser","rest-params","unsupported-feature"],"backgroundTag":"unsupported-parameter-kind","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"}