Skip to main content

Interface: WorkerInterceptors

worker.WorkerInterceptors

Structure for passing in Worker interceptors via WorkerOptions

Properties

activity

Optional activity: ActivityInterceptorsFactory[]

List of factory functions that instanciate ActivityInboundCallsInterceptors and ActivityOutboundCallsInterceptors.


activityInbound

Optional activityInbound: ActivityInboundCallsInterceptorFactory[]

List of factory functions returning ActivityInboundCallsInterceptors. If both activity and activityInbound is supplied, then entries from activityInbound will be prepended to inbound interceptors instanciated from activity.

Deprecated

Use WorkerInterceptors.activity instead.


client

Optional client: ClientInterceptors

Interceptors for the Client provided by the Worker to Activities and Nexus Operation handlers.

Client support over NativeConnection is experimental. Error handling may be incomplete or different from what would be observed using a Connection instead. Client doesn't support cancellation through a Signal.


nexus

Optional nexus: NexusInterceptorsFactory[]

List of factory functions that instanciate NexusInterceptorss.

Nexus support in Temporal SDK is experimental.


workflowModules

Optional workflowModules: string[]

List of modules to search for Workflow interceptors in

  • Modules should export an interceptors variable of type WorkflowInterceptorsFactory
  • Workflow interceptors run in the Workflow isolate

NOTE: This option is not used if Worker is provided with pre-built bundle (WorkerOptions.workflowBundle).