Class: GoogleAdkPlugin
googleAdkAgents.GoogleAdkPlugin
The Temporal plugin for the Google Agent Development Kit (@google/adk).
The plugin's central mechanism is to run the native ADK Runner and
agent graph inside the Workflow sandbox (deterministic) while routing only
the non-deterministic I/O boundaries — model inference and MCP server calls —
out to Activities. Making that work requires the @google/adk barrel to
bundle into the Workflow sandbox; GoogleAdkPlugin.configureBundler
is what makes the bundle build (see the recipe documented there).
Hierarchy
-
↳
GoogleAdkPlugin
Constructors
constructor
• new GoogleAdkPlugin(options?): GoogleAdkPlugin
Parameters
| Name | Type | Description |
|---|---|---|
options? | GoogleAdkPluginOptions | Worker-side model + MCP configuration. |
Returns
Overrides
Properties
name
• Readonly name: string
The name of the plugin
Inherited from
Methods
configureBundler
▸ configureBundler(options): BundleOptions
Makes the @google/adk agent loop bundle into the Workflow sandbox.
configureBundler is the single canonical bundling hook — the Worker runs
it for both live execution and replay (Worker.create and
Worker.runReplayHistory both bundle through getOrCreateBundle), so the
recipe applies identically on both paths and there is no separate
configureWorker/configureReplayWorker bundler override.
The recipe has three parts, all required:
webpackConfigHookadds googleAdkSandboxCompatPlugin (thenode:strip, shim redirects, andprocessprovide) and the exact-matchresolve.aliaspin of@opentelemetry/apito a single bundle copy (see addSandboxCompat).ignoreModulesstubs (alias → false) two groups: ADK's heavy node-only service packages (ADK_NODE_ONLY_SERVICE_PACKAGES) and every disallowed Node builtin (disallowedBuiltins). The builtins are already aliased tofalseby the bundler — listing them additionally tells its determinism guard "expected, don't fail" for the few ADK core reaches on paths that never run in a Workflow.workflowInterceptorModulesgets theload-polyfillsmodule prepended. Interceptor modules are evaluated per workflow — with the activator installed — before the user's workflow module (theinitRuntimecontract in@temporalio/workflow's worker-interface: it sets the activator, then imports interceptor modules in list order, then imports workflows), so the web globals@google/adk/@google/genaiand ADK's OpenTelemetry chain dereference at module load (ReadableStream,performance, …) exist no matter what order the user's own imports evaluate in. The module exports aninterceptorsfactory that registers nothing, per the documented interceptor-module contract. (A webpack entry preload would not work: entry code evaluates at bundle load, before any activator, where the polyfill'sinWorkflowContext()gate is false — and in the reusable-V8-context mode the no-op evaluation would be cached and never re-run.) Known gap: custom payload/failure converter modules (payloadConverterPath/failureConverterPath) evaluate before interceptor modules, so a converter module that itself imports@google/adk/@google/genaimust import@temporalio/google-adk-agents/workflow(or./load-polyfills) first to install the polyfills.
Tradeoff: putting all disallowed builtins in ignoreModules suppresses
the bundler's friendly "you imported a Node builtin in your Workflow"
build-time error (for the user's own Workflow code too). Runtime determinism
is still enforced by the sandbox — a real fs call from Workflow code throws
there — so the safety property is preserved.
Parameters
| Name | Type |
|---|---|
options | BundleOptions |
Returns
Overrides
configureClient
▸ configureClient(options): ClientOptions
Configures client options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | ClientOptions | The existing client options |
Returns
Modified client options with plugin configuration applied
Inherited from
configureConnection
▸ configureConnection(options): ConnectionOptions
Configures connection options by merging plugin parameters with existing options. Special handling for function-based API keys.
Parameters
| Name | Type | Description |
|---|---|---|
options | ConnectionOptions | The existing connection options |
Returns
Modified connection options with plugin configuration applied
Inherited from
SimplePlugin.configureConnection
configureNativeConnection
▸ configureNativeConnection(options): NativeConnectionOptions
Configures native connection options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | NativeConnectionOptions | The existing native connection options |
Returns
Modified native connection options with plugin configuration applied
Inherited from
SimplePlugin.configureNativeConnection
configureReplayWorker
▸ configureReplayWorker(options): ReplayWorkerOptions
Configures replay worker options by merging plugin parameters with existing options.
Parameters
| Name | Type | Description |
|---|---|---|
options | ReplayWorkerOptions | The existing replay worker options |
Returns
Modified replay worker options with plugin configuration applied
Inherited from
SimplePlugin.configureReplayWorker
configureWorker
▸ configureWorker(options): WorkerOptions
Configures worker options by merging plugin parameters with existing options. Activities and nexus services are appended, while other options are replaced.
Parameters
| Name | Type | Description |
|---|---|---|
options | WorkerOptions | The existing worker options |
Returns
Modified worker options with plugin configuration applied
Inherited from
runWorker
▸ runWorker(worker, next): Promise<void>
Runs the worker, optionally wrapping execution in a custom context.
Parameters
| Name | Type | Description |
|---|---|---|
worker | Worker | The worker instance to run |
next | (w: Worker) => Promise<void> | Function to continue worker execution |
Returns
Promise<void>
Promise that resolves when worker execution completes