Skip to content

docs: worker page restrcture - #5001

Open
lennessyy wants to merge 4 commits into
mainfrom
worker-pages-four-sdks
Open

docs: worker page restrcture #5001
lennessyy wants to merge 4 commits into
mainfrom
worker-pages-four-sdks

Conversation

@lennessyy

@lennessyy lennessyy commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Finishes the Worker page restructure started in #4980, then fixes what a reader's-path pass turned up across all seven pages. PHP is left alone.

Depends on temporalio/features#861, which adds the snippets the Java, .NET, and Ruby pages pull from. Merge it first, or the next yarn snipsync run will empty them.

Restructure: Java, .NET, Ruby, Rust

These four get the same six sections as the Go, Python, and TypeScript pages: create and run, register types, connect to Cloud, configure options, run a versioned Worker, shut down.

  • Adds a versioned Worker section. None of the four documented Worker Versioning.
  • Java, .NET, and Ruby move to snipsync snippets. Rust stays inline, since the features repo has no Rust harness.
  • Rust is rewritten against temporalio-sdk 0.5.0. The previous code did not compile.
  • Existing anchor IDs are preserved.

Every Worker was built and run against a local dev server and completed a Workflow, both basic and versioned: Java 1.30.1, .NET 1.17.0, Ruby 1.6.0, Rust 0.5.0. That turned up one constraint, now documented on each page: a versioning behavior is only valid on a Worker with versioning enabled. Otherwise the server rejects the Workflow Task and it retries indefinitely rather than failing.

Fixes: all seven pages

Reading each page top to bottom as a first-time reader found several places where the prose assumed something the reader had not been shown yet.

  • .NET told readers to cancel "the token passed to ExecuteAsync()" when the only token they had passed was CancellationToken.None. Shutting a Worker down is a start-time decision in .NET, so that section now shows creating a CancellationTokenSource.
  • Python used interrupt_event in the shutdown snippet without ever defining it. The SNIPSTART boundary excludes the enclosing function that declares it, so the page now shows the entry point that sets the event.
  • Python claimed the Worker "runs until the process is interrupted." run() installs no signal handlers and polls until shutdown() is called.
  • TypeScript capitalized operating system signals as "Signals," which collides with the Temporal term for a message to a running Workflow.
  • Go and TypeScript each documented only one of the two ways to set a versioning behavior. Both now cover the per-Workflow and Worker-level options.
  • Every page said a Task for an unregistered type fails and "the Workflow Execution itself does not fail." That holds for Workflow Tasks but not Activity Tasks, where the SDK fails the Task so it retries and an exhausted Retry Policy can fail the Workflow. The section now leads with the fact that a Task Queue does not route by type, which is why the rule exists.
  • .NET loses its dependency injection section. Temporalio.Extensions.Hosting is a separate package, its DI applies to Activities and never to Workflows, and the section implied otherwise by registering a Workflow in the same chain. Nothing linked to the anchor.
  • TypeScript loses the hedging in its older Docker content. Two of those phrasings hid the actual fact: the Node.js memory default misbehaves in Docker because it reads the host's memory rather than the container limit, and a distroless build fails outright because npm is absent.
  • Smaller items: an ambiguous "It" in the Go and .NET shutdown sections, a paragraph in TypeScript restating the registration rule from the following section, and Rust's Cargo.toml appearing after the code that needs it.

yarn build passes with no broken links or anchors, and Vale CI-scoped is clean.

Unrelated break

yarn snipsync fails on main for everyone. snipsync.config.yaml pins samples-dotnet to ea/aws-lambda, which has been deleted. Not fixed here.

🤖 Generated with Claude Code

┆Attachments: EDU-6856 Restructure the Java, .NET, Ruby, and Rust Worker pages

Gives all four pages the same six sections as the Go, Python, and TypeScript
pages: create and run, register types, connect to Cloud, configure options,
run a versioned Worker, shut down.

- Adds a versioned Worker section. None of these pages documented Worker
  Versioning.
- Replaces hand-written code with snipsync snippets for Java, .NET, and Ruby.
  Rust stays inline because the features repo has no Rust harness.
- Notes that a versioning behavior only applies on a Worker with versioning
  enabled. Declaring one without it makes the server reject the Workflow Task.
- Rewrites the Rust page against temporalio-sdk 0.5.0. The previous code used
  execute_activity, which only exists on the SDK's unreleased main branch, and
  omitted the ? that register_workflow requires.

Existing anchor IDs are preserved because other pages link to them.

Every Worker was run against a local dev server and completed a Workflow.

Snippet bodies for Java, .NET, and Ruby come from temporalio/features#861 and
need that PR merged before the next snipsync run.
@lennessyy
lennessyy requested a review from a team as a code owner July 31, 2026 01:58
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview Jul 31, 2026 10:03pm

Request Review

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

- .NET: the shutdown section referred to "the token passed to ExecuteAsync()"
  when the reader had only ever passed CancellationToken.None. Shutting a Worker
  down is a start-time decision in .NET, so the section now shows creating a
  CancellationTokenSource and passing its Token, and the first section explains
  what CancellationToken.None does instead of only warning against it.
- Rust: move the Cargo.toml dependencies ahead of the code that needs them, and
  rename "Register types" to match the other pages. The anchor comment sets the
  heading id, so #register-types is unchanged.
- Ruby: tighten the run_all description, and move the shutdown_signals and
  cancellation details into the shutdown section rather than forward-referencing
  them from the first section.
Follow-up to #4980, applying the same pass done for the other four SDKs.

- Python: the shutdown snippet used interrupt_event, which the page never
  defined. The SNIPSTART boundary in the features repo excludes the enclosing
  function that declares it. Adds the entry point that sets the event.
- Python: run() installs no signal handlers and polls until shutdown() is
  called, so "the Worker runs until the process is interrupted" was inaccurate.
- TypeScript: lowercase the operating system signals. Signal is a Temporal core
  term, so the capitalized form read as a Workflow Signal.
- TypeScript: drop the paragraph in the first section that restated the
  registration rule the next section already states, and document per-Workflow
  versioningBehavior through setWorkflowOptions.
- Go: document DefaultVersioningBehavior, that it requires UseVersioning, and
  that a Workflow with no behavior fails at registration time.
- Go: name the Worker instead of "It" in the shutdown section.
@lennessyy lennessyy changed the title Restructure the Java, .NET, Ruby, and Rust Worker pages Restructure four Worker pages and fix reader-path issues on the other three Jul 31, 2026
@lennessyy lennessyy changed the title Restructure four Worker pages and fix reader-path issues on the other three docs: worker page restrcture Jul 31, 2026
The registration section on all seven pages said a Task for an unregistered
type fails and "The Workflow Execution itself does not fail." The second half
holds for Workflow Tasks but not Activity Tasks: sdk-go fails an unregistered
Activity Task deliberately so it retries, and exhausting the Activity's Retry
Policy can fail the Workflow. Drops that claim and states up front that a Task
Queue does not route by type, which is why the same-registration rule exists at
all.

Removes the .NET dependency injection section. Temporalio.Extensions.Hosting is
a separate package, DI there applies to Activities and never to Workflows, and
the section implied otherwise by registering a Workflow in the same chain.
Nothing linked to the anchor.

Cuts hedging from the TypeScript page, most of it in the older Docker content:
"you might want to," "it is generally possible," "we recommended," "it's
probably because." Two of those hid the actual fact. The Node.js memory default
is wrong in Docker because it reads the host's memory rather than the container
limit, and a distroless build fails outright because npm is absent, rather than
"might result in various error messages."
[`NODE_OPTIONS` environment variable](https://nodejs.org/api/cli.html#node_optionsoptions).
Pass this argument through the [`NODE_OPTIONS` environment variable](https://nodejs.org/api/cli.html#node_optionsoptions).

### Do not use Alpine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Temporal.Headings] 'Do not use Alpine' should use sentence-style capitalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant