Repository navigation
@cloudflare/workflows-shared@0.15.4
Immutable
release. Only release title and notes can be modified.
Patch Changes
-
#17086
9df88dcThanks @iglesiasbrandon! - Make local Workflowcreate()andcreateBatch()errors match productionIn local development,
create()andcreateBatch()now reject invalid options, IDs and params as production does, with the same error codes. They reject with a plainErrorwhose message starts with the code, such as(body)or(instance.invalid_id). Previously they threw aWorkflowError, which arrived as anErrorwhose message began withWorkflowError:unless the Worker listed theenhanced_error_serializationcompatibility flag explicitly.- Invalid options, such as a non-string
id, an unparseableretentionduration or an unknownlocationHint, reject with(body)followed by each problem.createBatch()checks every entry's options before any ID, and accepts zero and negativeretentiondurations, ascreate()and production do. - IDs that are too long, use unsupported characters, or are reserved (
batch,terminate,terminateAll, orcf_followed by 64 lowercase hexadecimal characters) reject with(instance.invalid_id). - Params that Durable Object storage cannot clone, such as functions, RPC targets and streams, no longer create an instance that stays queued forever.
create()rejects with(body) Provided instance parameters are not serializable.createBatch()reports the entry inerrorswith code10002and the ID the instance would have had. An entry whose ID already exists or repeats in the batch is still reported with10405or10415. create(null)creates an instance with a generated ID instead of throwing aTypeError, andcreate({ params: null })gives the Workflow{}as its payload.- The deprecated array form of
createBatch()gets the same checks as the object form. It leaves out entries whose params cannot be stored, as it does entries with an existing or repeated ID.
- Invalid options, such as a non-string