[wrangler] Add Workflows local commands#13097
Conversation
🦋 Changeset detectedLatest commit: d9d1c04 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 |
|
✅ All changesets look good |
769b2fb to
7f9f82a
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
OK - For After thorough review, I don't find any actionable bugs, security issues, backward compatibility violations, or incorrect API behavior. The code is well-structured, properly uses LGTM |
7f9f82a to
ef9eb32
Compare
ef9eb32 to
1476698
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
Approved but I think it would be helpful to add some tests to the workflows fixture that spin up a local wrangler dev and then separately run local wrangler workflow commands against it.
This would give additional confidence that the MSW config is not out of sync.
|
Thanks @petebacondarwin ! Added some fixtures tests to hit the local commands. |
4757d26 to
d9d1c04
Compare
Fixes WOR-384.
Adds
--localsupport to all Workflows CLI commands, allowing them to interact with a running wrangler dev session via the/cdn-cgi/explorer/api/workflowsendpoints.Commands:
wrangler workflows list --localwrangler workflows describe <name> --localwrangler workflows trigger <name> [params] --localwrangler workflows delete <name> --localwrangler workflows instances list <name> --localwrangler workflows instances describe <name> [id] --localwrangler workflows instances pause <name> <id> --localwrangler workflows instances resume <name> <id> --localwrangler workflows instances restart <name> <id> --localwrangler workflows instances terminate <name> <id> --localwrangler workflows instances send-event <name> <id> --type <type> --localAll commands also accept --port (defaults to 8787) to target a specific wrangler dev session.
NOTE:
Here commands default to production Workflows. Only by adding
--localwe would be hitting dev Workflows. This is because local and remote here are fundamentally different contexts (as opposed to KV, R2, D1). Remote commands operate on deployed Workflows only. And local commands operate on a running dev session.We have no "remote mode from local".
--local-> opt-in to target a dev sessionA picture of a cute animal (not mandatory, but encouraged)