windmill-labs/windmill · error
Worker group config with the name ${c.name} already exists
Error message
Worker group config with the name ${c.name} already exists What it means
During YAML worker-config import, after ensuring a config object has a valid name, importSingleWorkerConfig checks workerGroups (the existing groups) with hasOwnProperty. A duplicate name means the backend config key 'worker__<name>' already exists, so the import throws instead of silently overwriting.
Source
Thrown at frontend/src/routes/(root)/(logged)/workers/+page.svelte:358
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)
try {
if (Array.isArray(config)) {
for (const c of config) {
await importSingleWorkerConfig(c)View on GitHub (pinned to e474e8803c)
Solutions
- Rename the duplicate group in the YAML (or in the workers page) before importing
- Remove the already-existing group entry from the YAML if it should not be re-created
- Delete/rename the existing worker group first if the import is meant to replace it
- Use unique names per environment when merging configs from multiple instances
Example fix
// before
groups:
- name: default
concurrency: 5
// after
groups:
- name: default-v2
concurrency: 5 Defensive patterns
Strategy: validation
Validate before calling
const names = configs.map(c => c?.name).filter(Boolean)
const dupInFile = names.filter((n, i) => names.indexOf(n) !== i)
const dupExisting = names.filter(n => workerGroups?.hasOwnProperty(n))
if (dupInFile.length || dupExisting.length) {
sendUserToast(`Duplicate worker group names: ${[...new Set([...dupInFile, ...dupExisting])].join(', ')}`, true)
return
} Try / catch
try {
await importConfigFromYaml()
} catch (e) {
if (e.message.startsWith('Worker group config with the name')) {
const name = e.message.match(/name (.*) already/)?.[1]
sendUserToast(`Rename group "${name}" in the YAML or delete the existing one first`, true)
} else throw e
} Prevention
- Deduplicate names within the YAML before import
- Prefix names per environment when merging exports from multiple instances
- Offer an 'overwrite' mode explicitly rather than failing silently or hard
- Diff imported names against existing workerGroups in the UI before submitting
When it happens
Trigger: Importing a YAML whose worker group name collides with an existing worker group in the instance — e.g. re-importing the same export, or two entries/groups sharing a name.
Common situations: Re-running an import that already succeeded; merging exports from two instances that both define a 'default' group; copy-pasting an existing group and forgetting to rename it.
Related errors
- Invalid worker group config name
- Invalid worker group config
- Variant name already exists
- result.substring(__RESULT_ERR_PREFIX.length)
- Datatable '${dtName}' already exists in this workspace
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/e724397d48be17ce.
Report an issue: GitHub.