Local Workflows bindings support object-form createBatch()
Introduced 2026-10-01 · score 0.94
HOW TO USE IT
When running a local Workflows binding, call object-form `createBatch()` with a count or per-instance options. Read the returned `created` handles and indexed `errors`; the array form remains supported.
const result = await env.<BINDING>.createBatch({ count: 2, params: <payload> });
const handles = result.created;
const errors = result.errors;const result = await env.<BINDING>.createBatch({ instances: [{ id: "<id>", params: <payload> }] });
const handles = result.created;
const errors = result.errors;WHY THIS HELPS
In local development, create Workflow instances in a batch using a count or per-instance options.
REQUIREMENTS AND LIMITATIONS
- Version: 4.146.0
- count: Number of instances to create in count form; the documented source example uses `count: 2`.
- params: Payload passed to instances in the count-form example.
- instances: List of per-instance options; each may include `id` and `params`.
- created: Returned instance handles.
- errors: Returned per-instance errors include the input `index`; examples also show `id`, `code`, and `message`.
- Prerequisite: Local Workflows development requires Wrangler v3.89.0 or later and Node.js 18.0.0 or later; Wrangler 4.146.0 satisfies the documented Wrangler minimum.
- This support applies to local Workflows bindings.
- Docs conflict: The Workers API docs list the array-form `createBatch(batch: WorkflowInstanceCreateOptions[])` signature and array result; the Wrangler 4.146.0 release note and source commit document the new local object form. The docs do not specify object-form field requiredness.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.146.0
- https://github.com/cloudflare/workers-sdk/commit/464a582442ad6872edf1d52107b1a7b68b5e606f
- https://developers.cloudflare.com/workflows/build/local-development/
Check the installed version and the source before using it. Entry JSON