Cloudflare Link Shortener icon

Cloudflare Link Shortener

CRUD de links curtos no Workers KV. Com provisionamento automático: cria namespace, publica Worker de redirect e associa o hostname da Base da URL curta na Cloudflare.

Obter

AI-generated

Summary

Retrieve the stored link record for a given slug from Cloudflare Workers KV, optionally ensuring that the necessary KV namespace and Worker infrastructure are provisioned automatically before fetching.

Inputs

  • Provisionar infra automaticamente — If enabled, automatically ensures the KV namespace, publishes the redirect Worker, and registers the hostname for the short URL base in the Cloudflare account. Requires an API token with permissions for Workers KV, Workers Scripts, and creating Worker domains.
  • Slug (required) — The short path (e.g., campanha-natal) that designates the key in Workers KV. Appears as /slug on your domain.

Output shape

a single record per input item containing the slug, the full short URL, and the stored record fields: url (destination URL), active (boolean), mode ('redirect' or 'mask'), and optionally created_at, updated_at, and clicks.

Throws an error if the slug is not found. If 'Provisionar infra automaticamente' is enabled, provision steps run once per workflow execution and may add delay on first use.

Examples

Example 1: Get a stored short link record

Set operation to 'Obter' (Get), provide the slug to query, and optionally enable auto-provisioning of infrastructure.

Links

Discussion