Agent Tool
The Agent Tool Node in the XpertAI platform's Workflow serves as a callable tool for an Agent, executing a predefined sub-workflow to accomplish specific tasks when triggered.
Compared to the Task Handover nodeโs single-task transfer mode, the Agent Tool Node can, upon invocation:
- Execute multi-step, complex sub-workflows
- Invoke multiple functional nodes
- Branch or loop based on task results
This makes it highly suitable for scenarios requiring multi-step processing or complex logic orchestration.
How It Worksโ
Tool Registration and Invocation
- The Agent Tool Node can be registered as an โavailable toolโ by any higher-level Agent.
- The higher-level Agent can actively call this tool node to perform specific tasks during task processing.
Connecting Sub-Workflows
The Agent Tool Node can connect to a single subsequent node or multiple nodes to form a complete sub-workflow.
Sub-workflows can include:
- Data processing nodes
- Computation and analysis nodes
- External API calls
- File/database operations
- Interactions with other agents
Task Context Passing
- When called, the Agent Tool Node receives contextual information (task content, variables, history, etc.) from the upstream Agent.
- All nodes within the sub-workflow can access and utilize this contextual information.
Task Completion and Result Return
- After the sub-workflow is executed, the Agent Tool Node returns the processing results to the calling Agent or passes them to subsequent nodes in the main workflow (if the tool is an endpoint).
Configuration Detailsโ
After adding an Agent Tool Node in the Workflow editor, the following configurations are available:
Configuration Item | Description |
---|---|
Node Name | Custom display name for the node in the workflow |
Node Description | Custom description for the node in the workflow |
Tool Name | Name of the tool for reference during Agent invocation |
Tool Description | Functional description for reference during Agent invocation |
Input Parameters | Define variables and data that can be passed during invocation |
Sub-Workflow Structure | Configure connected sub-nodes and their execution logic |
Endpoint | Specify if the tool is an endpoint; if so, the Agent response ends or proceeds to subsequent Agent nodes |
Use Case Examplesโ
1. Data Processing and Analysis Toolโ
Main Agent receives a task to โgenerate a market analysis report.โ
Calls the Agent Tool Node to execute a sub-workflow:
- Data Collection Node โ Retrieve raw data
- Data Cleaning Node โ Remove outliers
- Visualization Generation Node โ Output charts
2. Automated Content Generation Toolโ
Main Agent is responsible for planning a marketing campaign.
Calls the Agent Tool Node to execute:
- Copywriting Node โ Generate initial draft
- Language Polishing Node โ Refine expression
- Image Generation Node โ Provide accompanying visuals
3. Business Approval Sub-Workflowโ
Main Agent receives a โleave requestโ task.
Calls the Agent Tool Node to execute:
- Check leave balance
- Send approval request
- Notify applicant of approval result
Advantagesโ
- Highly Scalable: Supports sub-workflows of any complexity
- Multi-Function Integration: Can call external APIs, databases, and other tools
- Context Integrity: Ensures tasks in the sub-workflow align with the main workflowโs information
- Reusability: A single Agent Tool Node can be invoked by multiple different Agents
Best Practicesโ
- When designing an Agent Tool Node, clearly define functional goals to avoid overly scattered logic.
- Use reusable functional nodes in sub-workflows to facilitate cross-scenario invocation.