Skip to content

Workflow Nodes

A Tryll workflow is a graph of nodes, each responsible for one step of the per-turn loop. Six node types ship in the box; together they cover the common patterns of conversational inference (generation, retrieval, instructions, detection, fallback, guardrails).

Nodes are referenced by their NodeType name on the wire protocol:

Node NodeType Exit routes Use for
Generate Generate default Language-model inference. The workhorse.
Instruction Instruction default Attach a named instruction string to the current interaction; rendered by downstream Generate via Mustache.
Retrieve Retrieve found, not_found Vector search over an embedded string storage — the R in RAG.
Tool Call ToolCall tool_called, no_tool_called Detect whether the model wants to call an external tool.
Canned Response CannedResponse default Emit a fixed reply from a string storage without calling the model.
Human Message Guardrail HumanMessageGuardrail triggered, not_triggered Regex-match the user message; branch the graph on pattern hits.

Exit-route legend

Every node's reference page lists its named exits. The graph wires each exit to a target node (or to the literal string "END" to terminate the turn). An exit that is not wired is a compilation failure (error 3003).

Common patterns:

  • Straight line. Generate → defaultEND. Minimal single-turn agent.
  • Branch on guardrail. Guardrail → triggered → CannedResponse → END; Guardrail → not_triggered → Generate → defaultEND.
  • Instruction then generate. Instruction → default → Generate. The instruction's text is exposed as {{instruction_<name>}} and {{#instructions}} in the Generate node's Mustache template.
  • Retrieve then generate. Retrieve → found → Generate; Retrieve → not_found → Generate (same target). The not_found path is fine — the projection drops to the user message alone.
  • Tool-call detection. ToolCall → tool_calledEND (client handles the tool); ToolCall → no_tool_called → Generate.

Params

Every node carries a list of (key, value) string pairs (NodeParam). Each node's reference page lists the keys it accepts. Unknown keys are currently silent; standardising on strict validation is planned.

Diagnostics

When the agent is created with enable_diagnostics = true, every node contributes to TurnComplete.debug_info. See agent parameters — diagnostics.