Skip to main content

Interface: ReplayWorkerOptions

worker.ReplayWorkerOptions

WorkerOptions with inapplicable-to-replay fields removed.

Hierarchy

  • Omit<WorkerOptions, "connection" | "namespace" | "taskQueue" | "activities" | "maxConcurrentActivityTaskExecutions" | "maxConcurrentLocalActivityExecutions" | "maxConcurrentWorkflowTaskExecutions" | "maxHeartbeatThrottleInterval" | "defaultHeartbeatThrottleInterval" | "debugMode" | "enableNonLocalActivities" | "maxActivitiesPerSecond" | "maxTaskQueueActivitiesPerSecond" | "stickyQueueScheduleToStartTimeout" | "maxCachedWorkflows">

    ReplayWorkerOptions

Properties

buildId

Optional buildId: string

A string that should be unique to the exact worker code/binary being executed.

This is used to populate the binaryChecksum attribute in history events originated from this Worker.

Default

@temporalio/worker package name and version + checksum of workflow bundle's code

Inherited from

Omit.buildId


bundlerOptions

Optional bundlerOptions: Object

Type declaration

NameTypeDescription
ignoreModules?string[]List of modules to be excluded from the Workflows bundle. Use this option when your Workflow code references an import that cannot be used in isolation, e.g. a Node.js built-in module. Modules listed here MUST not be used at runtime. > NOTE: This is an advanced option that should be used with care.
webpackConfigHook?(config: Configuration) => ConfigurationBefore Workflow code is bundled with Webpack, webpackConfigHook is called with the Webpack configuration object so you can modify it.

Inherited from

Omit.bundlerOptions


dataConverter

Optional dataConverter: DataConverter

Provide a custom DataConverter.

Inherited from

Omit.dataConverter


enableSDKTracing

Optional enableSDKTracing: boolean

Enable opentelemetry tracing of SDK internals like polling, processing and completing tasks.

Useful for debugging issues with the SDK itself.

For completeness the Rust Core also generates opentelemetry spans which connect to the Worker's spans. Configure CoreOptions.telemetryOptions to enable tracing in Core.

Default

false

Inherited from

Omit.enableSDKTracing


identity

Optional identity: string

A human-readable string that can identify your worker

Default

${process.pid}@${os.hostname()}

Inherited from

Omit.identity


interceptors

Optional interceptors: WorkerInterceptors

A mapping of interceptor type to a list of factories or module paths.

By default, ActivityInboundLogInterceptor and WorkflowInboundLogInterceptor are installed. If you wish to customize the interceptors while keeping the defaults, use appendDefaultInterceptors.

When using workflowBundle, these Workflow interceptors (WorkerInterceptors.workflowModules) are not used. Instead, provide them via workflowInterceptorModules when calling bundleWorkflowCode.

Inherited from

Omit.interceptors


replayName

Optional replayName: string

A name for this replay worker. It will be combined with a short random ID to form a unique task queue for the replay worker.

Default

workflow name from given history


showStackTraceSources

Optional showStackTraceSources: boolean

Whether or not to send the sources in enhanced stack trace query responses

Default

false

Inherited from

Omit.showStackTraceSources


shutdownGraceTime

Optional shutdownGraceTime: string | number

Time to wait for pending tasks to drain after shutdown was requested.

Format

number of milliseconds or ms-formatted string

Default

10s

Inherited from

Omit.shutdownGraceTime


sinks

Optional sinks: InjectedSinks<any>

Implementation of the Sinks interface, a mapping of name to InjectedSink.

Sinks are a mechanism for exporting data from the Workflow sandbox to the Node.js environment, they are necessary because the Workflow has no way to communicate with the outside World.

Sinks are typically used for exporting logs, metrics and traces out from the Workflow.

Sink functions may not return values to the Workflow in order to prevent breaking determinism.

By default the defaultWorkerLogger sink is installed and is required by WorkflowInboundLogInterceptor.

If you wish to customize the sinks while keeping the defaults, merge yours with defaultSinks.

Inherited from

Omit.sinks


workflowBundle

Optional workflowBundle: WorkflowBundleOption

Use a pre-built bundle for Workflow code. Use bundleWorkflowCode to generate the bundle. The version of @temporalio/worker used when calling bundleWorkflowCode must be the exact same version used when calling Worker.create.

This is the recommended way to deploy Workers to production.

See https://docs.temporal.io/typescript/production-deploy#pre-build-code for more information.

When using this option, workflowsPath, bundlerOptions and any Workflow interceptors modules provided in * interceptors are not used. To use workflow interceptors, pass them via workflowInterceptorModules when calling bundleWorkflowCode.

Inherited from

Omit.workflowBundle


workflowsPath

Optional workflowsPath: string

Path to look up workflows in, any function exported in this path will be registered as a Workflows in this Worker.

If this option is provided to create, Webpack compliation will be triggered.

This option is typically used for local development, for production it's preferred to pre-build the Workflow bundle and pass that to create via the workflowBundle option.

See https://docs.temporal.io/typescript/production-deploy#pre-build-code for more information.

Inherited from

Omit.workflowsPath