Skip to content
Get Started

Runtime parity and platform differences

Zebric’s Node and Cloudflare Workers adapters share Blueprint execution contracts. The same conformance suite runs against Node SQLite and Miniflare D1 with identical expected results. The suite covers:

ContractNode and Workers checks
Entity valuesGenerated IDs, falsy defaults, JSON values, nullable dates, UTC DateTime input
AuthorizationPrivate rows, pagination after filtering, agent scopes, run attribution, CSRF
QueriesParameter resolution, missing parameters, lookup search
CommandsProtected fields, availability, committed response replay, changed-input conflicts
TransactionsIntermediate reads, nested callbacks, rollback, commit-only effects
WorkflowsTyped query results, nested conditions and loops, atomic rollback
HTTPPage JSON, CRUD, discovery and contract fingerprints, malformed-input rejection

From the repository root, run:

Terminal window
pnpm test:parity

The shared assertions live in tests/runtime-conformance/contracts.ts; each runtime provides its own database and HTTP fixture. This suite runs in CI and in each runtime’s regular tests. Additional Worker smoke tests bundle real entrypoints and execute them inside workerd, including native durable workflows and bundled plugins, custom commands, file serving, metrics, and audit writes.

Passing these tests supports parity for the listed behavior. PostgreSQL, provider authentication flows, every integration, performance under production load, and identical recovery across different job stores require their own validation.

CapabilityNodeWorkers
DatabaseSQLite or PostgreSQLD1 with optimistic snapshot transactions
Durable jobsDatabase-backed scheduler by defaultNative checkpoints with a WORKFLOWS binding; otherwise inline jobs
Templates and pluginsRuntime filesystem loadingStatically imported modules or KV templates
Public files/uploads/* serves local files/uploads/* serves R2 objects outside reserved _zebric/
Development email outboxAppends a local fileWrites private R2 objects; requires FILES
NotificationsConsole, Slack, email, custom factoriesPortable console/Slack, R2 email outbox, custom portable factories
MetricsProcess counters and histogramsThe same metric format, scoped to each isolate
Security auditAppend-only file loggerD1 journal; request logging is best-effort
CacheMemory or RedisOptional KV; increments are non-atomic and bulk clear is unsupported
Plugin tokensBuilt-in Node token lifecycleApplication-provided pluginAuth lifecycle
OperationsHot reload, admin server, Node tracingWrangler/bindings and platform observability

Both runtimes’ file routes serve existing public files. Neither provides a generic upload API. The development email adapters write outboxes; use a delivery adapter for sending mail.

Workers initialize enabled bundled plugins before fetch, cron, and native workflow execution. They expose workflow actions and service integrations. Bundle custom commands through commandHandlers; discovery includes only configured handlers. Bundled plugins run as trusted application code, without a separate plugin sandbox.

Workers snapshot all Blueprint entity tables, execute database-only steps against the snapshot, validate the original data and schema, and commit mutations in one atomic batch. Concurrent changes can return retryable 409 TRANSACTION_CONFLICT, including changes to rows that influence authorization. This differs from Node’s database locking behavior and can produce conservative conflicts.

Custom SQL triggers, virtual tables, foreign keys outside the Blueprint, and foreign-key checks deferred across steps are unsupported. Snapshot work scales with the entire entity dataset. Validate cost and conflict rates for large or frequently written databases. Transactions expire after five minutes; a workflow timeout can impose a shorter deadline.

Both runtimes reject external effects and custom command handlers in transactional workflows. General workflows support them. External services need idempotency because a service may accept an effect before the runtime records its checkpoint. An explicit Worker retry restarts execution; Node preserves successful command receipts across retry generations. Retention and recovery follow each platform’s job store rather than an identical implementation.

See runtime and deployment for bindings and entrypoint examples.