Local Development
Queues support local development workflows using Wrangler, the command-line interface for Workers. Wrangler runs the same version of Queues as Cloudflare runs globally.
To develop locally with Queues, you will need:
-
Wrangler v3.1.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 Queues and/or Cloudflare Workers, refer to the Queues tutorial to install
wrangler
and deploy their first Queue.
Open your terminal and run the following commands to start a local development session:
npx wrangler@latest dev
------------------Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development.
Your worker has access to the following bindings:- Queues: <QUEUE-NAME>
Local development sessions create a standalone, local-only environment that mirrors the production environment Queues runs in so you can test your Workers before you deploy to production.
Refer to the wrangler dev
documentation to learn more about how to configure a local development session.
Wrangler supports running multiple Workers simultaneously with a single command. If your architecture separates the producer and consumer into distinct Workers, you can use this functionality to test the entire message flow locally.
For example, if your project has the following directory structure:
producer-worker/├── wrangler.jsonc├── index.ts└── consumer-worker/ ├── wrangler.jsonc └── index.ts
You can start development servers for both workers with the following command:
npx wrangler@latest dev -c wrangler.jsonc -c consumer-worker/wrangler.jsonc --persist-to .wrangler/state
When the producer Worker sends messages to the queue, the consumer Worker will automatically be invoked to handle them.
- Queues does not support Wrangler remote mode (
wrangler dev --remote
).
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark