n8n-nodes-agenthub
v1.0.1
Published
n8n nodes for AgentHub integration
Readme
n8n AgentHub Node
A custom n8n node for seamless integration with AgentHub AI agents. This node allows you to hire, execute, and manage AI agents directly from your n8n workflows.
Features
- Agent Management: Search, list, and get details about available AI agents
- Hiring Operations: Hire agents, manage hiring status, and view hiring details
- Agent Execution: Execute hired agents with custom input data
- Deployment Management: Create, monitor, and control agent deployments
- Persistent Agents: Initialize and manage persistent agent instances
Installation
Option 1: Install as a Community Node Package
- In your n8n instance, go to Settings → Community Nodes
- Click Install and search for
n8n-nodes-agenthub - Install the package and restart n8n
Option 2: Manual Installation
For macOS/Linux:
Clone this repository:
git clone https://github.com/agenthub/n8n-agenthub-node.git cd n8n-agenthub-nodeInstall dependencies:
npm installBuild the package:
npm run buildRun the installation script:
./install.sh
For Windows:
Clone this repository:
git clone https://github.com/agenthub/n8n-agenthub-node.git cd n8n-agenthub-nodeInstall dependencies:
npm installBuild the package:
npm run buildRun the Windows installation script:
install-windows.bat
Manual Windows Installation:
If you prefer to install manually on Windows:
- Build the package:
npm run build - Copy the
distfolder contents to your n8n custom directory:- Default:
C:\Users\{YourUsername}\.n8n\custom\ - Alternative:
C:\Users\{YourUsername}\AppData\Roaming\n8n\custom\
- Default:
- Restart n8n
Option 3: Direct Copy Installation
- Build the package:
npm run build - Copy the
distfolder contents to your n8n custom nodes directory:- macOS/Linux:
~/.n8n/custom/ - Windows:
C:\Users\{YourUsername}\.n8n\custom\
- macOS/Linux:
- Restart n8n
Configuration
1. Create AgentHub Credentials
- In your n8n workflow, add an AgentHub node
- Click on the credentials field and select Create New
- Fill in the following details:
- Base URL: Your AgentHub server URL (e.g.,
http://localhost:8002) - API Key: Your AgentHub API key
- User ID: Your AgentHub user ID (optional)
- Base URL: Your AgentHub server URL (e.g.,
2. Get Your API Key
- Log into your AgentHub instance
- Go to Profile → API Keys
- Create a new API key or copy an existing one
Usage Examples
Example 1: Execute an AI Agent
This workflow demonstrates how to execute a hired AI agent:
AgentHub Node (Hiring → List Hirings)
- Lists your active hirings
- Outputs hiring IDs and agent details
AgentHub Node (Execution → Execute Agent)
- Uses the hiring ID from the previous node
- Sends input data to the agent
- Waits for completion and returns results
Process Results
- Parse the agent's response
- Continue with your workflow logic
Example 2: Hire and Deploy a New Agent
AgentHub Node (Agent → Search Agents)
- Search for agents by category or query
- Find the perfect agent for your needs
AgentHub Node (Hiring → Hire Agent)
- Hire the selected agent
- Specify requirements and billing cycle
AgentHub Node (Deployment → Create Deployment)
- Create deployment for the hiring
- Wait for deployment to be ready
AgentHub Node (Execution → Execute Agent)
- Execute the newly deployed agent
Example 3: Persistent Agent Management
AgentHub Node (Execution → Initialize Agent)
- Initialize a persistent agent with configuration
- Set up the agent's state and context
AgentHub Node (Execution → Execute Agent)
- Execute the initialized agent multiple times
- Maintain state between executions
AgentHub Node (Execution → Get Status)
- Monitor execution progress
- Handle long-running operations
Node Operations
Agent Operations
- List Agents: Browse available agents with optional filtering
- Get Agent: Retrieve detailed information about a specific agent
- Search Agents: Find agents by query, category, or other criteria
Hiring Operations
- Hire Agent: Hire an agent for your use
- List Hirings: View all your active and past hirings
- Get Hiring Details: Get comprehensive information about a hiring
- Cancel Hiring: Terminate an active hiring
- Suspend Hiring: Pause a hiring temporarily
- Activate Hiring: Resume a suspended hiring
Execution Operations
- Execute Agent: Run a hired agent with input data
- Get Execution Status: Check the status of an execution
- Initialize Agent: Set up a persistent agent instance
Deployment Operations
- Create Deployment: Deploy a hired agent
- Get Deployment Status: Monitor deployment progress
- Stop Deployment: Terminate a running deployment
- List Deployments: View all your deployments
Input Data Format
Agent Execution Input
{
"query": "What is the weather in New York?",
"context": "I need this for a business meeting",
"format": "json"
}Agent Initialization
{
"model": "gpt-4",
"temperature": 0.7,
"max_tokens": 1000,
"system_prompt": "You are a helpful AI assistant"
}Output Format
The node returns structured data that includes:
- Execution ID: Unique identifier for the execution
- Status: Current execution status (pending, running, completed, failed)
- Output Data: The agent's response
- Metadata: Execution details, timing, and resource usage
Error Handling
The node includes comprehensive error handling:
- Validation Errors: Invalid input data or parameters
- Authentication Errors: Invalid API key or permissions
- Execution Errors: Agent execution failures
- Network Errors: Connection issues with AgentHub
Best Practices
- Use Wait for Completion: Enable this option for synchronous workflows
- Handle Errors Gracefully: Use n8n's error handling nodes
- Monitor Resource Usage: Track API calls and execution costs
- Cache Results: Store frequently used agent responses
- Rate Limiting: Respect API rate limits in high-volume workflows
Troubleshooting
Common Issues
Authentication Failed
- Verify your API key is correct
- Check that your user account is active
Agent Not Found
- Ensure the agent ID is correct
- Verify the agent is approved and available
Execution Timeout
- Increase the timeout value for long-running agents
- Check if the agent requires initialization
Deployment Failed
- Verify the hiring is active
- Check server resources and logs
Node Not Appearing in n8n?
macOS/Linux:
- Check
~/.n8n/custom/directory exists - Verify files were copied correctly
- Restart n8n completely
Windows:
- Check
C:\Users\{YourUsername}\.n8n\custom\directory - Alternative:
C:\Users\{YourUsername}\AppData\Roaming\n8n\custom\ - Verify files were copied correctly
- Restart n8n completely
Debug Mode
Enable debug logging in n8n to see detailed API requests and responses.
Support
- Documentation: AgentHub Docs
- Issues: GitHub Issues
- Community: AgentHub Community
License
MIT License - see LICENSE file for details.
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Changelog
v1.0.0
- Initial release
- Support for agent hiring, execution, and deployment
- Comprehensive error handling
- TypeScript implementation
- Cross-platform installation scripts
