Skip to content

Bindings and platform features

Bindings give a worker access to resources through env. In OpenFlare you declare a binding in your wrangler-style config, create the underlying resource through the console, the of CLI or the management API, and of deploy resolves each binding name to the platform resource.

A worker may have at most 64 bindings. Binding names must be unique across vars, secrets, bindings, version metadata and workflows.

Variables and secrets are exposed on env but are not resource bindings; they share the namespace of binding names.

Kind Where to set it Notes
Variable (string) [vars], of deploy --var K:V, console Variables tab, PUT .../vars/{key} Key matches ^[A-Za-z_][A-Za-z0-9_]{0,127}$ in the console.
JSON variable [vars] with a typed value, console JSON variables editor, .../json-vars Up to 16 KiB per key. Scoped to a version. Requires the cell jsonBindings capability.
Secret of secret put, --secrets-file, console Secrets section, PUT .../secrets/{key} Write-only. Encrypted with AES-256-GCM under PLANE_SECRETS_KEY.

If a cell does not advertise jsonBindings, the console only lets you save JSON variables as a candidate version (it shows “This cell supports saving JSON variables as a candidate only.”). Writes through the vars and secrets routes publish immediately and return a revision; see Console.

  • Config: [[kv_namespaces]] with binding and id.
  • Create: of kv namespace create <title>, the console resources area, or the API.
  • Data operations: of kv key list|get|put|delete, of kv bulk put|delete.
  • Limits: control-plane values up to 1 MiB; expirationTtl at least 60 s; bulk 1-1000 items, 8 MiB total, not atomic.

KV is the closest to drop-in compatibility with Cloudflare.

  • Config: [[d1_databases]] with binding, database_name/database_id, and optionally migrations_dir and migrations_pattern.
  • Create: of d1 create <name>, the console, or the API.
  • Operate: of d1 query, of d1 migrations list|status|apply|create, of d1 stats|info|promote|promotions.
  • Migrations are never applied by a deploy; run of d1 migrations apply.
  • Caveats: migrations_table is not supported. Deleting a database is refused while a version references it. Follower and time-travel operations are offline restore commands; the console has no online UI for them.
  • Config: [[r2_buckets]] with binding and bucket_name.
  • Create: of r2 bucket create <name>, the console, or the API.
  • Operate: of r2 object list|head|get|put|delete.
  • Caveats: jurisdiction and storage_class are rejected. Conditional requests (onlyIf) depend on the storage backend. Control-plane object operations are small (4 MiB at the cell, effectively under 1 MiB through JSON); use the binding from a worker for larger objects.

A bucket is stored either on the cell’s local storage or proxied to Cloudflare R2 or Amazon S3. Pick the backend when you create the bucket. See R2 storage backends for the fields, connection test, credential rotation and detach flow.

In the console, the R2 page is under Storage & Databases > R2 Object Storage. A worker’s Bindings tab links an R2 binding to the bucket’s object browser.

  • Config: [durable_objects] bindings and [[migrations]] declaring classes.
  • Lifecycle: of durable-objects list|transfer|rename|delete|stats|instances. These are explicit commands that deploy never replays.
  • Rules: deleting a class returns 409 while an active version references it. Transfer fails if the destination class exists or the source has transfer lineage. transferred_classes in migrations is rejected.
  • Caveats: DO tenants never freeze (no scale to zero) and do not hibernate.
  • Config: [[hyperdrive]] with binding and id; OpenFlare adds a database_tenant extension.
  • Create: of hyperdrive create with a credential-less postgres://host[:port]/db origin; the password is read from stdin only.
  • Caveat: deletion is refused while a version references it. Hyperdrive is a partial implementation.
  • Cache API: per host, in memory and not persistent. ignoreMethod, ignoreSearch, ignoreVary and cacheName are not implemented. There is no edge cacheTtl tier.
  • Purge: POST /api/v1/cells/{cell}/teams/{team}/cache/purge with exactly one of workerName, tags (1-1000), pathPrefix (starts with /) or all: true. List recent purges with GET .../cache/purges. It needs a cell with the cachePurge capability (otherwise 409) and entries are pod-local. Purge operations expire after one hour.
  • Config: [assets] with directory and binding, plus html_handling (four modes) and routing options.
  • Deploy: of deploy uploads files by digest and a manifest, then references them from the version.
  • Limits: 20,000 files, 25 MiB per file, 512 MiB total at runtime; through the plane 8192 files, 8 MiB per object, 512 MiB team quota. See Limits.

Status: Partial. Secrets Store is implemented (a SECRETS_STORE binding type, plane routes, CLI commands and a console page), but it is not a full copy of Cloudflare’s product.

  • Config: [[secrets_store_secrets]].
  • Manage: of secrets-store list|put|delete|publish (values on stdin).
  • API: PUT, GET and DELETE on .../secrets-store/{storeId}/{secretName} and GET .../{secretName}/references to see which workers use a secret. Updates use If-Match and If-None-Match entity tags; a stale tag returns 412.
  • Cell requirement: the cell must advertise the secretsStore capability, otherwise the plane refuses with VRT_CELL_CAPABILITY_MISSING (409).
  • Console: secret references appear on the Binding resources page.
  • Config: [[analytics_engine_datasets]].
  • Behavior: data points are written as Parquet per tenant. There is no hosted SQL API; query with of analytics query <dataset> or external tools such as DuckDB.
  • Config: [[queues.producers]] and consumers.
  • Manage: of queues list|create|update|send|stats|delete. Messages are UTF-8, 1 byte to 128 KiB.
  • Config: [triggers] crons = ["*/5 * * * *"]. Cron is listed as drop-in compatible.
  • Config: [[workflows]]; of deploy upserts declarations.
  • Manage: of workflows list|upsert|delete|stats|instances, of wfop.
  • Limits: limits.steps at most 100,000. Workflow tenants never freeze.

Vectorize, Secrets Store and Flagship resources are managed from the console’s Binding resources page as well as the CLI and API.

Service bindings (with entrypoint and props), worker loaders, version metadata, rate limiting (per-process fixed window), Vectorize, Flagship, Images, outbound send_email, K2 (produce only), Browser and Tail Workers exist in partial form. See Compatibility for the matrix, including features that are not supported.