AI Nodes
AI nodes bring intelligence to your workflows. The AI Agent node is the core AI building block — it handles conversations autonomously with support for tools, knowledge bases, multi-turn memory, and multi-agent handoffs.
ai.agent
Let an AI agent handle the conversation with the contact.
The AI Agent node is a full-featured conversational agent. It can call tools, search knowledge bases, hand off to specialized sub-agents, and maintain multi-turn conversation memory — all within a single workflow node.
Configuration
| Option | Type | Required | Description |
|---|
agentId | string | No | Link to a pre-configured agent from the Agents page. Overrides inline config with the agent’s saved instructions, model, tools, and knowledge |
systemPrompt | string | Yes (if no agentId) | Instructions that define the agent’s personality, knowledge, and behavior |
model | string | No | AI model to use. Select from the available models in your workspace AI settings |
temperature | number | No | Response randomness, 0.0 to 2.0 (default: 0.7). Lower = more deterministic |
maxTokens | number | No | Maximum tokens in the generated response |
toolIds | array | No | IDs of tools the agent can call during execution (HTTP tools, integrations) |
enableWebSearch | boolean | No | Enable built-in OpenAI web search for real-time information |
knowledgeLinks | array | No | URLs or documents the agent can reference for context |
tone | string | No | Response tone (e.g., “professional”, “friendly”, “concise”) |
answerLength | string | No | Response length preference (e.g., “short”, “medium”, “detailed”) |
exitConditions | array | No | Conditions that end the agent’s turn (each with label and optional instruction) |
handoffAgentIds | array | No | IDs of other agents this agent can hand off to for specialized topics |
Linked Agents
Instead of configuring everything inline, you can link to a pre-configured agent from the Agents page. When agentId is set, the node inherits the agent’s:
- Instructions (system prompt)
- Model selection
- Tools (HTTP tools, integrations)
- Knowledge (documents, URLs)
Inline configuration overrides linked agent settings where both are specified.
AI Agent nodes can use tools during conversation to fetch information and take actions:
| Tool Type | Description |
|---|
| Web Search | Built-in OpenAI web search for real-time information (enable via enableWebSearch) |
| HTTP Tools | Call external REST APIs during execution |
| Integration Tools | Use connected third-party integrations (configured in Settings > Tools) |
When tools are configured, the agent autonomously decides when to call them based on the conversation context. Tool results are incorporated into the agent’s response.
Knowledge & RAG
Agents can access knowledge through two mechanisms:
- Knowledge Links: URLs and documents attached to the agent. Content is scraped and injected into the system prompt as context.
- Document Search (RAG): When documents are uploaded to an agent, the platform performs vector search against the inbound message to find relevant chunks. These are injected into the system prompt automatically.
Multi-Agent Handoffs
Agents can hand off conversations to specialized sub-agents. When handoffAgentIds is configured:
- The primary agent receives the message and begins processing
- If the conversation requires a different specialization, the agent transfers to the appropriate handoff agent
- The handoff agent takes over with its own instructions, tools, and knowledge
- The handoff chain is logged in the run step output
Each handoff agent is a fully configured agent with its own system prompt, tools, and knowledge base.
Exit Conditions
Define conditions that end the agent’s turn and route to the next node in the workflow:
| Field | Type | Description |
|---|
label | string | Name of the exit condition (e.g., “needs_human”, “purchase_complete”) |
instruction | string | Optional guidance for the AI on when to trigger this exit |
Exit conditions create output handles on the node, enabling branching logic based on the agent’s assessment of the conversation.
Outputs
| Output | Type | Description |
|---|
response.text | string | The generated response text |
response.exitCondition | string | Which exit condition was triggered (if any) |
response.tokensUsed | object | Token consumption breakdown (prompt, completion, total) |
response.toolCalls | array | Log of tools called during execution |
response.lastAgent | string | Name of the agent that produced the final response (relevant for handoffs) |
response.handoffChain | array | Sequence of agent handoffs that occurred |
Connections
- Inputs: Single input handle receiving conversation context
- Outputs: Default output handle, plus one handle per exit condition
Multi-Turn Conversations
AI Agent nodes automatically maintain persistent multi-turn memory. Each WhatsApp contact gets a dedicated conversation thread, so the agent remembers previous messages without you managing context manually.
Example Use Cases
Customer support agent: Configure with your product knowledge base, connect HTTP tools for order lookup, and set exit conditions for “needs_human” (routes to wa.handoff) and “issue_resolved” (routes to a satisfaction survey).
Sales qualification agent: Link a sales-focused agent with web search enabled, set tone to “professional”, and configure handoff agents for “technical_questions” (routes to a technical specialist agent) and “pricing_inquiries” (routes to a pricing agent).
Token costs: AI agent execution consumes tokens billed by OpenAI. Always set a maxTokens limit to control costs. The platform enforces a per-run safety cap of 150,000 tokens to prevent runaway agent loops. The agent runs a maximum of 6 turns per execution.