Skip to content

Commit a56b13c

Browse files
authored
Workflows: added wrangler local dev page (#18448)
* added wrangler local dev page * better know issues
1 parent 696e6a3 commit a56b13c

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

src/content/docs/workers/testing/local-development.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ npx wrangler dev
4848
| Rate Limiting |||
4949
| Service Bindings (multiple workers) |||
5050
| Vectorize |[^2] ||
51+
| Workflows |||
5152

5253
With any bindings that are not supported locally, you will need to use the `--remote` command in wrangler, such as `wrangler dev --remote`.
5354

src/content/docs/workflows/build/events-and-parameters.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Events and parameters
33
pcx_content_type: concept
44
sidebar:
5-
order: 10
5+
order: 6
66

77
---
88

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: Local Development
3+
pcx_content_type: build
4+
updated: 2024-11-27
5+
sidebar:
6+
order: 8
7+
8+
---
9+
10+
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.
11+
12+
## Prerequisites
13+
14+
To develop locally with Workflows, you will need:
15+
16+
- [Wrangler v3.89.0](https://blog.cloudflare.com/wrangler3/) or later.
17+
18+
- 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.
19+
20+
- 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.
21+
22+
## Start a local development session
23+
24+
Open your terminal and run the following commands to start a local development session:
25+
26+
```sh
27+
# Confirm we are using wrangler v3.89.0+
28+
npx wrangler --version
29+
```
30+
31+
```sh output
32+
⛅️ wrangler 3.89.0
33+
```
34+
35+
Start a local dev session
36+
37+
```sh
38+
# Start a local dev session:
39+
npx wrangler dev
40+
```
41+
42+
```sh output
43+
------------------
44+
Your worker has access to the following bindings:
45+
- Workflows:
46+
- MY_WORKFLOW: MyWorkflow
47+
⎔ Starting local server...
48+
[wrangler:inf] Ready on http://127.0.0.1:8787/
49+
```
50+
51+
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.
52+
53+
Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to learn more about how to configure a local development session.
54+
55+
## Known Issues
56+
57+
Wrangler does not support `npx wrangler dev --remote`.
58+
59+
Wrangler Workflow commands `npx wrangler workflow [cmd]` are not supported for local development, as they target production API.

0 commit comments

Comments
 (0)