Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n8n-nodes-wxai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
n8n-nodes-wxai
This is an n8n community node that integrates WXAI API with Gemini 2.0 Flash model into your n8n workflows. It provides powerful AI chat completion capabilities with configurable parameters for enhanced automation.
n8n is a fair-code licensed workflow automation platform.
✨ Features
- 🤖 Gemini 2.0 Flash Model: Access to Google's latest Gemini model via WXAI
- 💬 Chat Completions: Full conversation support with system, user, and assistant roles
- ⚙️ Configurable Parameters: Fine-tune responses with temperature, top-p, and token limits
- 🔄 SSE Support: Automatic handling of Server-Sent Events responses
- 🛡️ Error Handling: Comprehensive error management and validation
- 📝 TypeScript: Full type safety and IntelliSense support
- 🎯 Easy Integration: Simple setup and configuration in n8n
📦 Installation
Option 1: n8n Community Nodes (Recommended)
- Go to Settings > Community Nodes in your n8n instance
- Click Install a community node
- Enter:
n8n-nodes-wxai - Click Install
For detailed instructions, follow the n8n community nodes installation guide.
Option 2: Manual Installation
Clone this repository:
git clone https://github.com/wxai-community/n8n-nodes-wxai.git cd n8n-nodes-wxai
Install dependencies and build:
npm install npm run build
Copy the
distfolder to your n8n custom nodes directoryRestart your n8n instance
Credentials
Add your WXAI API credentials in n8n:
- Go to Credentials in your n8n instance
- Click Add Credential and select WXAI API
- Enter your credentials:
- API Key: Your WXAI API key (e.g.,
6263aef89551c6349d49eada0a9e71c1b31b391768285b951a86f86bc62793ca) - Base URL:
https://cs.rhwx-ai.com/api/ai/v1
- API Key: Your WXAI API key (e.g.,
Usage
- Add a WXAI node to your workflow
- Select your WXAI API credentials
- Configure the chat operation:
- Model:
gemini-2.0-flash(default) - Messages: Add your conversation messages with roles:
system: System instructionsuser: User messagesassistant: Assistant responses
- Model:
Example Configuration
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello, how are you?"
}
]
}Features
- ✅ Chat completions with Gemini 2.0 Flash model
- ✅ Configurable temperature and top-p parameters
- ✅ Maximum token limits (up to 8192 tokens)
- ✅ Simplified output option for easier data handling
- ✅ Error handling and validation
- ✅ TypeScript support
Development
# Install dependencies
npm install
# Build the node
npm run build
# Run linting
npm run lint
# Fix linting issues
npm run lintfix
# Format code
npm run formatAPI Testing
A test script is included to verify API connectivity:
node test-api.jsNote: Update the API key in test-api.js with your actual WXAI API key before testing.
Expected Response Format
The WXAI API returns responses in Server-Sent Events (SSE) format. The node automatically handles this format and extracts the JSON data for use in n8n workflows.
Troubleshooting
⚠️ Important: Credential Validation Limitation
Known Issue: The credential test in n8n may show "success" even with invalid API keys due to WXAI API's response format (returns HTTP 200 with error details in the response body).
To properly validate your API key:
# Use the included test script
node test-credential-validation.js
# Or test manually
curl -X POST https://cs.rhwx-ai.com/api/ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-2.0-flash","messages":[{"role":"user","content":"test"}],"max_tokens":1,"stream":false}'Valid response: Contains choices array
Invalid response: Contains {"code": 500, "message": "..."}
API Key Issues
- Ensure your API key is valid and active
- Check that the base URL is correct:
https://cs.rhwx-ai.com/api/ai/v1 - Verify your account has sufficient credits/quota
- Use the test script to validate your API key before use
Model Issues
- The default model is
gemini-2.0-flash - Ensure the model is available in your WXAI account
License
MIT
🤝 Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Development
# Clone the repository
git clone https://github.com/wxai-community/n8n-nodes-wxai.git
cd n8n-nodes-wxai
# Install dependencies
npm install
# Build the project
npm run build
# Run linting
npm run lint
# Test API connectivity
node test-complete.js📄 Changelog
See CHANGELOG.md for a detailed list of changes and versions.
🐛 Issues & Support
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Issues
- Documentation: README.md