Overview
Workflows are composed of nodes arranged in a Directed Acyclic Graph (DAG). Each node has a specific type that determines its execution behavior.Node Types
Agent Node
Invoke an agent to perform a task
Switch Node
Multi-way conditional branching
Map Node
Parallel iteration over array items
Loop Node
While-loop iteration until condition
Workflow Node
Invoke a sub-workflow
Agent Node
Invokes an agent to perform a task. The most common node type.Unique node identifier. Used in dependency references and output mapping.
Must be
"agent".Name of the agent to invoke. Must match an agent’s registered name in the namespace.
Array of node IDs this node depends on. Node waits for all dependencies to complete.Argo-compatible alias:
dependenciesInput mapping. Keys are agent input field names, values support template expressions.If omitted, input is automatically inferred from dependencies.
Optional workflow-specific guidance sent to the agent. Provides context for how the agent should process the request.Supports template expressions like
{{workflow.input.context}}.Override the agent’s input schema for this specific invocation. Useful for adding workflow-specific validation.
Override the agent’s output schema expectations for this specific invocation.
Conditional execution expression (Argo-style). Node only executes if expression evaluates to
true.Node-specific timeout. Format:
"30s", "5m", "1h".Overrides default_node_timeout_seconds.Node-specific retry configuration. Overrides workflow-level
retry_strategy.Switch Node
Multi-way conditional branching. Evaluates cases in order; first match wins.Must be
"switch".Ordered list of condition/node pairs. First matching condition wins.Each case has:
condition(orwhen): Boolean expressionnode(orthen): Node ID to execute if condition matches
Node ID to execute if no cases match. If omitted and no cases match, the switch completes with no action.
Condition Expressions
Switch conditions support:- Comparisons:
==,!=,<,<=,>,>=,in,not in - Boolean operators:
and,or,not - Literals: strings, numbers,
true,false,null - Template expressions:
{{node.output.field}}
Map Node
Parallel iteration over array items. Executes a node once per item with optional concurrency control.Must be
"map".Array to iterate over. Can be:
- Template expression:
"{{workflow.input.items}}" - Static array:
[1, 2, 3]
with_items: Static listwith_param: Dynamic template expression
Node ID to execute for each item. This is the “inner node” of the map.
Maximum items to process (safety limit). Workflow fails if array exceeds this.
Maximum concurrent executions.
null means unlimited parallelism.1: Sequential execution5: Up to 5 items processed in parallelnull: All items processed in parallel
Map Variables
Inner nodes can access map-specific variables:{{_map_item}}: Current item object/value{{_map_item.field}}: Field from current item{{_map_index}}: Current iteration index (0-based)
{{item}} → {{_map_item}}
Loop Node
While-loop iteration. Executes a node repeatedly until a condition becomes false.Must be
"loop".Node ID to execute repeatedly. This is the “inner node” of the loop.
Continue looping while this expression is
true.Loop stops when condition evaluates to false or max_iterations is reached.Note: On first iteration (iteration 0), condition is not checked - loop always runs at least once (do-while behavior).Maximum number of iterations (safety limit). Loop stops when reached even if condition is still true.
Delay between loop iterations. Format:
"5s", "1m", "1h", "1d".No delay on first iteration.Loop Variables
Inner nodes can access:{{_loop_iteration}}: Current iteration count (0-based)
Example: Polling Pattern
Workflow Node
Invokes another workflow as a sub-workflow. Workflows register as agents, so this uses the same invocation mechanism.Must be
"workflow".Name of the workflow to invoke. Must match a registered workflow in the namespace.
Recursion Prevention
- Direct recursion is prevented: A workflow cannot invoke itself
- Indirect recursion is controlled by
max_call_depth(default: 10)
Common Node Fields
All node types support these fields:Unique node identifier within the workflow.
Node type:
"agent", "switch", "map", "loop", or "workflow".Array of node IDs this node depends on. Execution waits for all dependencies to complete.Argo-compatible alias:
dependenciesParallelism
Workflows support implicit parallel execution through dependency-based scheduling:- Forks when multiple nodes have the same dependency
- Joins when a node depends on multiple parallel branches
Next Steps
Workflow Configuration
Complete YAML configuration schema
Workflow Execution
DAG execution model and scheduling