Skip to content

Local Development

Last reviewed: 25 days ago

Workflows support local development using Wrangler, 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 or later.

  • Node.js version of 18.0.0 or later. Consider using a Node version manager like Volta or nvm to avoid permission issues and change Node versions.

  • If you are new to Workflows and/or Cloudflare Workers, refer to the Workflows 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:

Terminal window
# Confirm we are using wrangler v3.89.0+
npx wrangler --version
⛅️ wrangler 3.89.0

Start a local dev session

Terminal window
# Start a local dev session:
npx wrangler dev
------------------
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 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.