@kaia-team/n8n-nodes-kaia
Version:
n8n nodes for Kaia LLM integration
103 lines (74 loc) • 3.5 kB
Markdown
# n8n Kaia Integration
This package provides n8n nodes for integrating with the Kaia LLM platform, including:
- **Kaia Node**: For making API requests to the admin instance and headless widget API
- **Kaia Trigger**: For creating system webhooks and receiving webhook events
## Installation
Follow the installation instructions for the n8n community nodes. After installation, the nodes will appear in the n8n editor.
## Features
### Kaia Node
- Make API requests to the Kaia admin instance
- Interact with the headless widget API
- Support for authentication via Admin Tokens
- Handle various HTTP methods (GET, POST, PUT, DELETE)
- Resources: Widgets (CRUD), Assistants (CRUD + models), Statistics, Chat Histories, User Accounts (incl. credits), Function Calls, Answer Ratings/Reportings, Summary Config, User Files, API Configs, Documents (CRUD + shards), Document Imports, Admin Tokens, Vector DBs (CRUD + extras), Document Shards, Crawls (websites), Feeds, Contents, Link Packages, Shop (redeem codes)
- File upload support for relevant endpoints
### Kaia Trigger
- Create system webhooks in the Kaia platform
- Receive webhook events from various models
- Automatic authentication and token management
- Support for multiple webhook configurations
- Event filtering by model and type
## Authentication
The integration uses Admin Tokens for authentication. You'll need to:
1. Create an Admin Token in your Kaia admin interface
2. Configure the token in the node credentials
3. The token will be automatically used for API requests
## Usage Examples
### Making API Requests
Use the Kaia node to interact with various endpoints:
- **GET /assistants** - List all assistants
- **POST /chat_histories** - Create chat history
- **GET /api_configs** - List API configurations
- **POST /system_webhooks** - Create system webhooks
- **POST /widget_configs.json** - Create widget config
- **POST /redeem_codes.json** - Create redeem code
### Creating Webhooks
Use the Kaia Trigger to create webhooks that listen for events:
- **Model Events**: Listen for changes to specific models
- **Event Types**: Create, update, delete events
- **Payload Processing**: Handle webhook payloads in your workflows
## Configuration
### Admin Instance URL
Set the base URL for your Kaia admin instance (e.g., `https://your-instance.kaia.team`)
### Admin Token
Provide your Admin Token for authentication. The token should have the necessary permissions for the operations you want to perform.
## Webhook Events
The system webhooks can listen for events on various models:
- **UserAccount**: User account changes
- **Assistant**: Assistant configuration changes
- **ChatHistory**: Chat history updates
- **ApiConfig**: API configuration changes
- **SystemWebhook**: Webhook management events
- **Document**: Document changes
- **VecDb**: Vector database changes
- **DocumentShards**: Document shard events
- **Crawl**: Website crawl events
- **Feed**: Feed management events
- **Content**: Content changes
- **LinkPackage**: Link package events
- **Shop**: Shop redeem events
## Error Handling
The nodes include comprehensive error handling:
- Authentication errors
- Network connectivity issues
- API rate limiting
- Invalid request parameters
## Development
To contribute to this package:
1. Fork the repository
2. Install dependencies: `npm install`
3. Build the package: `npm run build`
4. Test your changes
5. Submit a pull request
## License
MIT License - see LICENSE file for details.