adk-action
Shared action node types for ADK-Rust graph workflows.
Stability: Stable — follows semantic versioning, so breaking changes wait for the next major release. See STABILITY.md.
This crate provides the type definitions, error types, and variable interpolation utilities for deterministic, non-LLM workflow operations. adk-graph is the runtime that executes them.
Overview
Action nodes are programmatic graph nodes that perform specific operations — HTTP calls, state manipulation, conditional branching, looping, file I/O, notifications, and more. They complement LLM agent nodes in adk-graph workflows.
adk-action is the shared type layer. It contains no execution logic, no HTTP clients, no database drivers. Execution lives in adk-graph's ActionNodeExecutor behind the action feature flags.
Contents
| Module | Description |
|---|---|
types |
All 14 action node config structs, StandardProperties, and the ActionNodeConfig tagged union |
error |
ActionError enum with 24 variants covering all failure modes |
interpolation |
interpolate_variables() and get_nested_value() for {{variable}} template resolution |
Action Node Types
The last column is the node's status in adk-graph 3.0.
| Category | Node | Description | Runs in adk-graph |
|---|---|---|---|
| Trigger | TriggerNodeConfig |
manual, webhook, schedule, and event triggers |
Yes (action; action-trigger for the cron/webhook runtime) |
| Data | HttpNodeConfig |
HTTP requests with auth, interpolation, status validation | Yes (action-http) |
| Data | SetNodeConfig |
set, merge, and delete state variables |
Yes |
| Data | TransformNodeConfig |
template, jsonpath, and builtin transforms with type coercion |
Yes |
| Control | SwitchNodeConfig |
Conditional routing (first_match or all_match) on a field, operator, and value |
Yes |
| Control | LoopNodeConfig |
for_each, while, and times iteration |
Yes |
| Control | MergeNodeConfig |
Synchronize parallel branches (wait_all, wait_any, wait_n) |
Yes |
| Control | WaitNodeConfig |
fixed delays, until a timestamp, condition polling, webhook waits |
Yes |
| Compute | CodeNodeConfig |
Code in rust, javascript, or typescript |
rust only; JavaScript and TypeScript are rejected when the graph compiles |
| Infra | DatabaseNodeConfig |
SQL (PostgreSQL/MySQL/SQLite), MongoDB, Redis | No — rejected when the graph compiles |
| Comms | EmailNodeConfig |
IMAP monitoring and SMTP sending | No — rejected when the graph compiles |
| Comms | NotificationNodeConfig |
Slack, Discord, Teams, generic webhooks | Yes (action-http) |
| Comms | RssNodeConfig |
RSS/Atom feed fetching with filters and seen-item tracking | Yes (action-rss) |
| IO | FileNodeConfig |
read, write, list, and delete files |
Yes, confined to allowed roots |
adk-graph evaluates the switch operators eq, neq, gt, lt, gte, lte, contains,
startsWith, endsWith, matches, in, empty, and exists; the operator is a string in
ExpressionMode.
Installation
[]
= "3.0.0"
Usage
Defining an action node
use *;
use json;
Variable interpolation
use ;
use json;
use HashMap;
JSON round-trip
use ActionNodeConfig;
StandardProperties
Every action node includes StandardProperties with:
- Identity:
id,name,description - Error handling:
mode(stop/continue/retry/fallback),retry_count,retry_delay,fallback_value - Tracing:
enabled,log_level(none/error/info/debug) - Callbacks:
on_start,on_complete,on_error - Execution control:
timeout(ms),condition(skip when false) - Mapping:
input_mapping,output_key
Error Types
ActionError covers all action node failure modes with structured variants:
| Category | Variants |
|---|---|
| HTTP | HttpStatus, Timeout |
| Control flow | NoMatchingBranch, NoBranchCompleted, InsufficientBranches |
| Timing | ConditionTimeout, WebhookTimeout, WebhookCancelled, InvalidTimestamp |
| Compute | CodeExecution, SandboxInit, Transform |
| Infrastructure | MissingCredential, NoDatabase |
| Communication | EmailAuth, EmailSend, NotificationSend, RssFetch, RssParse |
| File I/O | FileRead, FileWrite, FileDelete, FileParse |
| Other | Other |
From<ActionError> for AdkError maps every variant to an ErrorCategory and an action.*
error code, such as action.timeout (Timeout) or action.missing_credential (Unauthorized).
Design Principles
- Lean: Only types, errors, and interpolation. No runtime, no HTTP clients, no database drivers.
- Shared: One definition of each node configuration;
adk-graphdeserializes workflow JSON into these types and executes them. - Serialization-first: All types derive
Serialize/DeserializewithcamelCasefield naming andskip_serializing_iffor optional fields. - Tagged union:
ActionNodeConfiguses#[serde(tag = "type")]so the JSON"type"field determines the variant.
License
Apache-2.0
Part of ADK-Rust
This crate is part of the ADK-Rust framework for building AI agents in Rust.