Skip to content

Document Dynamic Worker connectors - #54

Closed
tnkuehne wants to merge 11 commits into
mainfrom
docs/dynamic-connectors
Closed

tnkuehne wants to merge 11 commits into
mainfrom
docs/dynamic-connectors

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Delivered in #86 as part of the Widefleet 0.4.2 documentation publication. This PR is superseded.

Document Dynamic Worker connectors released in platform/CLI 0.4.0 with app runtime 0.3.0: CLI deployment, secrets, app bindings, persistent resources, activation, recovery and logs.

Rebased only the documentation commits onto main. The diff contains two documentation files and no implementation changes. Deployment examples use widefleet connector deploy; custom API integrations link to the OpenAPI contract.

Implementation: #53, included in published release v0.4.0. Installation, organization access and upgrade guidance are updated in #58. Both documentation branches were validated together and merge without conflicts.

Validation: formatting, documentation links and isolated static-site builds pass, including the combined #54/#58 content. No merge or production deployment was performed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs ea45c04 Oct 23 2026, 10:55 AM

@tnkuehne
tnkuehne force-pushed the docs/dynamic-connectors branch 5 times, most recently from 72b2837 to ae4f12b Compare October 19, 2026 20:35
tnkuehne added a commit that referenced this pull request Oct 19, 2026
Connector code and secret updates previously required separate native
Workers and fleet configuration changes. This moves connectors onto the
Dynamic Worker runtime used by apps. Code and secret changes prepare and
activate versioned snapshots without redeploying the shared native
runtime.

Apps and connectors now share the worker infrastructure end to end:

- The CLI uses one Wrangler configuration model for common fields, one
bundler/source-map collector with project-relative paths on every OS,
and one multipart publisher with stable request IDs across retries. API
uploads share parsing, file/metadata limits, module validation and
management-user accounting.
- Common metadata describes the entry module, compatibility settings,
normalized bindings and debug information. Connector metadata adds
entrypoints and object declarations; app metadata adds assets and
events. Both accept the same module types. Connector uploads require a
UUID `Idempotency-Key`: the same key/content returns the original
operation, different content conflicts, and a new key starts a new
attempt.
- Manifests and runtime snapshots reference immutable files by SHA-256
and size. Connector source is no longer embedded in internal package
JSON. Agents download app and connector module files through the same
lease-authorized endpoint and byte/size/checksum checks, then publish
them through the same immutable storage path. Source maps remain private
control-plane artifacts and never reach executable runtime storage.
Secret reads load snapshot metadata, not source code.
- Both roles use the same resource provisioning within each deployment
backend, including D1 identity selection, and the same runtime
worker-definition builder, binding adapters, module loader and native
tail attachment. Variables follow the existing app limits: 32 ordinary
bindings and 16,384 characters per variable. Connector secrets remain
limited to 5,000 UTF-8 bytes each and 128 variables/secrets combined.

Role-specific behavior remains explicit:

- Apps retain host routing, authentication, network policies, static
assets, previews, and their existing event/Workflow integration.
Connector grants are administrator-controlled and resolve the active
connector version through scoped entrypoints. Connector Cron, Queues and
Workflows are not added.
- Connector Durable Objects use persistent facets behind shared
supervisors, isolated by fleet, connector and class. Updates drain
active calls, response streams and `waitUntil` work, including nested
calls and asynchronous cancellation cleanup. Older generations cannot
downgrade an object that has advanced.
- Connector snapshots include fixed secret versions. An independent
256-bit key encrypts runtime secrets, so control-token rotation does not
invalidate them. Self-hosting retains a random key per fleet in fleet
object storage; hosted deployment requires `WIDEFLEET_CONNECTOR_KEY`
through versioned deployment configuration. Encryption-key rotation and
historical snapshot/resource cleanup remain manual.
- Connector logs use the existing Workers Logs or Collector/ClickHouse
backend, OTLP sender, queries, filters, pagination, CLI following and
source-map resolution. UI, CLI and API enforce administrator access.
Attribution includes fleet, connector and version; malformed span IDs
are excluded from structured OTLP context. Historical code,
secret-update and runtime-update versions resolve their own maps.

Runtime boundaries:

- celld 0.6.2 captures entrypoint fetch tails, including `waitUntil`,
but not RPC/facet calls; the connector gateway test also observes no
tail for rejected fetch calls. Local workerd tests verify HTTP/RPC
tails. Missing events are not reconstructed; delivery remains
best-effort.
- ES modules and Wasm load through the shared loader on both runtimes.
celld 0.6.2 rejects separate text/data modules; local workerd loads
them. This native limitation applies to apps and connectors alike.
- Custom RPC transfers values; streaming uses `fetch()`. Callbacks,
returned RPC objects, facet alarms and WebSockets are outside the common
connector contract. There is no console instrumentation, alarm scheduler
or WebSocket implementation without hibernation. celld is unchanged.
- The existing workerd response-abort workaround remains shared across
runtime deployments. Long-lived work can delay an object version switch.
- This targets fresh installations, without migration of native
connector state or older package/capability formats. Install matching
control-plane, CLI, agent and app-runtime releases. Native resource
additions may still update shared runtime configuration.

Validation:

- `pnpm check`, production control-plane build, Rust formatting/Clippy,
and 51 Rust workspace tests pass.
- The regular suite passes 421 tests; environment-gated suites are run
separately. Dynamic connector/app tests pass 45 cases on celld/workerd,
with three runtime-specific skips, including shared Wasm loading and
native text/data rejection. App and connector CLI suites pass 46 cases,
including stable upload identity and bytes across a transient failure.
- All 164 Cloudflare tests in 16 files pass after a fresh hosted build,
including app/connector deployment, runtime behavior and replay/conflict
tests. Shared upload, binary-download authorization, secret rotation,
module reuse, source-map storage/resolution and telemetry regressions
pass. Replaying an old request preserves the newer desired deployment; a
new key can retry failed activation.
- All 14 packaged CLI/agent/container deployment tests pass against a
freshly built local runtime image, covering connector RPC, durable
state, secret rotation, activation recovery, app deployment, assets,
resources, network restrictions, previews, migrations, Workflows and
restarts.

- A deterministic native Workflow regression proves that paused
instances must not run failure-recording steps. The existing Miniflare
development patch enforces this, and SQL failure fixtures remove their
triggers even after an assertion fails. Runtime rejection/retry
assertions use the same bounded wait as neighboring asynchronous
Workflow tests. Hosted production deployment logic is unchanged by this
test-runtime correction.

Public documentation is maintained separately in draft PR
#54. Publication remains
blocked until matching platform and runtime releases contain these
changes and their artifacts are available.







<!-- greptile_comment -->

<!-- greptile_summary -->

<h2><a
href="https://app.greptile.com/api/retrigger?id=83698924"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a><a
href="https://app.greptile.com/mendra/github/widefleet/widefleet/-/pull/53"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img
alt="View in Greptile"
src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>

<!-- greptile-impact-verdict --> The PR appears safe to merge for the
stated fresh-installation scope.

<details open><summary><h3>Summary</h3></summary>

Connectors now run as Dynamic Workers and share upload, module storage,
resource bindings and logging with apps.

- The CLI sends connector code as modules that the agent can fetch by
hash.
- Connector deployments prepare and activate snapshots through the
shared runtime.
- Administrators can read connector logs with connector and version
details.
- Shared API and deployment setup changes support the new connector
paths.
</details>

<details open><summary><h3>Diagram</h3></summary>

```mermaid
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["CLI multipart upload"] --> API["Authorized API"]
  API --> Store["Immutable modules and manifest"]
  Store --> Deploy["Agent or hosted deployment"]
  Deploy --> Prepare["Prepare snapshot and check readiness"]
  Prepare --> Activate["Activate connector version"]
  App["App connector binding"] --> Gateway["Resolve active version"]
  Activate --> Gateway
  Gateway --> Worker["Dynamic Worker"]
  Worker --> Supervisor["Object supervisor"]
  Supervisor --> Facet["Persistent object facet"]
```
</details>

<!-- greptile_confidence_score:5 -->

<sub>Reviews (9) · Last reviewed commit: ["Fix portable bundles and
paused
workflow..."](61e1c87)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub>

<!-- /greptile_comment -->
Base automatically changed from feat/dynamic-connectors to main October 19, 2026 21:36
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