Cloudflare KV icon

Cloudflare KV

Store and retrieve data from Cloudflare Workers KV.

Overview

This node integrates with Cloudflare Workers KV, a key-value storage system, allowing users to manage namespaces and key-value pairs within those namespaces. Specifically, the Namespace Delete operation deletes an existing KV namespace by its ID.

Use cases include:

  • Cleaning up unused or obsolete namespaces in your Cloudflare KV store.
  • Automating namespace lifecycle management as part of deployment or maintenance workflows.

Example: You have a namespace used for temporary caching during a project phase; once the project ends, you can delete that namespace programmatically using this node.

Properties

Name Meaning
Namespace ID The ID of the namespace to delete

Output

The output JSON contains a confirmation of the deletion:

{
  "success": true,
  "namespaceId": "<deleted_namespace_id>"
}

This indicates the namespace was successfully deleted. No binary data is produced by this operation.

Dependencies

  • Requires a valid Cloudflare API authentication token with permissions to manage KV namespaces.
  • The node uses the Cloudflare REST API endpoint for KV namespaces under the account specified by the credentials.
  • Proper configuration of the API key credential in n8n is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing namespace ID will cause the API call to fail.
    • Insufficient permissions on the API token may result in authorization errors.
    • Network connectivity problems can prevent successful API requests.
  • Error messages:

    • If the namespace does not exist or is already deleted, the API might return a 404 error.
    • Authorization failures typically return 401 or 403 HTTP status codes.
  • Resolution:

    • Verify the namespace ID is correct and exists.
    • Ensure the API token has the required permissions for namespace deletion.
    • Check network access and retry if transient errors occur.

Links and References

Discussion