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.

Set up your project

  • New project
  • Existing Cloudflare Workers project

Local development

A Workers dev server can be started on port 9080 using:
wrangler dev --port 9080
Register the service with Restate:
npx @restatedev/restate deployments register --use-http1.1 http://localhost:9080
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.

Register the service to Restate

After deploying to Cloudflare Workers, register the service with Restate CLI or UI providing Preview URLs to target specific service versions:
npx @restatedev/restate deployments register \
  https://<VERSION_PREFIX OR ALIAS>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev
You’re set up. Head over to the Overview page > Greeter > Playground and start sending requests to your service.

Restate identity keys (for Restate Cloud)

To allow only a specific Restate Cloud environment to send requests to your Cloudflare Workers deployment, head over to your Restate Cloud Dashboard to set up Restate identity keys.

Restate Cloud > Developers > Security

Set up Restate identity keys

CI/CD Automation

To automatically deploy to Cloudflare Workers on each git commit to main and automatically register new Restate service versions:
name: Deploy Worker
on:
  push:
    branches:
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v5
      - run: npm ci

      - name: Build & Deploy Worker
        uses: cloudflare/wrangler-action@v3
        id: deploy
        with:
          # Check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          # Add a message to the deployment with the commit
          command: versions upload --message "Deployed via GitHub Actions - commit ${{ github.sha }}"
      - name: Get deployment URL
        id: get-url
        env:
          WRANGLER_OUTPUT: ${{ steps.deploy.outputs.command-output }}
        run: |
          URL=$(echo "$WRANGLER_OUTPUT" | awk '/Version Preview URL:/ {gsub(/.*Version Preview URL: /, ""); print}')
          echo "deployment-url=$URL" >> $GITHUB_OUTPUT

      - name: Register Restate deployment
        env:
          RESTATE_ADMIN_URL: ${{ secrets.RESTATE_ADMIN_URL }}
          RESTATE_AUTH_TOKEN: ${{ secrets.RESTATE_AUTH_TOKEN }}
        run: npx -y @restatedev/restate deployment register -y ${{ steps.get-url.outputs.deployment-url }}
Make sure your Cloudflare Worker project exists. If it doesn’t, create it with: npx wrangler deploy
For this workflow to execute, you need to add the following GitHub Actions repository secrets: Token setup
You can use this workflow with Self-hosted Restate as well, just make sure to correctly set up RESTATE_AUTH_TOKEN and RESTATE_ADMIN_URL to reach your Restate cluster.
I