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

  1. Rename the duplicate group in the YAML (or in the workers page) before importing
  2. Remove the already-existing group entry from the YAML if it should not be re-created
  3. Delete/rename the existing worker group first if the import is meant to replace it
  4. 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

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


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