Package-level declarations

Types

Link copied to clipboard
abstract class BaseNode(val name: String, val description: String = "", val rerunOnResume: Boolean = false, val waitForOutput: Boolean = false, val config: NodeConfig = NodeConfig(), val inputSchema: Schema? = null, val outputSchema: Schema? = null, val stateSchema: Schema? = null) : Node

The base class for units of work in a workflow graph. A Workflow is itself a node, so graphs nest, and every agent is one too.

Link copied to clipboard
data class Edge(val from: Node, val to: Node, val routes: List<Route> = emptyList())

A connection between two nodes.

Link copied to clipboard

A workflow graph failed validation. Raised when the graph is built, not when it runs.

Link copied to clipboard
class JoinNode @JvmOverloads constructor(name: String, description: String = "", inputSchema: Schema? = null, outputSchema: Schema? = null) : BaseNode

Waits for every predecessor to complete, then outputs their outputs keyed by predecessor name.

Link copied to clipboard
interface Node

A unit of work in a workflow graph.

Link copied to clipboard
data class NodeConfig(val retryConfig: RetryConfig? = null, val timeout: Duration? = null)

Bundles a node's retry policy and execution timeout. A null timeout imposes no limit, so an attempt is then bounded only by any ambient deadline. Validation lives here, so every Node implementation inherits it.

Link copied to clipboard
open class NodeExecutionException(val typeName: String, message: String, cause: Throwable? = null) : RuntimeException

A node failure that reports under a typeName other than this class's own, so a failure raised in one ADK implementation is matched by the same name in another.

Link copied to clipboard
data class NodeInfo(val path: String = "", val outputFor: List<String>? = null, val messageAsOutput: Boolean = false)

Identifies the workflow-node activation that emitted an com.google.adk.kt.events.Event; null outside a workflow.

Link copied to clipboard

A node exceeded its configured timeout. An ordinary exception, so a timed-out node is still eligible for retry.

Link copied to clipboard
data class RetryConfig(val maxAttempts: Int? = null, val initialDelay: Duration? = null, val maxDelay: Duration? = null, val backoffFactor: Double? = null, val jitter: Double? = null, val exceptions: List<String>? = null)

How a node is retried when it raises. Every property is optional: null means "unset" and falls back to the matching DEFAULT_ constant when the retry is computed, except exceptions, which has no default. Unset is kept distinct from a set value rather than resolved at construction, so a policy declared with field presence carries the same meaning here as where it was declared.

Link copied to clipboard
sealed interface Route

A value on a workflow edge, and the value a node emits to select which of its outgoing edges are followed. An edge fires when the value it carries matches one the node emitted.

Link copied to clipboard

Marks where a graph starts. Never runs: the scheduler seeds its successors directly.

Link copied to clipboard
class Workflow(name: String, val edges: List<Edge> = emptyList(), description: String = "", val maxConcurrency: Int? = null, rerunOnResume: Boolean = true, waitForOutput: Boolean = false, config: NodeConfig = NodeConfig(), inputSchema: Schema? = null, outputSchema: Schema? = null, stateSchema: Schema? = null) : BaseNode

A graph of nodes, and a Node itself, so graphs nest: a workflow drops into another workflow wherever an ordinary node goes.

Link copied to clipboard

A workflow is misconfigured in a way surfaced only at run time -- for example, more than one terminal node producing an output. Matches Python's WorkflowConfigurationError.

Functions

Link copied to clipboard
fun BaseTool.asNode(name: String = this.name, config: NodeConfig = NodeConfig()): Node

Returns a workflow node that runs this tool as a fixed step: the predecessor's output becomes the tool's arguments, and the tool's result becomes the node's output.