The **Agent Node** enables AI-powered automation within your workflows. It connects to AI Models and can use tools (Slack, Gmail, GitHub, etc.) to perform multi-step reasoning and task execution. The agent autonomously decides which tools to use and how to combine their results to accomplish complex tasks.
| **System Prompt** | Instructions that define the agent's behavior, persona, and constraints. |
| **User Prompt** | The task or question for the agent to process. Supports dynamic values using `{{ }}` syntax. |
| **Output Format** | Defines the structure of the agent's final response. Use this to specify a JSON schema or format that the agent should follow when returning results. |
### AI Model
Connect the Agent node to an AI model datasource by linking it to the **ai-model** handle on the node.
Supported AI providers:
- OpenAI
- Anthropic
- Gemini
- Mistral AI
#### Model Parameters
| Parameter | Description |
|:----------|:------------|
| **Temperature** | Controls randomness in responses. Higher values (0-1) produce more creative outputs. |
| **Max Tokens** | Maximum number of tokens the model can generate in a response. |
| **Top P** | Alternative to temperature for controlling randomness via nucleus sampling (0-1). |
| **Max Steps** | Maximum number of reasoning steps/iterations the agent can take. |
| **Max Retries** | Number of retry attempts for failed API calls. |
| **Timeout** | Maximum time in milliseconds for the agent to complete execution. |
| **Stop Sequences** | Sequences that signal the model to stop generating further text. |
Tools allow the agent to interact with your data and perform actions. Each tool is a workflow node that the agent can invoke. The agent autonomously decides which tools to use based on the task and your system prompt instructions.
To add tools, drag nodes from the Agent node's tool handle to connect datasource queries, REST API calls, JavaScript nodes, or any other workflow nodes.
When the agent invokes a tool, it passes parameters that you can access within the tool node. Use the following syntax to retrieve these values:
```js
aiParameters.<paramName>
```
The parameter names are determined by the agent based on your system prompt instructions. For example, if your system prompt instructs the agent to extract `user_email` from the user's message, you can access it in your tool as:
```js
aiParameters.user_email
```
### Outside Agent Node
Only the final result of the agent node can be accessed by other nodes in the workflow. If you need specific data in the output, define the expected output format in your system prompt.
To access the agent's output in subsequent nodes, use the following syntax:
```js
<agentNodeName>.data
```
For example, if your agent node is named `agent1`:
1.**Trigger** — A workflow trigger (e.g., a webhook from your monitoring system) fires and passes alert data like `alert_id` into the workflow.
2.**User Prompt** — The alert data is injected into the Agent Node's user prompt using dynamic syntax, for example: `New alert triggered. Alert ID: {{ startNode.data.alert_id }}`. This is the task the agent receives.
3.**Agent Reasoning** — The AI model reads the system prompt and user prompt, then plans its approach. It decides which tools to call and in what order.
4.**Tool Execution** — The agent starts executing:
- Calls `getAlertDetails` with the alert ID to fetch severity, service name, and timestamp from PostgreSQL.
- Based on the returned severity, it branches its logic. For a critical alert, it calls `getUserOnCall` to find the on-call engineer, then `createIncident` to open an incident, and finally `sendSlackMessage` to notify the #incidents channel with all the details.
5.**Output** — The agent compiles a final response summarizing the actions it took (e.g., incident ID created, Slack message sent, on-call engineer notified). This output is available to downstream nodes via `agentNodeName.data`.
1.**Trigger** — A workflow trigger (e.g., a webhook from Gmail or a scheduled cron job) fires when a new email arrives and passes the `email_id` into the workflow.
2.**User Prompt** — The email ID is passed into the Agent Node's user prompt dynamically, for example: `Process incoming email. Email ID: {{ startNode.data.email_id }}`. This tells the agent which email to work on.
3.**Agent Reasoning** — The AI model reads the system prompt and user prompt, then determines the sequence of tool calls needed to process this email.
4.**Tool Execution** — The agent starts executing:
- Calls `getEmailContent` with the email ID to fetch the subject, body, and sender details from Gmail.
- Passes the email content to `classifyEmail`, a JavaScript node that returns the classification (e.g., "complaint").
- Based on the classification, the agent branches: for a complaint, it calls `forwardEmail` to route it to the support team. For an inquiry, it would call `draftReply` to compose a response.
- Finally, it calls `logEmail` to record the email and the action taken in PostgreSQL.
5.**Output** — The agent returns a summary of what it did (e.g., email classified as "complaint", forwarded to support@company.com, logged with tracking ID #4521). This output is available to downstream nodes via `agentNodeName.data`.