Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eersnington/sideffect/llms.txt
Use this file to discover all available pages before exploring further.
NonRetryableError is imported from sideffect. When thrown from a step’s run function or directly from a workflow’s run function, it signals that the failure is permanent — Cloudflare should mark the workflow as failed and must not attempt to retry it.
Class definition
this.name to "NonRetryableError" and this.message to the provided string. No additional properties or methods are added.
Constructor
A human-readable description of why this failure is permanent. This message
appears in Cloudflare Workflows logs and dashboard.
Basic usage
How Sideffect handles NonRetryableError
Sideffect’s generated WorkflowEntrypoint classes (produced by WorkflowEntrypoints.make() or the Vite plugin) wrap your workflow run function. When the run function throws, the generated entrypoint checks whether the error is a Sideffect NonRetryableError. If it is, the entrypoint re-throws it as Cloudflare’s own native NonRetryableError, which tells the Cloudflare Workflows runtime to mark the workflow as permanently failed without scheduling another retry.
This two-step conversion is necessary because Sideffect is a portable library that can run in environments without the Cloudflare runtime. Sideffect’s NonRetryableError is a plain Error subclass; the native Cloudflare NonRetryableError is only available inside a Worker. The generated entrypoint bridges the two at runtime.
Automatic conversion from schema decode failures
You do not need to throwNonRetryableError manually when input validation fails. Sideffect automatically wraps schema decode errors in NonRetryableError internally.
Whenever a step payload or result fails to decode against its Schema, Sideffect throws a NonRetryableError with a descriptive message:
Workflow.make({ payload: ... }), Sideffect throws a NonRetryableError before your run function is called at all.
This means schema validation failures are always terminal by design. Malformed input is not a transient failure and retrying will not fix it.