{"record":{"id":"035bfed05881cd2f","repo":"windmill-labs/windmill","slug":"deletion-not-supported-for-kind-kind","errorCode":null,"errorMessage":"Deletion not supported for kind: ${kind}","messagePattern":"Deletion not supported for kind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/windmill-utils-internal/src/deploy.ts","lineNumber":835,"sourceCode":"    } else if (kind === \"resource\") {\n      await provider.deleteResource({ workspace, path });\n    } else if (kind === \"resource_type\") {\n      await provider.deleteResourceType({ workspace, path });\n    } else if (kind === \"folder\") {\n      await provider.deleteFolder({ workspace, name: folderName(path) });\n    } else if (kind === \"schedule\") {\n      await provider.deleteSchedule({ workspace, path });\n    } else if (kind === \"datatable_migration\") {\n      const { datatable, timestamp } = parseDatatableMigrationDeployPath(path);\n      await provider.deleteDatatableMigration({\n        workspace,\n        datatableName: datatable,\n        timestamp,\n      });\n    } else if (isTriggerKind(kind)) {\n      await provider.deleteTriggerByKind(kind, { workspace, path });\n    } else {\n      throw new Error(`Deletion not supported for kind: ${kind}`);\n    }\n    return { success: true };\n  } catch (e: unknown) {\n    return { success: false, error: toError(e) };\n  }\n}\n\n// ---------------------------------------------------------------------------\n// getOnBehalfOf\n// ---------------------------------------------------------------------------\n\n/**\n * Get the value of an item for diff comparison.\n * Returns a normalized representation suitable for JSON comparison.\n */\nexport async function getItemValue(\n  provider: DeployProvider,\n  kind: DeployKind,","sourceCodeStart":817,"sourceCodeEnd":853,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/windmill-utils-internal/src/deploy.ts#L817-L853","documentation":"deleteItemInWorkspace removes a deployed item by kind, but deletion is not implemented/possible for every deployable kind. When the kind falls past all handled delete branches (script, flow, app, variable, resource, resource_type, folder, datatable_migration, trigger kinds — note schedules among others may be excluded), it throws `Deletion not supported for kind: <kind>`. This is a capability limitation, not a corrupt input.","triggerScenarios":"Calling deleteItemInWorkspace (from the sync prune/delete flow) on an item whose kind has no delete branch — e.g. attempting to delete a `schedule` or other kind unsupported for deletion via this provider path.","commonSituations":"Running `wmill sync push` with deletion enabled against items of a kind the CLI cannot delete; custom automation pruning all workspace items; a kind that exists for deploy but has no delete API wired in this CLI version.","solutions":["Skip deletion for the unsupported kind and remove it manually in the Windmill UI or via a direct API call","Upgrade the CLI — newer versions add delete support for more kinds","Filter the delete set by supported kinds before invoking deleteItemInWorkspace","Check whether the item should be archived (e.g. scripts/flows are archived) through its own API instead"],"exampleFix":"// before\nfor (const item of staleItems) await deleteItemInWorkspace(provider, item);\n\n// after\nfor (const item of staleItems) {\n  if (isTriggerKind(item.kind) || DELETABLE_KINDS.includes(item.kind)) {\n    await deleteItemInWorkspace(provider, item);\n  }\n}","handlingStrategy":"validation","validationCode":"const DELETABLE = ['script','flow','app','variable','resource','resource_type','folder','datatable_migration'];\nconst deletableItems = staleItems.filter(i => DELETABLE.includes(i.kind) || isTriggerKind(i.kind));\nconst manualItems = staleItems.filter(i => !deletableItems.includes(i));","typeGuard":"function isDeletableKind(kind: string): boolean {\n  return DELETABLE.includes(kind) || isTriggerKind(kind);\n}","tryCatchPattern":"const r = await deleteItemInWorkspace(provider, item);\nif (!r.success && r.error?.startsWith('Deletion not supported')) {\n  console.warn(`Delete ${item.path} manually in the UI`);\n}","preventionTips":["Check which kinds the CLI can delete before enabling sync deletions","Treat unsupported kinds as manual-cleanup items and surface them to the operator","Prefer archiving (scripts/flows) over deleting where the API supports it"],"tags":["deploy","deletion","cli"],"backgroundTag":"unsupported-resource-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"}