Skip to content

docs(deployments): add Cloudflare Workers deployment guide - #988

Closed
KiritoXDone wants to merge 1 commit into
apache:mainfrom
KiritoXDone:examples/cloudflare-workers-d1
Closed

KiritoXDone wants to merge 1 commit into
apache:mainfrom
KiritoXDone:examples/cloudflare-workers-d1

Conversation

@KiritoXDone

@KiritoXDone KiritoXDone commented Oct 20, 2026 •

Copy link
Copy Markdown

Add a Cloudflare Python Workers deployment guide using the counter application from the merged Vercel example (#605).

Closes #987. Related to #390.

Changes

  • Add POST /api/counter, accepting {"number": 5} and returning the serialized Burr State.
  • Reuse the Vercel counter graph, omitting its artificial sleep for the Workers runtime.
  • Add examples/deployment/cloudflare/ with the Python Workers entrypoint, dependency/configuration files, and local/cloud deployment instructions.

How I tested this

Installed from a clean directory with no existing dependencies or lock files. Ran the same 15 HTTP smoke checks locally and on Cloudflare, covering successful counts, invalid input, unsupported methods and unknown routes. These checks were run for this submission; no automated test files are included in the PR.

Hosted example:

curl -X POST https://burr-counter-test-20261020.kiritoxd.workers.dev/api/counter \
  -H "Content-Type: application/json" \
  -d '{"number": 5}'

Response:

{"counter": 5, "counter_limit": 5, "__SEQUENCE_ID": 5, "__PRIOR_STEP": "result"}

Existing checks run locally:

  • Python tests on Python 3.12: 704 passed, 2 skipped. This uses the main CI job's test selection, excluding tests/integrations/persisters and tests/integrations/test_bip0042_bedrock.py.
  • Example validation: 46 passed.
  • Pre-commit: all changed files passed. Repository-wide failures are noted below.

Notes

  • Burr core is unchanged. Each request starts a new counter, matching the Vercel example's scope.
  • The full-repository Black check has two pre-existing failures in the image-telephone examples; see the base commit's job. The existing documentation workflow also has a startup failure on another PR (example).
  • Tooling disclosure: this contribution and submission text were prepared with OpenAI Codex assistance.

@andreahlert, could you review this deployment example?

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered. (Changed files pass; the existing repository-wide failures are noted above.)
  • Any change in functionality is tested. (Local and hosted HTTP smoke checks, as described above.)
  • New functions are documented (with a description, list of inputs, and expected output). (The Worker handler and response helper have docstrings; the reused Vercel counter action has no docstring.)
  • Placeholder code is flagged / future TODOs are captured in comments. (N/A: no placeholder code or TODOs were added.)
  • Project documentation has been updated if adding/changing functionality.

@KiritoXDone KiritoXDone changed the title Add Cloudflare Python Workers deployment example with D1 persistence docs(deployments): add Cloudflare Workers deployment guide Oct 20, 2026
@KiritoXDone
KiritoXDone force-pushed the examples/cloudflare-workers-d1 branch from 433ff3d to 455f104 Compare October 20, 2026 09:55
Deploy the Burr counter application in Cloudflare Python Workers, with local setup and cloud deployment instructions.

Generated-by: OpenAI Codex (GPT-6)
@KiritoXDone
KiritoXDone force-pushed the examples/cloudflare-workers-d1 branch from 455f104 to ea6eaa5 Compare October 20, 2026 10:42
@github-actions github-actions Bot added the area/examples Relates to /examples label Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples Relates to /examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Cloudflare Python Workers counter deployment example

1 participant