windmill-labs/windmill · error
Invalid worker group config name
Error message
Invalid worker group config name
What it means
importSingleWorkerConfig validates each parsed worker-group config object from the YAML import drawer. A config without a non-empty string 'name' field is rejected with this error before ConfigService.updateConfig is called, since the backend key is derived as 'worker__' + name.
Source
Thrown at frontend/src/routes/(root)/(logged)/workers/+page.svelte:354
await ConfigService.updateConfig({ name: 'worker__' + configName, requestBody: {} })
newGroupPopover?.close()
await loadWorkerGroups()
// Select the new worker group and signal it should auto-open drawer
selectedTab = configName
shouldAutoOpenDrawer = configName
sendUserToast(`Worker group ${configName} created`)
} catch (err) {
sendUserToast(`Could not create worker group: ${err}`, true)
}
}
let importConfigDrawer: Drawer | undefined = $state(undefined)
let importConfigCode = $state('')
let tag: string = $state('')
async function importSingleWorkerConfig(c: any) {
if (typeof c === 'object' && c !== null) {
if (!c.name || typeof c.name !== 'string') {
throw new Error('Invalid worker group config name')
}
if (workerGroups?.hasOwnProperty(c.name)) {
throw new Error(`Worker group config with the name ${c.name} already exists`)
}
await ConfigService.updateConfig({
name: 'worker__' + c.name,
requestBody: { ...c, name: undefined }
})
} else {
throw new Error('Invalid worker group config')
}
}
async function importConfigFromYaml() {
const config = YAML.parse(importConfigCode)
View on GitHub (pinned to e474e8803c)
Solutions
- Add a unique non-empty 'name' string field to every worker group entry in the YAML
- Check YAML indentation so 'name' is a sibling of the group's other fields
- Re-export the config from a source that emits the 'name' field
- Fix type coercion — quote numeric-looking names so they parse as strings
Example fix
// before
worker_groups:
- concurrency: 10
// after
worker_groups:
- name: my-group
concurrency: 10 Defensive patterns
Strategy: validation
Validate before calling
function validateImport(c: unknown): c is { name: string } {
return typeof c === 'object' && c !== null && typeof (c as any).name === 'string' && (c as any).name.trim() !== ''
}
// before importing:
if (!configs.every(validateImport)) throw new Error('Every worker group needs a non-empty string name') Type guard
function isNamedWorkerConfig(c: unknown): c is { name: string; [k: string]: unknown } {
return typeof c === 'object' && c !== null && typeof (c as any).name === 'string' && (c as any).name.length > 0
} Try / catch
try {
await importConfigFromYaml()
} catch (e) {
if (e.message === 'Invalid worker group config name') {
sendUserToast('Each worker group in the YAML needs a non-empty string "name" field', true)
} else throw e
} Prevention
- Validate the whole YAML with a JSON schema before import
- Quote names in YAML so numeric-looking names stay strings
- Keep an example/template config in docs with the required name field
- Check indentation — name must be a direct child of the group mapping
When it happens
Trigger: Pasting/uploading worker config YAML where an entry is an object but lacks 'name', or has name as a non-string (number, null, empty string).
Common situations: Hand-written YAML missing the name key on one group; exporting configs from another tool with a different field name (e.g. 'id' or 'group'); YAML indentation accident nesting name under another key.
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
- Invalid worker group config
- Worker group config with the name ${c.name} already exists
- Document must be a string
- Unsupported trigger kind: ${target.triggerKind}
- the document must be a mapping (key: value)
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/79f7334857642aef.
Report an issue: GitHub.