windmill-labs/windmill · error

Deletion not supported for kind: ${kind}

Error message

Deletion not supported for kind: ${kind}

What it means

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.

Source

Thrown at cli/windmill-utils-internal/src/deploy.ts:835

    } else if (kind === "resource") {
      await provider.deleteResource({ workspace, path });
    } else if (kind === "resource_type") {
      await provider.deleteResourceType({ workspace, path });
    } else if (kind === "folder") {
      await provider.deleteFolder({ workspace, name: folderName(path) });
    } else if (kind === "schedule") {
      await provider.deleteSchedule({ workspace, path });
    } else if (kind === "datatable_migration") {
      const { datatable, timestamp } = parseDatatableMigrationDeployPath(path);
      await provider.deleteDatatableMigration({
        workspace,
        datatableName: datatable,
        timestamp,
      });
    } else if (isTriggerKind(kind)) {
      await provider.deleteTriggerByKind(kind, { workspace, path });
    } else {
      throw new Error(`Deletion not supported for kind: ${kind}`);
    }
    return { success: true };
  } catch (e: unknown) {
    return { success: false, error: toError(e) };
  }
}

// ---------------------------------------------------------------------------
// getOnBehalfOf
// ---------------------------------------------------------------------------

/**
 * Get the value of an item for diff comparison.
 * Returns a normalized representation suitable for JSON comparison.
 */
export async function getItemValue(
  provider: DeployProvider,
  kind: DeployKind,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Skip deletion for the unsupported kind and remove it manually in the Windmill UI or via a direct API call
  2. Upgrade the CLI — newer versions add delete support for more kinds
  3. Filter the delete set by supported kinds before invoking deleteItemInWorkspace
  4. Check whether the item should be archived (e.g. scripts/flows are archived) through its own API instead

Example fix

// before
for (const item of staleItems) await deleteItemInWorkspace(provider, item);

// after
for (const item of staleItems) {
  if (isTriggerKind(item.kind) || DELETABLE_KINDS.includes(item.kind)) {
    await deleteItemInWorkspace(provider, item);
  }
}
Defensive patterns

Strategy: validation

Validate before calling

const DELETABLE = ['script','flow','app','variable','resource','resource_type','folder','datatable_migration'];
const deletableItems = staleItems.filter(i => DELETABLE.includes(i.kind) || isTriggerKind(i.kind));
const manualItems = staleItems.filter(i => !deletableItems.includes(i));

Type guard

function isDeletableKind(kind: string): boolean {
  return DELETABLE.includes(kind) || isTriggerKind(kind);
}

Try / catch

const r = await deleteItemInWorkspace(provider, item);
if (!r.success && r.error?.startsWith('Deletion not supported')) {
  console.warn(`Delete ${item.path} manually in the UI`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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