Skip to content

[Local-Explorer-UI] Add Workflows support#13086

Merged
petebacondarwin merged 3 commits intomainfrom
osilva/add-workflows-apis-local-ui
Mar 27, 2026
Merged

[Local-Explorer-UI] Add Workflows support#13086
petebacondarwin merged 3 commits intomainfrom
osilva/add-workflows-apis-local-ui

Conversation

@pombosilva
Copy link
Copy Markdown
Contributor

@pombosilva pombosilva commented Mar 27, 2026

Fixes WOR-1197.

  • Adds Workflows as a new resource type to the local explorer (/cdn-cgi/explorer/), replicating the production Cloudflare dashboard Workflows pages for local development
  • Implements a full workflow instance management dashboard with instance listing, detail views, step history visualization, and instance lifecycle actions
  • Adds 9 new API endpoints to the explorer worker for workflow CRUD and instance management
    • GET /workflows — list all workflows
    • GET /workflows/:name — get workflow details with instance status counts
    • GET /workflows/:name/instances — list instances with server-side pagination, sorted by creation time
    • GET /workflows/:name/instances/:id — get instance details including step history
    • POST /workflows/:name/instances — create a new instance with optional ID and params
    • PATCH /workflows/:name/instances/:id/status — change instance status (pause/resume/restart/terminate)
    • DELETE /workflows/:name/instances/:id — delete a single instance
    • DELETE /workflows/:name — delete all instances of a workflow
    • POST /workflows/:name/instances/:id/events/:type — send an event to an instance
  • The @cloudflare/workflows-shared package adds getInstanceMetadata() and readDetailedLogs() methods to the Engine DO, and populates created_on in instance metadata during creation.
image image image
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: they will be added later on
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: WIP Experimental feature

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: 7d0f52d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

✅ All changesets look good

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 27, 2026

Everything is consistently typed and used. Now let me compile my final assessment.

After a thorough review, I found the following notable items:

  1. Status counts performance on first load (getStatusCounts) - resolving all Engine DOs is O(N) on cache miss. This is documented but worth noting for large workflow sets. Not a bug per se.

  2. Module-level caches (statusCountsCache, workflowOwnerCache) - These are in-memory caches in the worker context. Since the explorer worker is long-lived, these work correctly but never get cleared except on TTL or explicit invalidation. This is an acceptable design decision.

  3. The timeAgo function is duplicated between Timestamp.tsx (private) and helpers.ts (exported). Minor duplication but not a bug.

  4. The formatTimestamp export in helpers.ts is unused dead code. Not a bug.

  5. The status as never cast in WorkflowStatusBadge usage is a minor type-safety concern but works.

The code overall is well-structured, follows the existing patterns for other resource types (KV, D1, DO, R2), has proper error handling, directory traversal protection, and correct enum value mappings. The engine changes are minimal and safe (read-only methods added to an existing DO).

I don't see any logic bugs, security issues, backward compatibility violations, or incorrect API behavior that would warrant actionable review comments.

LGTM

github run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13086

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13086

miniflare

npm i https://pkg.pr.new/miniflare@13086

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13086

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13086

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13086

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13086

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13086

wrangler

npm i https://pkg.pr.new/wrangler@13086

commit: 7d0f52d

@pombosilva pombosilva marked this pull request as ready for review March 27, 2026 05:03
@pombosilva pombosilva requested review from a team as code owners March 27, 2026 05:03
@pombosilva pombosilva requested a review from emily-shen March 27, 2026 05:03
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 27, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@pombosilva pombosilva force-pushed the osilva/add-workflows-apis-local-ui branch from 2a1af5a to 67617ac Compare March 27, 2026 10:15
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@avenceslau avenceslau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the bot's comments everything looks good to me

@pombosilva pombosilva force-pushed the osilva/add-workflows-apis-local-ui branch from 67617ac to 7d0f52d Compare March 27, 2026 10:52
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I pulled down the code and played with it locally using the fixtures/workflows Worker. Couldn't find any issues with the UI or UX. Nice stuff.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 27, 2026
@petebacondarwin petebacondarwin merged commit d4c6158 into main Mar 27, 2026
49 of 50 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 27, 2026
@petebacondarwin petebacondarwin deleted the osilva/add-workflows-apis-local-ui branch March 27, 2026 17:49
This was referenced Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants