cloudflare / cloudflare/workers-sdk

Local Explorer Workflows status endpoint diverges from the production API request schema

Closed Beginner friendly
#15,473 1 comment 0 reactions 0 assignees View on GitHub
feature:local-explorer package:miniflare product:workflows
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
186

Description

### Description

The Workflows endpoint exposed by Local Explorer uses the same path and method as production, but accepts a different request body.

Production:

PATCH /accounts/{account_id}/workflows/{workflow_name}/instances/{instance_id}/status

Body:

{ "status": "pause" }

Local Explorer:

PATCH /cdn-cgi/local/explorer/api/workflows/{workflow_name}/instances/{instance_id}/status

The current Local Explorer schema requires:

{ "action": "pause" }

This means an API client cannot switch its base URL to Local Explorer and preserve the production request. Production-compatible requests fail Local Explorer validation because action is missing.

The mismatch affects pause, resume, terminate, and restart. It also affects requests using rollback or from because those optional fields are attached to a differently named discriminator.

### Reproduction

1. Start a Miniflare dev session with a Workflow binding.
2. Create a Workflow instance.
3. Send this request to Local Explorer:

PATCH /cdn-cgi/local/explorer/api/workflows/my-workflow/instances/{id}/status
Content-Type: application/json

{ "status": "pause" }

4. Observe that Local Explorer rejects the production-compatible body and expects action instead.

Observed with the current pkg-pr Miniflare build used by cf: https://pkg.pr.new/miniflare@15401.

### Expected behavior

Local Explorer should accept the production API contract, using status rather than action, so clients only need to rewrite the API base URL/account prefix for local mode.

The relevant Local Explorer OpenAPI definition currently describes action as required and should match the production Workflows API schema.

Contributor guide

Open the contributing guide

Research direction

Start with the Local Explorer OpenAPI definition for the workflow instance status endpoint and compare its request schema with the production contract described here. Reproduce the PATCH request in a Miniflare dev session, then verify that status is accepted for pause, resume, terminate, and restart, including the optional rollback and from fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.