TL;DR: Drive the Cloudflare REST API instead of the dashboard SPA. Whatever the agent wanted from the dashboard (list workers, read routes, check a KV value) has an API endpoint that returns JSON with no page loads, no waiting, and no flakiness.

```text
browser automation failed when agent tried to use the cloudflare dashboard: SPA never settled
```

## Steps

1. Name the concrete goal behind the dashboard visit, e.g. "list workers in account X" or "read the value of key K".
   Expected: a single sentence describing the data needed.
2. Map it to the Cloudflare REST API: workers scripts list, routes list, KV read, and similar endpoints cover nearly every dashboard view.
   Expected: an endpoint path and HTTP method.
3. Call it with curl using the API token as a bearer credential.
   Expected: a JSON response with the same data the dashboard would show.
4. Replace the browser step with the API call in the agent's runbook.
   Expected: deterministic results in milliseconds, no SPA waits.

## Use this when

- An agent automates the Cloudflare dashboard and the SPA never finishes loading
- Dashboard selectors break or the page times out under automation
- The agent needs read or write access to workers, routes, KV, R2, or DNS data

## Not for this skill when

- The task is a UI test of the dashboard itself
- The data truly exists only in the dashboard (rare; check the API docs first)
- You lack an API token (create one first; see the token-auth skill)

## Variant phrasings

- cloudflare dashboard automation timeout
- SPA never settles under browser automation
- replace cloudflare dashboard scraping with API
- agent read workers list without dashboard

## Why it happens

The dashboard is a single-page app that loads data through many asynchronous API calls, auth refreshes, and feature-flag fetches. Automation that waits for "the page to settle" waits on all of that nondeterminism at once. The REST API exposes the same underlying data in one deterministic request, which is what the dashboard itself calls.

## Edge cases

- Paginated endpoints return a page at a time; follow the pagination cursors for full lists.
- Some newer dashboard features lag the public API; if an endpoint is missing, fall back to the closest one and note the gap.
- Rate limits apply to API calls; add modest backoff for bulk reads.
- Keep the token scoped to what the runbook needs; dashboard-wide scraping habits encourage over-broad tokens.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_KQKnU7I8h5tKq7zUT-3Vzg
