Skip to main content

Namespace: googleAdkAgentsWorkflow

Workflow-safe API for the Google ADK Temporal plugin — importable from Workflow code running in the V8 sandbox.

The Google ADK plugin is an experimental feature; APIs may change without notice.

Classes

Interfaces

References

MCPToolsetFactory

Re-exports MCPToolsetFactory

Variables

MCP_ERROR_FAILURE_TYPE

Const MCP_ERROR_FAILURE_TYPE: "GoogleAdkMCPError"

Error type for a failed MCP listTools or callTool call. Raised inside an Activity, so wherever you catch it, it arrives wrapped in an ActivityFailure: match it through the .cause chain, never against the caught error's own .type.

An HTTP status, when present, is appended and classified exactly as for MODEL_ERROR_FAILURE_TYPE — but an MCP failure rarely carries one, so a rejected token or an unreachable server classifies as retryable rather than failing fast, and the plugin sets no retry policy: the call retries indefinitely until the caller bounds it with TemporalMCPToolsetOptions.activity.retry.maximumAttempts.


MCP_TOOL_NOT_FOUND_FAILURE_TYPE

Const MCP_TOOL_NOT_FOUND_FAILURE_TYPE: "GoogleAdkMCPToolNotFound"

Error type when the <name>-callTool Activity finds no tool by the requested name in the BaseToolset its factory returned. Non-retryable, and raised inside that Activity, so it arrives wrapped in an ActivityFailure: match it through the .cause chain, never against the caught error's own .type. It reaches code that calls the tool's runAsync itself.

A factory returning MCPConnectionParams never raises it: the plugin calls the tool without resolving the name first, so the caller gets whatever the server answers.


MODEL_ERROR_FAILURE_TYPE

Const MODEL_ERROR_FAILURE_TYPE: "GoogleAdkModelError"

Error type for a failed model call. Raised inside an Activity, so it arrives wrapped in an ActivityFailure: match it through the .cause chain. A request carrying an adk_agent_name label, as an ADK agent run's requests do, has its failure recorded: it fails the Workflow — or rejects the Update whose handler ran the turn — unless an onModelErrorCallback recovers and calls markModelFailureHandled(error). A hand-built request ordinarily carries none, and then only throws at the call site.

A failure that carries an HTTP status has it appended as .<status>, for example GoogleAdkModelError.429, so match with startsWith, not ===; such a failure is retryable for 408, 409, 429 and 5xx and non-retryable otherwise. One carrying no status is the bare type and retryable. An x-should-retry response header overrides either verdict.


STREAMING_TOPIC_REQUIRED_FAILURE_TYPE

Const STREAMING_TOPIC_REQUIRED_FAILURE_TYPE: "GoogleAdkStreamingTopicRequired"

Error type when streaming is requested but TemporalModelOptions.streamingTopic is unset. Non-retryable, and thrown in the Workflow, so code calling TemporalModel directly catches it unwrapped.


UNSUPPORTED_FAILURE_TYPE

Const UNSUPPORTED_FAILURE_TYPE: "GoogleAdkUnsupported"

Error type when BaseLlm.connect (BIDI live streaming) is called inside a Workflow. Non-retryable, and thrown in the Workflow to whoever called connect, so it arrives unwrapped.

Functions

activityAsTool

activityAsTool(options): BaseTool

Wraps an existing Temporal Activity (by registered name) as an ADK BaseTool. Add the returned tool to an agent's tools[].

Parameters

NameType
optionsActivityAsToolOptions

Returns

BaseTool


markModelFailureHandled

markModelFailureHandled(error): void

Declares that the caller handled error from a failed TemporalModel call, so it must not fail the Workflow or reject the Update it happened in. Other failures absorbed by the same Workflow invocation — the main function, or the Signal or Update handler that ran the turn — still surface. Does nothing outside a Workflow.

Call it from an ADK onModelErrorCallback, passing the error that callback received, and return the substitute response from that callback — built with ADK's createEvent, because ADK yields the callback's return value untouched and isFinalResponse then dereferences the actions a bare LlmResponse does not carry. ADK finishes the run on the substitute, and without this call the Workflow fails anyway and the recovery is discarded. A cancellation cannot be handled this way: an execution whose cancel a model call absorbed still ends CANCELLED.

Parameters

NameType
errorunknown

Returns

void