Skip to content

Various workflows bug fixes - #265

Open
hoodmane wants to merge 8 commits into
cloudflare:mainfrom
hoodmane:hoodmane/workflow-fixes
Open

hoodmane wants to merge 8 commits into
cloudflare:mainfrom
hoodmane:hoodmane/workflow-fixes

Conversation

@hoodmane

Copy link
Copy Markdown
Contributor

This commit series fixes a bunch of minor bugs in workflows. I can split them into separate PRs if the reviewers prefer, otherwise we should merge not squash.

… serialization

With the `enhanced_error_serialization` compat flag, on since compat
date 2026-04-21, a PythonError tunneled over RPC keeps `name == "PythonError"`
and its message is the bare traceback, rather than a plain Error whose message
starts with "PythonError: ".

This updates `_from_js_error` to account for it.
… step name

The Workflows engine allows the same step name to be used more than once, but
the Python wrapper tracked in-flight tasks and memoised results by name. Two
same-named steps running concurrently raised KeyError when the second one
finished, and could observe each other's results.
…ith the SDK

wrangler registers `.js`/`.mjs` files under `python_modules/workers/` as ES modules,
so JavaScript can ship inside the `workers` package and be loaded at runtime.
…n-retryable

The Workflows engine decides whether to retry a failed step from the JS error's
name. A Python exception reaches it as a Pyodide PythonError whose message is the
traceback, so `workers.workflows.NonRetryableError` was silently retried like any
other error.  This adds a new workflows.js shim that fixes the translation of
NonRetryableError to JavaScript so this works correctly.
@ryanking13

Copy link
Copy Markdown
Contributor

Could you please split feat(runtime-sdk): Add helpers to import JavaScript modules shipped with the SDK and later to a separate PR? I would like to discuss a little bit on how we should do it (#90). Since import_from_javascript doesn't work for 0.26.0a2.

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.

2 participants