JSPM

n8n-nodes-wxai

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q72338F
  • License MIT

A user-friendly WXAI node for n8n, designed to enhance your workflow with Gemini 2.0 Flash model. Supports chat completions with configurable parameters.

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

    npm version License: MIT n8n-community-node

    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

    1. Go to Settings > Community Nodes in your n8n instance
    2. Click Install a community node
    3. Enter: n8n-nodes-wxai
    4. Click Install

    For detailed instructions, follow the n8n community nodes installation guide.

    Option 2: Manual Installation

    1. Clone this repository:

      git clone https://github.com/wxai-community/n8n-nodes-wxai.git
      cd n8n-nodes-wxai
    2. Install dependencies and build:

      npm install
      npm run build
    3. Copy the dist folder to your n8n custom nodes directory

    4. Restart your n8n instance

    Credentials

    Add your WXAI API credentials in n8n:

    1. Go to Credentials in your n8n instance
    2. Click Add Credential and select WXAI API
    3. Enter your credentials:
      • API Key: Your WXAI API key (e.g., 6263aef89551c6349d49eada0a9e71c1b31b391768285b951a86f86bc62793ca)
      • Base URL: https://cs.rhwx-ai.com/api/ai/v1

    Usage

    1. Add a WXAI node to your workflow
    2. Select your WXAI API credentials
    3. Configure the chat operation:
      • Model: gemini-2.0-flash (default)
      • Messages: Add your conversation messages with roles:
        • system: System instructions
        • user: User messages
        • assistant: Assistant responses

    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 format

    API Testing

    A test script is included to verify API connectivity:

    node test-api.js

    Note: 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

    📊 Stats

    • Downloads: npm downloads
    • Version: npm version
    • License: License: MIT