Skip to content

[miniflare] Add workflow introspection for exported Workflows - #17016

Merged
edmundhung merged 2 commits into
mainfrom
edmundhung/miniflare-introspect-exported-workflows
Nov 19, 2026
Merged

edmundhung merged 2 commits into
mainfrom
edmundhung/miniflare-introspect-exported-workflows

Conversation

@edmundhung

Copy link
Copy Markdown
Member

Part of RM-31812. The cf test harness (#16798) is stacked on this.

Adds unsafeIntrospectWorkflow(workerName, className) and unsafeIntrospectWorkflowInstance(workerName, className, instanceId), so Node.js code can introspect a Workflow that a Worker exports, including one only on ctx.exports, without an env binding. Introspection through a binding, as in the Vitest plugin, is unchanged.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: these are unsafe Miniflare methods for the cf test harness

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 50c300a

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

This PR includes changesets to release 8 packages
Name Type
miniflare Minor
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
wrangler Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@17016

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@17016

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@17016

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@17016

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@17016

create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@17016

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@17016

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@17016

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@17016

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@17016

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@17016

wrangler

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

commit: 50c300a

@edmundhung edmundhung changed the title [miniflare] Add unsafeIntrospectWorkflow() for exported Workflows [miniflare] Add workflow introspection for exported Workflows Nov 18, 2026
@edmundhung
edmundhung marked this pull request as ready for review November 19, 2026 11:21
@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team November 19, 2026 11:21
@workers-devprod

workers-devprod commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers
  • packages/workflows-shared/src/binding.ts: [@cloudflare/workflows]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Superseded by the review of 7920aaed.

This review, of 161ab5dd

✅ Approved — No issues found. The new exported-Workflow introspection methods are small and checked against the Worker's exports, and they come with tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No issues found.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 161ab5dd

@edmundhung
edmundhung force-pushed the edmundhung/miniflare-introspect-exported-workflows branch from 161ab5d to 7920aae Compare November 19, 2026 12:49

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Superseded by the review of 50c300a1.

This review, of 7920aaed

✅ Approved — No issues found. The new exported-Workflow introspection methods are small and checked against the Worker's exports, and they come with tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No issues found.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 7920aaed — same changes as 161ab5dd, so this is that commit's review (no new review was run; line numbers are as of 161ab5dd)

…owInstance() for exported Workflows

Node.js could only introspect a Workflow through an `env` binding from
getBindings(), so a Workflow only on `ctx.exports` couldn't be introspected.
Each exported Workflow now has a proxy binding, found by its Worker and class
name.
@edmundhung
edmundhung force-pushed the edmundhung/miniflare-introspect-exported-workflows branch from 7920aae to 50c300a Compare November 19, 2026 16:48
@edmundhung
edmundhung removed this pull request from stack #17018 November 19, 2026 16:49
@edmundhung
edmundhung added this pull request to stack #17058 November 19, 2026 16:49

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Approved — No issues found. The new exported-Workflow introspection methods are small and checked against the Worker's exports, and they come with tests.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No issues found.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 50c300a1 — same changes as 161ab5dd, so this is that commit's review (no new review was run; line numbers are as of 161ab5dd)

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners bypass

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@edmundhung
edmundhung merged commit 8f45554 into main Nov 19, 2026
88 checks passed
@edmundhung
edmundhung deleted the edmundhung/miniflare-introspect-exported-workflows branch November 19, 2026 17:07
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Nov 19, 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.

3 participants