Skip to main content
Deploy your Restate services on Cloudflare Workers. This guide covers project configuration, service registration, and security setup.
Follow the quickstart to try Cloudflare Workers and Restate locally.

Deploying to Cloudflare Workers

1

Set up your project

Start with the cloudflare-workers-template and follow its README.
Create your Restate + CloudFlare workers repository
A Workers dev server can be started on port 9080 using:
Register the service with Restate:
wrangler only supports HTTP/1.1 when running locally, so the --use-http1.1 flag is required. This flag is not needed when deploying to Cloudflare Workers.
2

Secure your service with request identity validation

Cloudflare Workers are public HTTP endpoints. Secure your service with request identity validation so that it only accepts requests from the Restate environment you trust.
Restate Cloud and BYOC environments create and manage the request identity key for you.Copy the environment’s public key from Developers > Security > HTTP endpoints in the Restate Cloud UI.
Configure the key in your Restate SDK endpoint before deploying.
The public key is not secret, so it is safe to include it directly in your service source code or configuration files.
3

Deploy your Worker

Deploy the Worker after configuring request identity validation:
4

Register the service to Restate

After deploying to Cloudflare Workers, use Preview URLs so Restate can target specific service versions. Copy the url of the version, as highlighted here:
Cloudflare Preview URL
Register the service with Restate via the UI:
Cloudflare Registration
Or register the service with the CLI:
5

Send your first request

You’re set up! Go to the Overview page > Greeter > Playground and start sending requests to your service.
Send {"name": "Alice"} as the request body to the service.

CI/CD Automation

To automatically deploy to Cloudflare Workers on each git commit to main and automatically register new Restate service versions:
If you’ve followed the steps above, then you already have the GitHub Actions workflow set up. All you need to do is to add the secrets below to your project.
Make sure your Cloudflare Worker project exists before the first workflow run. If it does not, create it with npx wrangler deploy.
This workflow needs the following GitHub Actions repository secrets:
Token setup