Skip to main content

Interface: ActivityNodeOptions<TInput>

googleAdkAgentsWorkflow.ActivityNodeOptions

Options for activityNode.

Type parameters​

NameType
TInputunknown

Properties​

activity​

• Optional activity: ActivityOptions

Per-call Temporal Activity configuration (timeouts, retry, task queue, summary). Prefer retry here over ADK's retryConfig: an ADK retry re-runs the whole node on top of Temporal's own Activity retries.

An abort (the node's timeout, or a sibling node failing) requests the Activity's cancellation on Temporal's usual terms, and cancellationType decides what the node then waits for. Unset means TRY_CANCEL: the node hears about the cancellation at once and the Activity is left to wind down on its own. WAIT_CANCELLATION_COMPLETED makes the node wait for the Activity to acknowledge, which it does at its next heartbeat, so pair it with a heartbeatTimeout and an Activity that heartbeats.


args​

• Optional args: (input: TInput, ctx: NodeContext) => unknown[]

Maps the node's input to the Activity's argument list. Defaults to passing the input as the single argument. TypeScript has no runtime signature introspection, so — unlike Python's activity_node — there is no named-parameter binding; use the NodeContext for state-bound values: (input, ctx) => [ctx.state.get('customerId'), input].

Type declaration​

▸ (input, ctx): unknown[]

Parameters​
NameType
inputTInput
ctxNodeContext
Returns​

unknown[]


description​

• Optional description: string

The node's description, advertised when the node is used as a tool.


inputSchema​

• Optional inputSchema: SchemaLike


isolationScope​

• Optional isolationScope: string | true


name​

• name: string

The registered Activity type to run — an @activity-style function registered on the worker (e.g. via the worker's activities). Also the node's name unless nodeName is set.


nodeName​

• Optional nodeName: string

The graph node's name, when it must differ from the Activity's (e.g. two nodes running one Activity, or an Activity type carrying a delimiter). The effective name may not contain ., / or @: ADK reads node paths back by those characters (segments, and the run-id suffix), and a name containing one breaks the rehydration that fast-forwards a completed node on resume. activityNode refuses one rather than rename the node behind your back.


outputSchema​

• Optional outputSchema: SchemaLike

The schema every Activity result has to satisfy (an Activity returning nothing yields null). A Zod schema also checks a result carrying a parts array, which ADK's own check would let through as genai Content; a genai Schema is checked by ADK, which still does.


retryConfig​

• Optional retryConfig: RetryConfig

ADK graph-level retry. Its backoff becomes a durable Workflow timer; its jitter is drawn from the Workflow's Math.random(). Match a Temporal Activity failure with exceptions: ['ActivityFailure'] (ADK matches error names).


stateSchema​

• Optional stateSchema: SchemaLike


timeout​

• Optional timeout: number

The node's deadline, in seconds (ADK semantics). A durable Workflow timer: when it fires the in-flight Activity is cancelled, and the node fails with ADK's NodeTimeoutError once that cancellation has settled, so a retryConfig attempt never overlaps the Activity it replaces.

How long the settling takes is the Activity's own ActivityOptions.cancellationType. Unset (TRY_CANCEL) it settles at once, and the Activity winds down on its own time. Under WAIT_CANCELLATION_COMPLETED the node waits for the Activity to acknowledge, which it does at its next heartbeat, so an Activity that never heartbeats holds the node until its startToCloseTimeout.

The plugin runs this deadline itself rather than handing it to ADK, whose own implementation races the node's generator and then abandons the unwind (node_runner.ts), which would let a retry start on top of an Activity that is still running.