Fix Workflows docs code & API errors#28188
Merged
Merged
Conversation
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
ask-bonk
Bot
requested review from
celso,
elithrar,
jonesphillip and
mia303
as code owners
February 8, 2026 16:12
Closed
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Collaborator
|
/bonk Great.
Revert the skill files - out of scope. then thoroughly self-review all code and prose to make sure your fixes are valid |
Contributor
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
Contributor
Author
|
Here's a summary of what was done: Reverted (out of scope)
Fix 1: Reverted skill filesAll 4 skill reference files have been restored to their original (pre-PR) state. Fix 2: Variable shadowing in changelog
Self-review of all remaining doc changesEvery other change from the original PR was verified correct:
|
elithrar
enabled auto-merge (squash)
February 8, 2026 16:30
elithrar
approved these changes
Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a summary of all changes made across 9 files:
Summary of Changes
Documentation fixes (
src/content/docs/workflows/)build/rules-of-workflows.mdx(main target of the issue):.append()to.push()— JavaScript arrays don't have.append()(2 occurrences)env.KVtothis.env.KV— bindings insideWorkflowEntrypointclasses must usethis.env(12 occurrences)const myRandomdeclarations — renamed tobadRandom/goodRandomconst myNewInstancedeclarations — renamed tobadInstance/goodInstance/instancelet instancesdeclarations — renamed tocreatedInstancesconst issuesdeclarations — renamed tobadIssues/goodIssuesDate.nowtoDate.now()— missing function call parenthesescreateBatchis idempotent (consistent with workers-api.mdx documentation)build/sleeping-and-retrying.mdx:awaitonstep.do()call in retry config example/* Step code goes here /*to/* Step code goes here */)on the same linecatch(e as Error)tocatch (e)— TypeScript catch clauses don't useasbuild/events-and-parameters.mdx:awaiton twostep.do()calls{ /* your code here */ )to{ /* your code here */ })let eventshadowing therun()parameter — renamed tostripeEventbuild/workers-api.mdx:sleepUntildocs: "seconds from the Unix epoch" to "milliseconds" (consistent withDate.parse()return value andsleeping-and-retrying.mdx)let eventshadowing therun()parameter — renamed tostripeEventChangelog fix
changelog/workflows/2025-04-07-workflows-ga.mdx:import { Workflow, WorkflowEvent } from "cloudflare:workflows"toimport { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from "cloudflare:workers"(consistent with all other docs)Skills reference fixes (
skills/cloudflare/references/workflows/)api.md:waitForEventoption key fromeventtotype(2 occurrences)event.paramstoevent.payload(2 occurrences)NonRetryableErrorimport fromcloudflare:workerstocloudflare:workflowsretentionparameter fromcreate()(not part of the API)patterns.md:waitForEventoption key fromeventtotype(2 occurrences)event.paramstoevent.payload(7 occurrences)Promise.racepattern to wrap instep.do()(consistent with rules-of-workflows guidance)gotchas.md:README.md:event.paramstoevent.payloadAmbiguities for the issue author (@elithrar)
fetch()Response examples in rules-of-workflows (e.g.,return await fetch(...)from astep.do) return aResponseobject which is not serializable. These are demonstrative examples focusing on other concepts, but could mislead developers who copy them directly. Consider adding a.json()or.text()call in a follow-up..get()example near line 624 doesn't null-check the result before calling.json(). Minor, but could fail at runtime if the key doesn't exist.Closes #28185
github run