Skip to main content

Interceptors - Java SDK

View Markdown

Interceptors wrap inbound and outbound Temporal calls so you can apply shared behavior such as tracing, logging, or authorization. See Interceptors for the inbound vs outbound model.

Register them on the Client (WorkflowClientOptions.setInterceptors) or the Worker Factory (WorkerFactoryOptions.setWorkerInterceptors). Extend WorkflowClientInterceptorBase / WorkerInterceptorBase and override only the methods you need. Full API: io.temporal.common.interceptors.

Several interceptor APIs are marked @Experimental.

Workflow interceptors and replay

Workflow interceptor methods also run during replay. Use replay-safe APIs for logging, randomness, and time.