Docs · 06

Workflows: nodes, edges and the default graph

The default agent workflow, the node reference from input to finalize, and how editing and versions work.

A workflow is a graph. Each node does one job and passes state to the next. Edges define order; conditional edges branch on the state (for example, whether the model requested tool calls). Loops are allowed (model → toolbox → model) up to the agent's max iterations.

The default agent workflow

Every new agent starts with this graph:

input → memory read → knowledge retrieval → context builder → LLM ⇄ toolbox → finalize, with a memory write step on a side branch after the answer.

  • The LLM node has a conditional edge: if the model asked for tools, go to the toolbox; otherwise go to finalize.
  • The toolbox executes the calls and returns to the LLM node for the next iteration.
  • Finalize produces the visible answer. Only text flowing into Finalize is streamed to the user; internal branches never leak into the chat.
  • Memory write runs on a side branch so the reply is not delayed.

Node reference

Input. Receives the user message. Settings: input mode, message role, include raw input, input schema, and which authenticated user fields (auth context) enter the run.

Context transform. Shapes the conversation history before the model sees it: include history or not, history mode (sliding window), maximum history messages and tokens, system prompt mode (inherit the agent instructions or override), context variables, input preprocessing and message strategy.

Memory read. Retrieves durable memory items. Settings: scopes (user, conversation, agent, app, workspace), namespace, strategy (recent, keyword, hybrid, importance, vector, semantic hybrid), top k, minimum score, item types to include (preference, fact, project context, instruction), the prompt template (default "Relevant memory:"), whether to include the result in the prompt, and what to do on empty results or failure.

Knowledge retrieval. Retrieves chunks from knowledge bases. Settings: which knowledge bases (agent defaults or a node-specific list), strategy (hybrid keyword + vector with reciprocal rank fusion), top k, minimum score, max tokens per chunk, total token cap, optional reranking, citations, deduplication, query source (the latest input or a state key or template), fail and empty-result behaviour.

Context builder. Assembles the bounded prompt: history, tool outputs, knowledge and memory within the token budget, with an optional stored prompt preview.

LLM. Calls the model. Settings are those in Models and providers plus history scope, the toolbox it uses, allowed tools, and the auth context fields it may see.

Toolbox. Holds tools and executes the model's tool calls. Settings: inherited tools from the agent and app, node-specific tools, allow and block lists, execution mode (sequential), max calls per run and per tool, timeout, retries, whether calls require approval, fail behaviour (continue with an error result or stop), output policy (how much of a tool result the model sees), permission scope, tool selection (all, vector or hybrid with max tools, minimum score and pinned tools), the built-in search_tools (max results, bind mode: append, replace or rolling window) and the built-in tool_history (replay turns, preview and page sizes). See Tools.

Router. Chooses the next branch: rule conditions on the state or a model decision, with a fallback branch and an optional explanation.

Validation. Checks the answer against an output schema: strict JSON, retry on invalid output, maximum retries, repair with the model, required fields, custom rules, fallback response and on-fail behaviour.

Memory write. Extracts memory candidates from the exchange. Settings: strategy (candidate extraction), write policy (candidates require approval, or automatic above a confidence threshold), item types to save, source fields, max candidates, max tokens per candidate, deduplication, update existing items, exclude sensitive content, retention days and user consent.

Finalize. Produces the visible answer: output source, format, include citations, include a tool summary, include usage, hide internal errors, fallback output, and the safety rules (blocked topics, deny and allow rules) applied before the answer leaves.

Editing and versions

The Workflow tab has a graph editor: add nodes from the palette, connect them, set per-node configuration, and validate. Validation runs the same rules in the dashboard and the runtime, so a graph that passes validation is a graph the runtime accepts. Saving creates a draft version; publishing makes it active; earlier versions can be restored or archived. The test chat can run drafts; apps and end users run only the published version.