ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

cf-workers-logs

Query Cloudflare Workers Observability logs via API. Use when the user asks to check logs, debug Workers, look up errors, or investigate Worker/Durable Object/Workflow behavior. Triggers on keywords like "check logs", "worker logs", "look up error", "debug worker".

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/adahubble/cf-workers-logs
Or

Query Cloudflare Workers Observability Logs

Query the CF Workers Observability API to retrieve structured logs from any Workers, Durable Objects, Workflows, Queues, and Cron Triggers in your Cloudflare account.

Prerequisites

Set these environment variables (e.g. in your project's .env or shell profile):

  • CF_OBSERVABILITY_ACCOUNT_ID — your Cloudflare account ID
  • CF_OBSERVABILITY_API_TOKEN — API token with Workers Observability read permission

API Endpoint

POST https://api.cloudflare.com/client/v4/accounts/{accountId}/workers/observability/telemetry/query
Authorization: Bearer {apiToken}
Content-Type: application/json

Request Body Format

{
  "queryId": "cc-{timestamp}",
  "timeframe": {
    "from": "<unix_ms_start>",
    "to": "<unix_ms_end>"
  },
  "view": "events",
  "limit": 50,
  "parameters": {
    "filters": [
      {"key": "<field>", "operation": "<op>", "type": "<type>", "value": "<value>"}
    ],
    "filterCombination": "and",
    "calculations": [],
    "groupBys": [],
    "needle": {"value": "<search_text>", "isRegex": false, "matchCase": false},
    "limit": 50
  }
}

Filter Operations

  • String: eq, neq, includes, doesNotInclude, startsWith, regex, exists, doesNotExist
  • Number: eq, neq, gt, gte, lt, lte, exists, doesNotExist

Standard Fields

FieldTypeDescription
$workers.scriptNamestringWorker script name
$workers.outcomestringok / exception
$workers.entrypointstringEntrypoint class (Worker, DO, Workflow)
$workers.eventTypestringfetch, rpc, queue, scheduled, alarm
msgstringLog message
levelstringLog level (log, info, warn, error)
errorstringError message
statusnumberHTTP status code

Any custom fields logged via console.log({ key: value }) are also queryable as top-level fields.

Full-text Search

Use needle.value for free-text search across all fields. Useful when you don't know which field contains the value.

How to Execute

Use Bash with curl to call the API. Do NOT use WebFetch (it processes through an AI model and loses structure).

Step 1: Read credentials

Read CF_OBSERVABILITY_ACCOUNT_ID and CF_OBSERVABILITY_API_TOKEN from environment variables. If not set in the shell, search for them in project .env files:

grep -r 'CF_OBSERVABILITY_' --include='.env' --include='.env.*' . 2>/dev/null

Step 2: Build and execute query

Construct the curl command based on the user's request. Default time range: last 1 hour. Default limit: 30.

Step 3: Format output

Parse the JSON response and format as a timeline:

{timestamp} [{level}] [{scriptName}/{entrypoint}] {msg}
         {extra fields if present: error=, status=, eventType=}

Metadata

Author@adahubble
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-adahubble-cf-workers-logs": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.