Skip to main content

Nodes vs. stages

A node is a step defined in the DOT file at author time. A stage is the runtime execution of a node. In a simple linear workflow, each node runs once and produces one stage. But when a workflow loops — for example, an implement-test-fix cycle — the same node can produce multiple stages within a single run. This distinction matters for observability and debugging: the workflow graph shows nodes, but the run timeline shows stages. Each stage records its own inputs, outputs, duration, and token usage.

Node types

Every node’s Graphviz shape attribute determines its execution behavior. If no shape is specified, the node defaults to an agent.

Start

Shape: Mdiamond The entry point of the workflow. Every workflow must have exactly one start node.
start [shape=Mdiamond, label="Start"]

Exit

Shape: Msquare The terminal node. When execution reaches exit, the workflow completes. Every workflow must have exactly one exit node.
exit [shape=Msquare, label="Exit"]

Agent

Shape: box (default) Runs an LLM with access to tools — bash, file editing, sub-agents — in an agentic loop. The agent works autonomously, calling tools as needed, until it decides the task is complete.
implement [label="Implement", prompt="Read plan.md and implement every step."]
Key attributes:
AttributeDescription
promptThe task instructions for the agent
reasoning_effortlow, medium, or high (default: high)
max_tokensMaximum tokens for LLM responses
fidelityHow much prior context is passed to this node (see Context)
thread_idGroups nodes into a shared conversation thread (advanced — see below)
timeoutExecution timeout (e.g. "900s")
Fidelity levels:
ValueBehavior
compactStructured summary of prior stages (default)
fullComplete context from all prior stages — no summarization
summary:highDetailed summary including outputs and key details
summary:mediumModerate summary with outcomes and notable findings
summary:lowBrief summary with just outcomes per stage
truncateMinimal — only the goal and run ID
Fidelity can also be set at the graph level (default_fidelity) or on individual edges to control the transition between stages. See Context for the full reference on fidelity precedence, preamble construction, and thread integration. Thread ID: Setting thread_id on multiple nodes (e.g. thread_id="impl") groups them into a shared conversation thread, preserving context continuity across nodes as if they were part of the same session. This is an advanced feature typically used within subgraph clusters:
subgraph cluster_impl {
    node [fidelity="full", thread_id="impl"]
    plan      [label="Plan"]
    implement [label="Implement"]
    review    [label="Review"]
}

Prompt

Shape: tab Makes a single LLM call with no tool use. Useful for analysis, summarization, generation, and lightweight reasoning where tools aren’t needed.
spec [label="Write Spec", shape=tab, prompt="Write a brief spec for a string utility module."]
Prompt nodes accept the same attributes as agent nodes (prompt, reasoning_effort, max_tokens, etc.) but never invoke tools.

Command

Shape: parallelogram Runs a shell script inside the configured sandbox and captures its output. The output is available to downstream nodes as context. This ensures command nodes execute in the same environment as agent nodes.
test [label="Run Tests", shape=parallelogram, script="cargo test 2>&1 || true"]
AttributeDescription
scriptThe shell command to execute
language"shell" (default) or "python"

Human

Shape: hexagon Pauses the workflow and waits for a person to choose a path. The outgoing edge labels define the available options:
approve [shape=hexagon, label="Approve Plan"]

approve -> implement [label="[A] Approve"]
approve -> plan      [label="[R] Revise"]
In the web UI, human gates appear as interactive prompts. From the CLI, they appear as a menu.

Wait

Shape: insulator Pauses the workflow for a configured duration before proceeding. Useful for rate limiting between API calls or waiting for external processes to complete.
cooldown [label="Wait 30s", shape=insulator, duration="30s"]
AttributeDescription
durationHow long to pause (required). Supports ms, s, and m suffixes (e.g. "500ms", "30s", "2m")

Conditional

Shape: diamond Routes execution to different edges based on conditions evaluated against the current run context:
gate [shape=diamond, label="Tests passing?"]

gate -> exit      [label="Pass", condition="outcome=success"]
gate -> implement [label="Fix"]
Conditions support =, !=, &&, and context variable lookups (e.g. context.tests_passed=true). An edge with no condition acts as the default fallback.

Parallel (fan-out)

Shape: component Fans out to execute multiple branches concurrently. Each branch gets its own isolated context.
fork [label="Fan Out", shape=component, join_policy="wait_all", error_policy="continue"]

fork -> security
fork -> architecture
fork -> quality
AttributeDescription
join_policyWhen the merge can proceed (see table below)
error_policyHow branch failures are handled (see table below)
max_parallelMaximum concurrent branches (default: 4)
Join policies:
PolicyBehavior
wait_allWait for every branch to finish (default)
first_successProceed as soon as one branch succeeds
k_of_n(N)Proceed after N branches succeed (e.g. k_of_n(2))
quorum(F)Proceed after a fraction of branches succeed (e.g. quorum(0.5))
Error policies:
PolicyBehavior
continueRun all branches even if some fail, then evaluate the join policy (default)
fail_fastCancel remaining branches as soon as one fails
ignoreTreat all branch failures as successes

Merge (fan-in)

Shape: tripleoctagon Collects results from parallel branches into a single context. Typically paired with a parallel fan-out node:
merge [label="Merge Results", shape=tripleoctagon]

security     -> merge
architecture -> merge
quality      -> merge
merge -> report
The merged results are available to downstream nodes as parallel_results.json.

Common node attributes

These attributes can be set on any node type:
AttributeDescription
labelDisplay name shown in the graph visualization
classCSS-like class for model stylesheet targeting (space-separated for multiple)
max_visitsMax times this node can execute in a run. Overrides the graph-level max_node_visits for this node.
goal_gateWhen true, the workflow fails if this node doesn’t succeed
max_retriesOverride default retry count for this node
retry_policyNamed retry preset (see table below)
Retry policies:
PresetAttemptsBackoffDescription
none1No retries, fail immediately
standard55s initial, 2x exponentialGood default for transient failures
aggressive5500ms initial, 2x exponentialLonger initial delay for rate limits
linear3500ms fixedConstant delay between attempts
patient32s initial, 3x exponentialSlow ramp for unreliable services
If neither retry_policy nor max_retries is set, nodes default to 3 retries with standard backoff.