Skip to main content

Interface: WorkflowDefinitionOptions

common.WorkflowDefinitionOptions

Options that can be used when defining a workflow via setWorkflowOptions.

Properties

failureExceptionTypes

Optional failureExceptionTypes: (...args: any[]) => Error[]

The types of errors that, if thrown by the Workflow function, a signal handler, or an update handler, will cause the Workflow Execution or the Update to fail instead of failing the Workflow Task (which would result in retrying the Workflow Task until it eventually succeeds).

This is a per-Workflow-type equivalent of WorkerOptions.workflowFailureErrorTypes. Both settings are evaluated; an error matching either will cause Workflow failure. Unlike the string-based WorkerOptions.workflowFailureErrorTypes, this accepts actual class references, enabling subclass matching via instanceof, but doesn't allow failing the workflow execution on non-determinism errors. Failing the workflow execution on non-determinism errors can only be set via WorkerOptions.workflowFailureErrorTypes.

Passing the Error class to this setting will fail the Workflow on any error, except non-determinism errors.

Note that TemporalFailure subclasses and cancellation errors that bubbles out of the Workflow always fail the Workflow Execution, regardless of either this and the WorkerOptions.workflowFailureErrorTypes settings.


versioningBehavior

Optional versioningBehavior: VersioningBehavior