🧑‍💻

# Agent

ai.agent

Autonomous agent that uses tools to accomplish goals.

Destructive action

An Agent enabled with high-blast-radius tools (Run Script, Write File, Apple Notes write, Apple Reminders write) decides for itself when to invoke them based on the goal and incoming payload — including indirect prompt injection through templated inputs. Enable destructive tools only when the goal genuinely requires them. Workflows that enable any destructive agent tool prompt for confirmation on every arm.

## Description

The Agent node goes beyond simple prompting — it creates an autonomous agent that reasons, plans, and uses tools iteratively to accomplish complex goals. The agent loops through thinking, tool use, and observation cycles until it reaches a solution or hits its configured limits.

Use it for tasks that require multiple steps, external data gathering, or adaptive decision-making that a single prompt cannot handle.

## How It Works

1. 1
   Think — The agent analyzes the goal and current context, deciding what action to take next.
2. 2
   Act — The agent calls a tool (run a script, make an API request, read a file, etc.).
3. 3
   Observe — The agent reads the tool output and incorporates it into its reasoning.
4. 4
   Repeat — Steps 1–3 continue until the goal is achieved or limits are reached.
5. 5
   Verify — If enabled, the agent reviews its own result before completing.

## Ports

Inlets
Input (any)
Outlets
Result (any)

## Configuration

Parameter | Type | Default | Description
--- | --- | --- | ---
`goal` | textarea | — | Task description with `{{variable}}` references to payload data.
`systemPrompt` | textarea | — | Agent persona and constraints. Optional.
`provider` | provider picker | — | AI provider to use (configured in Settings).
`model` | model picker | — | Model selection. Available models depend on the selected provider.
`temperature` | number | `0.7` | Controls response randomness.
`maxIterations` | number | `10` | Maximum number of think/act/observe reasoning iterations.
`tokenBudget` | number | `0` | Maximum total tokens across all iterations. Set to 0 for unlimited.
`verify` | boolean | `true` | When enabled, the agent verifies its result before completing.
`verificationPrompt` | textarea | — | Custom verification prompt. Visible when `verify` is enabled. Optional.

## Output Payload

The Agent node adds the following variables to the payload:

    {
      "result": "The agent's final answer or output",
      "steps": 4,
      "tokens_used": 3842,
      "tools_called": ["run_script", "api_request"],
      "trace": [
        { "type": "think", "content": "I need to fetch the latest posts..." },
        { "type": "tool", "name": "api_request", "input": "..." },
        { "type": "observe", "content": "Got 30 posts from the API..." },
        { "type": "result", "content": "Here are the top 3 posts..." }
      ]
    }

## Example Workflow

A scheduled workflow that uses an agent to gather and summarize information, then saves the result to a file:

The Schedule trigger fires daily. The Agent receives the goal and autonomously fetches data, analyzes it, and produces a summary. The Write File action saves the result.

## Tips

- Use the `systemPrompt` to constrain the agent's behavior and focus its tool use on relevant actions.
- Set a `tokenBudget` to prevent runaway costs when using cloud providers.
- Keep `verify` enabled for important workflows — it catches cases where the agent thinks it succeeded but the result is incomplete.
- The `trace` output is useful for debugging agent behavior and understanding its reasoning process.