2026-02-05 09:21:52 +00:00
---
id: agent
title: Agent Node
---
2026-02-05 10:19:49 +00:00
< br / >
2026-02-13 06:56:01 +00:00
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.
2026-02-05 10:19:49 +00:00
## Configuration
### Configuring Agent
| Setting | Description |
|:--------|:------------|
| **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
2026-02-06 07:46:51 +00:00
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.
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
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.
2026-02-05 10:19:49 +00:00
< img className = "screenshot-full img-full" src = "/img/workflows/nodes/agent/agent-tools.png" alt = "Agent Tools Configuration" / >
2026-02-06 07:46:51 +00:00
#### Supported Tool Types
You can use any workflow node as a tool, including:
- **Datasource Queries**: PostgreSQL, MySQL, MongoDB, and other database queries
- **REST API**: Connect to external services like Slack, GitHub, Gmail, Twilio, etc.
- **JavaScript**: Custom logic for data transformation or complex operations
- **ToolJet Database**: Query your ToolJet Database tables
2026-02-05 10:19:49 +00:00
## Accessing Agent Node Data
### Inside Tools
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` :
```js
agent1.data
```
2026-02-06 07:46:51 +00:00
## Use Cases
2026-02-13 06:56:01 +00:00
<!--
2026-02-06 07:46:51 +00:00
### Customer Support Agent
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
Create an agent that looks up customer information, creates support tickets, and retrieves order history.
**Tools:**
| Tool | Type | Description |
|:-----|:-----|:------------|
| `lookupCustomer` | PostgreSQL | Queries the database for customer details by email |
| `createTicket` | REST API | Creates a new support ticket in the ticketing system |
| `getOrderHistory` | PostgreSQL | Retrieves recent orders for a customer |
2026-02-05 10:19:49 +00:00
**System Prompt:**
```
2026-02-06 07:46:51 +00:00
You are a Customer Support Automation Agent.
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
Process the user's message and execute the following steps in order:
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
1. Extract: user_name, user_email, issue_summary, tags, priority ("critical", "normal", "low")
2. Look up the customer using "lookupCustomer"
3. Create a support ticket using "createTicket"
4. Retrieve order history using "getOrderHistory"
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
Rules:
- Always call lookupCustomer first
- Always call createTicket after verifying customer
- Do not ask follow-up questions
```
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
< img className = "screenshot-full img-full" src = "/img/workflows/nodes/agent/customer-support-agent.png" alt = "Customer Support Agent" / >
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
### GitHub Issue Triager
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
Automate issue management by analyzing new issues and assigning labels, assignees, and priorities.
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
**Tools:**
| Tool | Type | Description |
|:-----|:-----|:------------|
| `getIssueDetails` | GitHub | Fetches issue title, description, and metadata |
| `addLabels` | GitHub | Adds appropriate labels to the issue |
| `assignReviewer` | GitHub | Assigns a team member based on issue type |
| `postComment` | GitHub | Posts a welcome comment or asks for more details |
**System Prompt:**
```
You are a GitHub Issue Triage Agent.
When a new issue is created:
1. Analyze the issue content using "getIssueDetails"
2. Categorize it (bug, feature, documentation, question)
3. Add appropriate labels using "addLabels"
4. Assign to the right team member using "assignReviewer"
5. Post a helpful comment using "postComment"
Label guidelines:
- Bug reports: add "bug" and priority label
- Feature requests: add "enhancement"
- Questions: add "question" and post documentation links
2026-02-05 10:19:49 +00:00
```
2026-02-13 06:56:01 +00:00
< img className = "screenshot-full img-full" src = "/img/workflows/nodes/agent/github-issue-triager.png" alt = "GitHub Issue Triage" / > -->
2026-02-05 10:19:49 +00:00
2026-02-06 07:46:51 +00:00
### Slack Notification Agent
Monitor events and send contextual notifications to the right Slack channels.
**Tools:**
| Tool | Type | Description |
|:-----|:-----|:------------|
| `getAlertDetails` | PostgreSQL | Fetches alert information from the database |
| `getUserOnCall` | REST API | Gets the current on-call engineer |
| `sendSlackMessage` | Slack | Sends a message to a Slack channel |
| `createIncident` | REST API | Creates an incident in your incident management system |
**System Prompt:**
2026-02-05 10:19:49 +00:00
```
2026-02-06 07:46:51 +00:00
You are an Alert Notification Agent.
When an alert is triggered:
1. Get alert details using "getAlertDetails"
2. Determine severity (critical, warning, info)
3. For critical alerts:
- Get on-call engineer using "getUserOnCall"
- Create incident using "createIncident"
- Send urgent Slack message using "sendSlackMessage"
4. For warnings: send Slack message to #engineering -alerts
5. For info: send Slack message to #system -logs
Always include: alert name, severity, timestamp, and recommended action.
2026-02-05 10:19:49 +00:00
```
2026-02-13 08:31:49 +00:00
< img className = "screenshot-full img-m" src = "/img/workflows/nodes/agent/slack-agent-sys.png" alt = "Slack Agent" / >
2026-02-13 06:56:01 +00:00
**How It Works:**
2026-02-13 08:26:52 +00:00
```
Webhook Trigger (alert_id)
│
▼
Agent Node receives User Prompt
"New alert triggered. Alert ID: {{ startTrigger.params.alert_id }}"
│
▼
Agent Reasoning
AI model reads system + user prompt, plans tool calls
│
▼
Tool: getAlertDetails (PostgreSQL)
Fetches severity, service name, timestamp
│
▼
Severity Check
┌─────────────┬─────────────────┬──────────────────┐
│ Critical │ Warning │ Info │
│ │ │ │ │ │ │
│ ▼ │ ▼ │ ▼ │
│getUserOnCall│ sendSlackMessage│ sendSlackMessage │
│ │ │ #eng -alerts │ #system -logs │
│ ▼ │ │ │
│createIncident │ │
│ │ │ │ │
│ ▼ │ │ │
│sendSlackMsg │ │ │
│ #incidents │ │ │
└─────────────┴─────────────────┴──────────────────┘
│
▼
Output → agentNodeName.data
Summary: incident ID, Slack message sent, on-call notified
```
2026-02-13 06:56:01 +00:00
2026-02-06 07:46:51 +00:00
< img className = "screenshot-full img-full" src = "/img/workflows/nodes/agent/slack-agent.png" alt = "Slack Agent" / >
### Email Assistant Agent
Process incoming emails and draft responses or route them to the appropriate team.
2026-02-05 10:19:49 +00:00
**Tools:**
2026-02-06 07:46:51 +00:00
| Tool | Type | Description |
|:-----|:-----|:------------|
| `getEmailContent` | Gmail | Fetches email subject, body, and sender info |
| `classifyEmail` | JavaScript | Analyzes email intent and urgency |
| `draftReply` | Gmail | Creates a draft response |
| `forwardEmail` | Gmail | Forwards to the appropriate department |
| `logEmail` | PostgreSQL | Logs the email for tracking |
**System Prompt:**
```
You are an Email Processing Agent.
For each incoming email:
1. Get email content using "getEmailContent"
2. Classify the email type (inquiry, complaint, order, spam)
3. Based on classification:
- Inquiries: draft a helpful reply using "draftReply"
- Complaints: forward to support team using "forwardEmail"
- Orders: log in database using "logEmail"
- Spam: ignore
4. Log all processed emails in the database
Maintain a professional and helpful tone in all responses.
```
2026-02-05 10:19:49 +00:00
2026-02-13 08:31:49 +00:00
< img className = "screenshot-full img-m" src = "/img/workflows/nodes/agent/email-agent-sys.png" alt = "Slack Agent" / >
2026-02-13 06:56:01 +00:00
**How It Works:**
2026-02-13 08:26:52 +00:00
```
Webhook / Cron Trigger (email_id)
│
▼
Agent Node receives User Prompt
"Process incoming email. Email ID: {{ startTrigger.params.email_id }}"
│
▼
Agent Reasoning
AI model reads system + user prompt, plans tool calls
│
▼
Tool: getEmailContent (Gmail)
Fetches subject, body, sender details
│
▼
Tool: classifyEmail (JavaScript)
Returns classification: inquiry / complaint / order / spam
│
▼
Classification Check
┌────────────┬────────────┬────────────┬──────────┐
│ Inquiry │ Complaint │ Order │ Spam │
│ │ │ │ │ │ │ │
│ ▼ │ ▼ │ ▼ │ Ignore │
│ draftReply │forwardEmail│ logEmail │ │
│ (Gmail) │ (Gmail) │(PostgreSQL)│ │
└────────────┴────────────┴────────────┴──────────┘
│
▼
Tool: logEmail (PostgreSQL)
Logs all processed emails for tracking
│
▼
Output → agentNodeName.data
Summary: email classified, action taken, tracking ID
```
2026-02-13 06:56:01 +00:00
2026-02-06 07:46:51 +00:00
< img className = "screenshot-full img-full" src = "/img/workflows/nodes/agent/email-assistant.png" alt = "Email Assistant" / >
2026-02-05 10:19:49 +00:00
## Limitations
- The agent's performance depends on the underlying AI model's capabilities
- Complex multi-tool workflows may require higher max steps settings
- API rate limits from AI providers may affect execution
< br / >
---
## Need Help?
- Reach out via our [Slack Community ](https://join.slack.com/t/tooljet/shared_invite/zt-2rk4w42t0-ZV_KJcWU9VL1BBEjnSHLCA )
- Or email us at [support@tooljet.com ](mailto:support@tooljet.com )
- Found a bug? Please report it via [GitHub Issues ](https://github.com/ToolJet/ToolJet/issues )