diff --git a/src/content/docs/workers/testing/local-development.mdx b/src/content/docs/workers/testing/local-development.mdx index e19bf6719c02c7..466d9a6b0dbba4 100644 --- a/src/content/docs/workers/testing/local-development.mdx +++ b/src/content/docs/workers/testing/local-development.mdx @@ -48,6 +48,7 @@ npx wrangler dev | Rate Limiting | ✅ | ✅ | | Service Bindings (multiple workers) | ✅ | ✅ | | Vectorize | ✅[^2] | ✅ | +| Workflows | ✅ | ❌ | With any bindings that are not supported locally, you will need to use the `--remote` command in wrangler, such as `wrangler dev --remote`. diff --git a/src/content/docs/workflows/build/events-and-parameters.mdx b/src/content/docs/workflows/build/events-and-parameters.mdx index 50c04d21b15380..9cbaacb195d46a 100644 --- a/src/content/docs/workflows/build/events-and-parameters.mdx +++ b/src/content/docs/workflows/build/events-and-parameters.mdx @@ -2,7 +2,7 @@ title: Events and parameters pcx_content_type: concept sidebar: - order: 10 + order: 6 --- diff --git a/src/content/docs/workflows/build/local-development.mdx b/src/content/docs/workflows/build/local-development.mdx new file mode 100644 index 00000000000000..4a5a208fe0ed18 --- /dev/null +++ b/src/content/docs/workflows/build/local-development.mdx @@ -0,0 +1,59 @@ +--- +title: Local Development +pcx_content_type: build +updated: 2024-11-27 +sidebar: + order: 8 + +--- + +Workflows support local development using [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Workers. Wrangler runs an emulated version of Workflows compared to the one that Cloudflare runs globally. + +## Prerequisites + +To develop locally with Workflows, you will need: + +- [Wrangler v3.89.0](https://blog.cloudflare.com/wrangler3/) or later. + +- Node.js version of `18.0.0` or later. Consider using a Node version manager like [Volta](https://volta.sh/) or [nvm](https://github.com/nvm-sh/nvm) to avoid permission issues and change Node versions. + +- If you are new to Workflows and/or Cloudflare Workers, refer to the [Workflows Guide](/workflows/get-started/guide/) to install `wrangler` and deploy their first Workflows. + +## Start a local development session + +Open your terminal and run the following commands to start a local development session: + +```sh +# Confirm we are using wrangler v3.89.0+ +npx wrangler --version +``` + +```sh output +⛅️ wrangler 3.89.0 +``` + +Start a local dev session + +```sh +# Start a local dev session: +npx wrangler dev +``` + +```sh output +------------------ +Your worker has access to the following bindings: +- Workflows: + - MY_WORKFLOW: MyWorkflow +⎔ Starting local server... +[wrangler:inf] Ready on http://127.0.0.1:8787/ +``` + +Local development sessions create a standalone, local-only environment that mirrors the production environment Workflows runs in so you can test your Workflows _before_ you deploy to production. + +Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to learn more about how to configure a local development session. + +## Known Issues + +Wrangler does not support `npx wrangler dev --remote`. + +Wrangler Workflow commands `npx wrangler workflow [cmd]` are not supported for local development, as they target production API. \ No newline at end of file