From a6fe05ed7d8f0c76f47eae273c18c9d863ffcfd7 Mon Sep 17 00:00:00 2001 From: Jwahir Sundai Date: Wed, 12 Aug 2026 17:46:40 -0500 Subject: [PATCH 1/4] draft --- docs/develop/go/workers/index.mdx | 1 + docs/develop/go/workers/interceptors.mdx | 36 +++++++++++++++++ .../java/best-practices/error-handling.mdx | 2 +- docs/develop/java/workers/index.mdx | 2 + docs/develop/java/workers/interceptors.mdx | 39 +++++++++++++++++++ docs/develop/plugins-guide.mdx | 2 +- docs/encyclopedia/interceptors.mdx | 2 + sidebars.js | 2 + 8 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 docs/develop/go/workers/interceptors.mdx create mode 100644 docs/develop/java/workers/interceptors.mdx diff --git a/docs/develop/go/workers/index.mdx b/docs/develop/go/workers/index.mdx index 62121ded3f..7bf109130a 100644 --- a/docs/develop/go/workers/index.mdx +++ b/docs/develop/go/workers/index.mdx @@ -23,4 +23,5 @@ import * as Components from '@site/src/components'; - [Run a Worker](/develop/go/workers/run-worker-process) - [Sessions](/develop/go/workers/sessions) +- [Interceptors](/develop/go/workers/interceptors) - [Serverless Workers](/develop/go/workers/serverless-workers) diff --git a/docs/develop/go/workers/interceptors.mdx b/docs/develop/go/workers/interceptors.mdx new file mode 100644 index 0000000000..c89860e55f --- /dev/null +++ b/docs/develop/go/workers/interceptors.mdx @@ -0,0 +1,36 @@ +--- +id: interceptors +title: Interceptors - Go SDK +sidebar_label: Interceptors +description: + Implement Interceptors in the Temporal Go SDK to manage inbound and outbound SDK calls, enhance tracing, and add + authorization to your Workflows and Activities. +toc_max_heading_level: 3 +keywords: + - interceptors +tags: + - Interceptors + - Go SDK + - Temporal SDKs +--- + +Interceptors wrap inbound and outbound Temporal calls so you can apply shared behavior such as tracing, logging, or +authorization. See [Interceptors](/encyclopedia/interceptors) for the inbound vs outbound model. + +Register them on the Client (`client.Options.Interceptors`), the Worker (`worker.Options.Interceptors`), or both. Embed +`ClientInterceptorBase` / `WorkerInterceptorBase` and override only the methods you need. Full API: +[`go.temporal.io/sdk/interceptor`](https://pkg.go.dev/go.temporal.io/sdk/interceptor). + +:::warning Workflow interceptors and replay + +Workflow interceptor methods also run during [replay](/develop/go/best-practices/testing-suite#replay). Use replay-safe +APIs for logging, randomness, and time. + +::: + +## Related + +- [Observability - Tracing](/develop/go/platform/observability#tracing) +- [Context Propagation](/develop/go/best-practices/context-propagation) +- [Logging Interceptor sample](https://github.com/temporalio/samples-go/tree/main/logger-interceptor) +- [Plugins - Interceptors](/develop/plugins-guide#interceptors) diff --git a/docs/develop/java/best-practices/error-handling.mdx b/docs/develop/java/best-practices/error-handling.mdx index 19e95a7284..9dfc8fab97 100644 --- a/docs/develop/java/best-practices/error-handling.mdx +++ b/docs/develop/java/best-practices/error-handling.mdx @@ -262,7 +262,7 @@ Because the interceptor sees the original exception before the SDK's default con attach `details` and a non-retryable classification consistently, rather than depending on every Activity implementation to do it the same way. `WorkerInterceptor` and `ActivityInboundCallsInterceptor` are marked `@Experimental`. For the general interceptor model — inbound versus outbound, and the other call categories you can -intercept — see [Interceptors](/develop/plugins-guide#interceptors). +intercept — see [Interceptors](/develop/java/workers/interceptors). ## Fail a Workflow deliberately {/* #fail-a-workflow */} diff --git a/docs/develop/java/workers/index.mdx b/docs/develop/java/workers/index.mdx index 57b54e17b4..54bac1792c 100644 --- a/docs/develop/java/workers/index.mdx +++ b/docs/develop/java/workers/index.mdx @@ -22,3 +22,5 @@ import * as Components from '@site/src/components'; ## Workers - [Run Worker processes](/develop/java/workers/run-worker-process) +- [Interceptors](/develop/java/workers/interceptors) +- [Serverless Workers](/develop/java/workers/serverless-workers) diff --git a/docs/develop/java/workers/interceptors.mdx b/docs/develop/java/workers/interceptors.mdx new file mode 100644 index 0000000000..0c50318acf --- /dev/null +++ b/docs/develop/java/workers/interceptors.mdx @@ -0,0 +1,39 @@ +--- +id: interceptors +title: Interceptors - Java SDK +sidebar_label: Interceptors +description: + Implement Interceptors in the Temporal Java SDK to manage inbound and outbound SDK calls, enhance tracing, and add + authorization to your Workflows and Activities. +toc_max_heading_level: 3 +keywords: + - interceptors +tags: + - Interceptors + - Java SDK + - Temporal SDKs +--- + +Interceptors wrap inbound and outbound Temporal calls so you can apply shared behavior such as tracing, logging, or +authorization. See [Interceptors](/encyclopedia/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`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/common/interceptors/package-summary.html). + +Several interceptor APIs are marked `@Experimental`. + +:::warning Workflow interceptors and replay + +Workflow interceptor methods also run during [replay](/develop/java/best-practices/testing-suite#replay). Use replay-safe +APIs for logging, randomness, and time. + +::: + +## Related + +- [Observability - Tracing](/develop/java/platform/observability#tracing) +- [Error handling - Worker Interceptor](/develop/java/best-practices/error-handling#centralize-with-interceptor) +- [Spring Boot - Interceptors](/develop/java/integrations/spring-boot#interceptors) +- [Plugins - Interceptors](/develop/plugins-guide#interceptors) diff --git a/docs/develop/plugins-guide.mdx b/docs/develop/plugins-guide.mdx index f61ffb0c24..e1c86f88a2 100644 --- a/docs/develop/plugins-guide.mdx +++ b/docs/develop/plugins-guide.mdx @@ -646,7 +646,7 @@ Note that you can use an existing Data Converter such as, in Python, `PydanticPa ### Interceptors -Interceptors are middleware that can run before and after various calls such as Activities, Workflows, and Signals. You can [learn more about interceptors](/develop/python/workers/interceptors) for the details of implementing them. They're used to: +Interceptors are middleware that can run before and after various calls such as Activities, Workflows, and Signals. You can [learn more about interceptors](/encyclopedia/interceptors) for the details of implementing them. They're used to: - Create side effects such as logging and tracing. - Modify arguments, such as adding headers for authorization or tracing propagation. diff --git a/docs/encyclopedia/interceptors.mdx b/docs/encyclopedia/interceptors.mdx index 958c3f545f..808d1858c5 100644 --- a/docs/encyclopedia/interceptors.mdx +++ b/docs/encyclopedia/interceptors.mdx @@ -26,6 +26,8 @@ Common use cases: Here are SDK-specific guides: +- [Go](/develop/go/workers/interceptors) +- [Java](/develop/java/workers/interceptors) - [Python](/develop/python/workers/interceptors) - [TypeScript](/develop/typescript/workers/interceptors) - [.NET](/develop/dotnet/workers/interceptors) diff --git a/sidebars.js b/sidebars.js index 8f319350bf..5c65410774 100644 --- a/sidebars.js +++ b/sidebars.js @@ -205,6 +205,7 @@ const developGoCategory = { items: [ 'develop/go/workers/run-worker-process', 'develop/go/workers/sessions', + 'develop/go/workers/interceptors', { type: 'category', label: 'Serverless Workers', @@ -356,6 +357,7 @@ const developJavaCategory = { }, items: [ 'develop/java/workers/run-worker-process', + 'develop/java/workers/interceptors', { type: 'category', label: 'Serverless Workers', From 65db2fe5d13bc3b8d23960a34bbe56a260f796ee Mon Sep 17 00:00:00 2001 From: Jwahir Sundai Date: Wed, 12 Aug 2026 17:56:39 -0500 Subject: [PATCH 2/4] fix link --- docs/develop/java/workers/interceptors.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/develop/java/workers/interceptors.mdx b/docs/develop/java/workers/interceptors.mdx index 0c50318acf..d01f1021f7 100644 --- a/docs/develop/java/workers/interceptors.mdx +++ b/docs/develop/java/workers/interceptors.mdx @@ -35,5 +35,5 @@ APIs for logging, randomness, and time. - [Observability - Tracing](/develop/java/platform/observability#tracing) - [Error handling - Worker Interceptor](/develop/java/best-practices/error-handling#centralize-with-interceptor) -- [Spring Boot - Interceptors](/develop/java/integrations/spring-boot#interceptors) +- [Spring Boot - Interceptors](/develop/java/integrations/spring-boot-integration#interceptors) - [Plugins - Interceptors](/develop/plugins-guide#interceptors) From 42277d648061c83e6668519b80fa26ad82c04669 Mon Sep 17 00:00:00 2001 From: Duncan Mackenzie Date: Mon, 17 Aug 2026 13:50:10 -0700 Subject: [PATCH 3/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/develop/go/workers/interceptors.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/develop/go/workers/interceptors.mdx b/docs/develop/go/workers/interceptors.mdx index c89860e55f..3eee1f26e0 100644 --- a/docs/develop/go/workers/interceptors.mdx +++ b/docs/develop/go/workers/interceptors.mdx @@ -6,8 +6,6 @@ description: Implement Interceptors in the Temporal Go SDK to manage inbound and outbound SDK calls, enhance tracing, and add authorization to your Workflows and Activities. toc_max_heading_level: 3 -keywords: - - interceptors tags: - Interceptors - Go SDK From a8754ff3b8c95c2d2bafcf1d9ffee45982b2a4a4 Mon Sep 17 00:00:00 2001 From: Duncan Mackenzie Date: Mon, 17 Aug 2026 13:50:28 -0700 Subject: [PATCH 4/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/develop/java/workers/interceptors.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/develop/java/workers/interceptors.mdx b/docs/develop/java/workers/interceptors.mdx index d01f1021f7..3b4b8feaca 100644 --- a/docs/develop/java/workers/interceptors.mdx +++ b/docs/develop/java/workers/interceptors.mdx @@ -6,8 +6,6 @@ description: Implement Interceptors in the Temporal Java SDK to manage inbound and outbound SDK calls, enhance tracing, and add authorization to your Workflows and Activities. toc_max_heading_level: 3 -keywords: - - interceptors tags: - Interceptors - Java SDK