Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/content/docs/workers/testing/local-development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Events and parameters
pcx_content_type: concept
sidebar:
order: 10
order: 6

---

Expand Down
59 changes: 59 additions & 0 deletions src/content/docs/workflows/build/local-development.mdx
Original file line number Diff line number Diff line change
@@ -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.
Loading