Skip to content

fix: expose a module's Workflows in ctx.exports as their bindings (#266) - #274

Merged
ryuzdev merged 1 commit into
mainfrom
fix/workflow-exports
Nov 24, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
fix/workflow-exports

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Nov 24, 2026

Copy link
Copy Markdown
Member

A module's WorkflowEntrypoint class export is its Workflow's binding, keyed by the class name, as workerd keys it: ctx.exports.Slow is a [object WrappedBinding] over the same instance store env.SLOW reaches, in a Durable Object as in a stateless entrypoint. Reserved alias names stay hidden; configs naming one class for two workflows (or default) are refused at deploy, as workerd refuses them.

Gate: workflow-exports + workflow-exports-do fail before (500: no ctx.exports.Slow) and all 246 cases agree after. Full suite, clippy, fmt and docs check green.

Closes #266

- A `WorkflowEntrypoint` class export is its Workflow's binding, keyed by
  the class name as workerd keys it: `ctx.exports.Slow` is a
  `[object WrappedBinding]` (a `WorkflowImpl` over the shared
  `WrappedBinding` level, `create`/`createBatch`/`deleteBatch`/`get` on the
  prototype, no own property), a distinct object over the same instance
  store `env.SLOW` reaches, in a Durable Object as in a plain Worker.
- `env.<binding>` reflects workerd's binding shape too: the workflow name
  moved from an own `_workflowName` property into a private slot, and the
  private `_create` helper off the prototype.
- A config naming one class for two workflows, or naming `default`, is
  refused at deploy, as workerd refuses it (the class name is the key, and
  `default` is the Worker's handler).
- Gate: new `workflow` fixture with `workflow-exports` and
  `workflow-exports-do`, both failing before this change (500: no
  `ctx.exports.Slow`). 242 cases agree.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e8186d44-11ae-43ab-ac16-22dda383fc51
Commits

Reviewing files that changed from the base of the PR and between f1051db and b725eaa.

Files selected for processing: 8

  • crates/cello/deploy.rs
  • crates/cello/js/harness.js
  • docs/changelog.md
  • docs/reference/cloudflare-compat.md
  • docs/services/workflows.md
  • scripts/workerd-diff/cases.mjs
  • scripts/workerd-diff/corpus/workflow/index.js
  • scripts/workerd-diff/corpus/workflow/wrangler.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ryuzdev
ryuzdev merged commit 4385913 into main Nov 24, 2026
9 checks passed
@ryuzdev
ryuzdev deleted the fix/workflow-exports branch November 24, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workerd diff: ctx.exports omits a module's WorkflowEntrypoint classes (workerd exposes the workflow binding)

1 participant