Agent
The Agent node runs a large language model agent that works toward an answer over multiple steps. Unlike LLM Chat, an agent can call other nodes as tools and loop until it has what it needs, up to the step limit you set. You find it on the node picker’s AI shelf.
The agent pays with the credential you pick on the node: a secret holding an API key or a saved connection. Leave the field empty to use the workspace key for the provider, managed on the AI models page.
Handles
Section titled “Handles”The agent grows by what you wire to its handles; each attachment is a separate, inspectable node on the canvas.
| Handle | Type | Description |
|---|---|---|
input |
Input | Accepts the upstream node’s output, available to the instruction fields as $prev. |
output |
Output | Emits the agent’s final answer and step count. |
tool |
Tool, labelled Tools | Nodes the agent may call as tools during its run, including MCP Tools, OpenAPI Operation Pack, SOAP Operation Pack, and Subflow. |
memory |
Memory, labelled Memory | Memory nodes such as Chat Thread that load prior conversation history before the model call and record the exchange after. |
middleware |
Middleware, labelled Context | Context-shaping nodes such as Search Tools and Tool Filter that filter, order, or search the agent’s tools before the run. |
model |
Model, labelled Model | A model routing node that picks which model serves each request. When empty, the agent uses its own provider and model fields. |
The input handle is on the node’s top edge and the output handle on its right. The four attachment handles run along the bottom edge, left to right: tool, memory, model, middleware, so a node you wire to one sits below the agent.
The tool, memory, and middleware handles each take any number of connections. The model handle accepts more than one wire, but the agent uses the first one and ignores the rest.
Configuration
Section titled “Configuration”

| Field | Type | Default | Description |
|---|---|---|---|
Provider (provider) | one of openai, anthropic, gemini, ollama, mistral, groq, xai, voyageai, openrouter, typesafe, eleven, openai-compatible, soniox ✦ (required) |
— | The AI provider that runs this agent, e.g. OpenAI or Anthropic. |
Model (model) | string ✦ (required) | — | The model to use, e.g. gpt-4o or claude-sonnet-5-5. It must be a model the selected provider offers. |
Instructions (systemMessage) | string ✦ (required) | — | The system prompt — the agent’s role, rules and tone, applied on every run. |
Message (prompt) | string ✦ (required) | — | The message sent to the model this run — usually an expression that pulls in upstream data, e.g. {{ $start->payload }}. |
Max steps (maxSteps) | integer ✦ (required) | — | The maximum number of tool-calling steps the agent may take in one run before it must produce a final answer. |
Attachments (attachments) | string ✦ (optional) | — | Files this agent should read this run — stored files, inbound email attachments, or anything a file-producing node returned. |
Approval mode (approvalMode) | one of read_only, approve, auto_write, autonomous (optional) |
— | How much this agent may do without asking. Read-only: it researches and plans; a tool that changes anything is not offered to it unless it is listed under “May change things”, and neither is one whose every call Read-only would refuse. Ask first: every change asks you, in one card per step. Auto-write: routine changes to your own workspace run on their own (each logged), while flow runs, messages, calls to other systems and deletes ask. Autopilot: it acts without asking, except the protected actions, which stop for you in every mode. Below the field: what the chosen mode does to each tool wired to this agent. |
Max web calls (maxWebCalls) | integer ✦ (optional) | — | How many web searches and page reads this agent may make in one run; leave empty for the platform default. |
Put recalled memory after the message (memoryAfterPrompt) | boolean (optional) | false |
Where what the agent’s memory recalls goes each turn: in its instructions, or after the message in a context block. After the message keeps the instructions and the earlier conversation the same from one turn to the next, so the model reads them back from its cache instead of paying for them again. |
Credential (credential) | string ✦ (optional) | — | The key this node pays with — a secret holding an API key, or a saved Connection. Leave it empty to use the workspace key for this provider, set on the AI models page. |
Base URL (baseUri) | string ✦ (optional) | — | Override the provider’s API base URL — only needed for self-hosted models or a proxy endpoint. |
Response schema (responseSchema) | list (optional) | — | The shape of the agent’s answer. Leave the single “content” field for a free-text reply; add fields to make the agent return an object with exactly these keys, which downstream nodes read as $prev->data->fieldName. |
Let approvals wait in a conversation (approvalsWaitInConversation) | boolean (optional) | false |
In a conversation, let an approval wait for its answer instead of expiring after 30 minutes. The paused turn picks up where it stopped as soon as someone approves or denies it, even hours later. |
Carry on when out of steps (continueWhenOutOfSteps) | boolean (optional) | false |
When a conversation turn runs out of steps, let the agent carry on in a turn of its own instead of stopping to ask you to say “continue”. Only when it may act without asking (Auto-write or Autopilot), and only within the workspace’s daily token limit for it. |
Most tokens one turn may use (turnTokenBudget) | integer ✦ (optional) | — | End a turn once it has used this many tokens, the way running out of steps ends it: the agent writes a short hand-off, and carries on in a new turn when it may. |
Most minutes one turn may work on its own (turnMinuteBudget) | integer ✦ (optional) | — | End a turn after it has worked on its own for this many minutes, the way running out of steps ends it. |
Chat app (chatApp) | list (optional) | — | What the workspace’s own Discord or Slack bot, or Telegram bot, does around this agent’s turn, per option: reply (post the answer), progress (a live message of its steps), typing, approvals (Approve/Deny buttons in the chat, decided by a linked workspace member), reactions (a thumb on the answer is feedback), threads (answer in a thread in a server channel). Each is “on” or “off”; leave one out to follow the connection. Beside them, forms: who answers a form the agent asks for that buttons cannot carry, “presser” (a private link to whoever presses Fill in the form), “chat” (the link in the question, for anyone there) or “members” (a private link only a workspace member may answer). |
May change things (mayChangeThings) | list (optional) | — | In Read-only, the tools wired to this agent that it may still use to change something, such as creating a ticket. A listed tool answers as in Ask first: a change asks before it runs unless that tool is set to never ask, and a tool that only asks or notes something, such as Ask the Person or saving a lesson, runs without asking. Listing Ask the Person, Watch a Run or Follow Up Later lets a run no conversation started message a member or wait, which Read-only otherwise withholds. Ignored when the workspace allows agents nothing beyond Read-only, or when a conversation was switched to Read-only. |
Most tokens one conversation may use per day (conversationTokenBudget) | integer ✦ (optional) | — | Most tokens one conversation may use per day. Past it, the agent’s next turn is answered with the reply below instead of calling the model. Needs a chat memory node, which is what tells one conversation from another. |
Reply when the budget is spent (outOfBudgetReply) | string ✦ (optional) | — | What the agent answers in a conversation when its budget is spent, the conversation’s or the workspace’s daily one, instead of calling the model. |
Fields marked ✦ accept expressions.
The approvalMode field sets how much the agent may do without asking a human. The agent’s own model calls are never gated; each tool call is gated by what that tool declares it does. See Add human approval.
Files the agent reads
Section titled “Files the agent reads”The attachments field hands the agent files to read this run: stored files, inbound email attachments, or a file an earlier node produced. It takes one reference or a JSON array of them, so everything that arrived by mail is:
{!! json_encode($start->payload->attachments) !!}In the node’s settings, Attachments picks stored files. Type part of a path, and the field lists the matching files of every file store in your workspace as Store › path, the newest first, 50 at most. One picked file is saved as its object id, several as a JSON array, and a list typed in before the field became a picker opens as its files. For mail attachments or a file an earlier node produced, click Insert a value ({x}) and write the expression there.
Each file reaches the model in the way it can use:
- Documents (PDF, Word and the other formats Read a File as Text reads) are extracted to text and put in the message. A long document is shortened to about 8,000 characters by keeping its beginning and its end, where a drawing’s title block, a list’s total or a contract’s signatures usually are, with a marker saying how much was left out. When a Read a File as Text node is wired to the agent as a tool, the marker tells the agent to read the whole file with it and names the file, so set that node’s source type to a stored file and let the agent fill in its source.
- Images are shown to the model when it can see, and named with the reason when it cannot.
- Files it cannot be given, because they cannot be read, are too large or do not exist, are named to the agent with the reason, so it can say so rather than answer as if nothing arrived.
A document is measured by what reaches the model, not by the file: it may be as large as Read a File as Text reads, and the 8 MB limit for a file applies to what is sent of it, such as the pages shown as pictures. So a drawing set too large to hand over whole can still be shown a page or a title block at a time. An image is held to 8 MB as it is.
A stored file is read once and the reading kept on the file, as with Read a File as Text, and the file’s row on the Files page shows this agent read it.
A file’s text reaches only the message it came with. When the agent remembers the conversation with a Chat Thread, later messages remember each file by its name and reference, not its text, so an agent with a Read a File as Text tool can read it again when a later question needs it.
How a PDF is shown
Section titled “How a PDF is shown”An entry of the array can be an object that says how its file is read, beside plain references:
[ { "id": "9m4e2mr0ui3e8a215n4g", "as": "image", "region": "title-block" }, { "id": "9m4e2mr0ui3e8a215n50", "as": "document", "pages": "1-3" }, "9m4e2mr0ui3e8a215n5k"]| Key | Values | What it does |
|---|---|---|
id |
a file reference | Required. The file, as any reference the field takes. |
as |
text (default), image, document |
How a PDF reaches the model. |
pages |
1, 2-4, last, 1,3,6-8 |
Which pages of a PDF. |
region |
title-block, bottom-right, right-strip, bottom-strip, or a box such as {"x": 0.6, "y": 0.7, "w": 0.4, "h": 0.3} |
Only part of each page; the values are those of Read a File as Text. |
keepOnFile |
summary, title, description |
Keep the agent’s answer on the file; see below. |
The options apply to PDFs only, and any other file is read as it would be without them. The three ways to show a PDF:
textputs its text in the message. Withpagesorregion, only those pages, or that part of each, each under a--- page 2 of 7 ---line.imageshows the selected pages as pictures (the first page when you name none, at most four), or theregionof each. This is the way to have a model read a drawing: a whole A1 sheet scaled down for a model is illegible, a title block rendered on its own is not. A page is rendered once and the picture kept on the file. For a model that cannot see, the PDF is read as text instead.documentsends the PDF itself, cut to the selected pages and at most 20 of them. The model reads each page both as text and as a picture, which suits a table that reads badly as extracted text, but it costs several times the tokens of the text on every step of the run: a 16-page A4 list can be 50,000 to 125,000 tokens against about 21,000 characters of text. It works with Anthropic, OpenAI, Gemini, OpenRouter and xAI models that can see. With any other model the PDF is read as text instead.
A pages or region that does not parse does not fail the run: the agent is told the file could not be read that way, and how to write the value.
Keeping the answer on the file
Section titled “Keeping the answer on the file”keepOnFile keeps the agent’s final answer on that file, as its summary, its title or a description, with the run, the node and the model that answered. It shows under Readings on the file’s row on the Files page, and a store kept searchable indexes it, so a drawing can later be found by what an agent said about it. To keep the answer on every attachment of a mail, map the email trigger’s array:
{!! json_encode(array_map(fn ($a) => ['id' => $a->id, 'keepOnFile' => 'summary'], $start->payload->attachments)) !!}Keeping the answer never fails the run.
Giving the agent tools
Section titled “Giving the agent tools”Connect a node to the agent’s tool handle to make it available as a tool. During its run the agent decides whether to call the tool, passes arguments, and reads the result back. Common tools are Database Select and Table Store Query for lookups, or Knowledge Base Query for retrieval.
To let the agent ask a person, hear how a run ended, or come back at a time, wire Ask the Person, Watch a Run or Follow Up Later. An agent behind a Chat trigger gets all three until you wire one of them.
To give the agent another flow as a tool, wire a Subflow node to the tool handle, or add the flow as a row of a Toolbox (see Build an agent). The flow’s Description tells the agent what it does.
Conversation memory
Section titled “Conversation memory”Give the agent memory across turns by attaching a Chat Thread node to the agent’s memory handle. Configure the Chat Thread with a stable per-conversation identity and it loads the conversation history before each model call and records the new exchange after.
Memory is a visible, composable part of the flow graph. Multiple memory nodes can attach to the same agent: their histories are concatenated in connection order, and each records the new exchange after. See Chat Threads and Memory for the full picture.
Structured answers
Section titled “Structured answers”By default the agent answers in free text: the Response schema field holds a single content field, and that text is what content in the output carries. Replace or extend those fields to make the agent return an object instead. The fields use the same builder as a flow’s input contract: name, kind, label, allowed values, nested groups and repeaters.
The shape is enforced, not requested. The agent’s instructions are extended with the rule and the list of fields, it is given a submit_response tool whose arguments are your fields, and its run ends only when it calls that tool with an answer that validates. Fields you did not declare are dropped, and a number or boolean the model spelled as text is converted before checking, so data is exactly the shape you declared. An answer that fails validation is handed back to the agent with every error, and it tries again; an agent that answers in prose is told once to submit instead, and that correction does not count against maxSteps. The result lands under data in the output, so a downstream node reads $prev->data->category directly, and the expression editor completes those names before the agent has ever run. If a later node’s expression names a $prev field the schema does not declare, saving that node shows a warning naming the fields that exist, so a typo is caught before the first run.
A support router, for example, declares category as a select with the allowed values, reply as a text area, and missingInfo as a repeater of kind and question. A Switch node then routes on $prev->data->category with no parsing in between. The canvas shows the declared fields under the node, and a run’s report page shows the answer as a table of those fields above the raw output. The template “Structured response — support router” (browse it under Templates) is this pattern end to end.
When such a flow is offered through MCP access or called as a Subflow, the tool’s description tells the calling model what the flow’s final output looks like, so it reads data.category off the result instead of guessing.
If the agent has a memory node, keep a content field for the reply a person reads beside the structured fields, or the conversation thread will hold the answer as JSON; the editor warns when it is missing. A file field cannot be used here, because a model cannot upload one; ask for an id or a URL instead. And no tool wired to the agent may be called submit_response, since that name is reserved for the answer.
Output
Section titled “Output”{ "content": "The customer's last order totalled €420.", "steps": 2, "truncated": false, "usage": { "inputTokens": 320, "outputTokens": 48, "cacheWriteTokens": 0, "cacheReadTokens": 0 }}content is the agent’s final answer and steps how many reasoning or tool-calling steps it took. truncated is true when the agent used up maxSteps and had to hand in an answer rather than finishing on its own, so a downstream node can treat that answer as partial. usage carries the token counts for the run, including prompt-cache reads and writes.
With a response schema the output also carries data:
{ "content": "{\"category\":\"VRAAG\",\"reply\":\"Bedankt voor uw bericht.\"}", "data": { "category": "VRAAG", "reply": "Bedankt voor uw bericht.", "missingInfo": [] }, "steps": 1, "truncated": false, "usage": { "inputTokens": 320, "outputTokens": 48, "cacheWriteTokens": 0, "cacheReadTokens": 0 }}data is the validated object. content is the object’s own content field when the schema declares one, and otherwise the object as JSON, so nodes that read $prev->content and conversation memory still get the answer. When the agent never submitted a valid object, data is null and dataError says why: it answered in text, it ran out of steps, or its last submission failed validation.
Example
Section titled “Example”The template “LLM / Agent — Order lookup” (browse it under Templates) is this pattern end to end: a support agent that looks up a customer.
- Wire a Database Select node to the agent’s
toolhandle. The template’s query markscustomerIdas a value the model supplies per call. - Set
systemMessageto instruct the agent to call the select tool and answer in one short sentence. - Set
promptto the question, for exampleLook up the customer with id seed-1 and tell me their name and email. - Set
maxStepsto5.
The agent calls the tool, reads the row, and answers in a sentence. steps is 2: the tool call plus the final answer.
Limitations
Section titled “Limitations”- A flow that runs inside an agent’s step (a Subflow target called from a nested agent) may not contain an Agent node of its own. Nesting agents that deep returns an error result instead of running.
- An agent runs one model router at a time. Wiring a second node to the
modelhandle does not add a fallback; the agent takes the first and records the others as ignored. Chain fallbacks inside that router instead: see model routing.
Related
Section titled “Related”- LLM Chat: a single completion with no tool use.
- Subflow: call another flow as a tool.
- Chat Thread: the memory node that gives an agent conversation history.
- Model routing and Search Tools: choose the model per request, keep a large tool set manageable.
- How to build an AI agent: end-to-end guide including memory wiring.
- MCP servers · Build a multi-agent flow · Add human approval · Give an agent web access
- Expressions: build the prompt from upstream data.