AI Agent
Runs an autonomous AI agent that can make HTTP requests to complete a task. Unlike the AI Text node, which sends a single prompt and returns the response, the AI Agent node gives the model a goal and lets it decide for itself what HTTP calls to make in order to reach a final answer.
How it works
The agent uses the ReAct pattern (Reason + Act):
- The model receives the system prompt and task.
- The model reasons about what information it needs and calls the
http_requesttool. - The HTTP response is fed back to the model.
- The model either calls another tool or returns a final answer.
- This repeats up to Max Iterations times.
This is the same pattern used by AI assistants that "search the web" or "call an API" to answer questions — the model drives the process, not the workflow.
Properties
| Property | Required | Description |
|---|---|---|
| Model | No | The language model to use. Defaults to the model configured in your deployment settings |
| System Prompt | Yes | Defines the agent's role and what it should do. Should describe the goal and any constraints. Supports expressions |
| Task | Yes | The specific task to complete. Supports expressions |
| Max Iterations | No | Maximum number of tool call / response cycles before giving up (default: 10) |
Model options
See AI Text → Model options. The same models are available. For agentic tasks, models with stronger reasoning (Claude 3.5 Sonnet, GPT-4o) tend to produce more reliable results than smaller models.
Built-in tool: http_request
The agent has access to one tool: http_request. It can call any URL with any method, body, and headers.
| Parameter | Required | Description |
|---|---|---|
url | Yes | The URL to request |
method | No | GET, POST, PUT, DELETE, or PATCH (defaults to GET) |
body | No | JSON string body for write requests |
headers | No | Key/value HTTP headers |
The tool returns statusCode, contentType, and the response body. JSON responses are automatically parsed so the model receives structured data rather than raw text.
Non-JSON response bodies are truncated to 4 000 characters to avoid exceeding the model's context window.
Output
| Field | Type | Description |
|---|---|---|
answer | String | The agent's final answer |
model | String | The model ID that was used |
iterationCount | Number | How many LLM calls were made |
toolCallCount | Number | How many http_request calls were made |
Access these downstream via expressions:
{{ $nodes['Research Agent'].answer }}
{{ $nodes['Research Agent'].toolCallCount }}
Examples
Look up live exchange rates
- System Prompt:
You are a currency conversion assistant. Use the http_request tool to fetch live exchange rate data from a public API, then answer the user's question. - Task:
What is {{ $nodes['Form'].amount }} USD in EUR right now?
Enrich a contact record
- System Prompt:
You enrich company records. Given a company domain, use the http_request tool to look up publicly available information and return a JSON object with "name", "description", and "country". - Task:
Enrich the company with domain: {{ $nodes['Webhook'].body.domain }}
Conditional multi-step API interaction
- System Prompt:
You interact with a REST API on behalf of the user. The base URL is https://api.example.com. Use the Authorization header "Bearer {{ $env.API_TOKEN }}" on every request. Complete the task by making whatever API calls are necessary. - Task:
Create a new project called "{{ $nodes['Form'].projectName }}", then add the user with email "{{ $nodes['Form'].email }}" to it.
Notes
- The node fails if the model does not return a final answer within Max Iterations cycles. Increase the limit for tasks that require many lookups.
- The agent can access any URL reachable from your worker host. If you need to restrict which URLs the agent can call, set your system prompt to explicitly require the agent to use specific base URLs.
- Use the
iterationCountandtoolCallCountoutput fields to monitor cost and complexity in your execution logs. - For simple single-call AI operations, use AI Text instead — it is faster and cheaper.