megaapi-chatwoot

n8n community node package for integrating MegaAPI (WhatsApp service) with Chatwoot for customer support automation

Package Information

Released: 9/23/2025
Downloads: 49 weeklyĀ /Ā 135 monthly
Latest Version: 0.1.11
Author: Script7Sistemas

Documentation

n8n-nodes-megaapi-chatwoot

npm version
npm downloads
license

An n8n community node package that integrates MegaAPI (WhatsApp service) with Chatwoot for seamless customer support automation. This package provides custom nodes for n8n workflows enabling WhatsApp message handling, media management, and Chatwoot integration.

šŸš€ Features

MegaAPI Node Capabilities

  • šŸ“± Message Operations: Send text messages, media messages (images, videos, documents)
  • āš™ļø Instance Management: Get instance status, QR codes, pairing codes
  • šŸ“ Media Handling: Download media messages, process multimedia content
  • šŸ”§ Configuration: Configure webhooks, manage instance settings
  • šŸ“ Message Processing: Parse incoming messages, handle different message types

Chatwoot Integration

  • šŸ‘„ Contact Synchronization: Sync WhatsApp contacts with Chatwoot
  • šŸ’¬ Conversation Management: Create and manage conversations
  • šŸ”„ Message Routing: Route WhatsApp messages to Chatwoot conversations
  • šŸ”— Webhook Processing: Process Chatwoot webhooks for automation

šŸ“¦ Installation

Option 1: Install via n8n Community Nodes (Recommended)

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

Option 2: Manual Installation

# Install globally
npm install -g n8n-nodes-megaapi-chatwoot

# For Docker installations, add to your Dockerfile:
RUN npm install -g n8n-nodes-megaapi-chatwoot

Option 3: Development Installation

# Clone the repository
git clone https://github.com/madeinlowcode/CommunityNodesChatwootMegaapi.git

# Install dependencies
cd CommunityNodesChatwootMegaapi
npm install

# Build the project
npm run build

# Set environment variable
export N8N_CUSTOM_EXTENSIONS=/path/to/CommunityNodesChatwootMegaapi

# Start n8n
n8n start

šŸ”§ Prerequisites

  • Node.js: Version 20.15 or higher
  • n8n: Latest version recommended
  • MegaAPI Account: Valid API credentials
  • Chatwoot Instance: Access to Chatwoot platform (optional for MegaAPI-only usage)

šŸ› ļø Configuration

1. MegaAPI Credentials

Create a new credential in n8n:

  • Credential Type: MegaAPI
  • Base URL: Your MegaAPI instance URL
  • Token: Your MegaAPI authentication token

2. Chatwoot Credentials (Optional)

Create a new credential in n8n:

  • Credential Type: Chatwoot API
  • URL: Your Chatwoot instance URL
  • Token: Your Chatwoot API access token

3. Combined Credentials (For Integration)

Create a new credential in n8n:

  • Credential Type: Chatwoot MegaAPI
  • MegaAPI URL: Your MegaAPI instance URL
  • MegaAPI Token: Your MegaAPI authentication token
  • Chatwoot URL: Your Chatwoot instance URL
  • Chatwoot Token: Your Chatwoot API access token

šŸ“‹ Available Operations

Message Operations

  • Send Text From Chatwoot: Send text messages using Chatwoot payload
  • Send Text Direct From Chatwoot: Send text messages directly with automatic extraction
  • Send Media From Chatwoot: Send media messages using URL or Chatwoot payload
  • Send Media Direct From Chatwoot: Send media files directly with automatic extraction
  • Send Media URL to Group: Send media messages to WhatsApp groups

Instance Operations

  • Get Status: Check WhatsApp instance connection status
  • Get QR Code: Retrieve QR code for WhatsApp Web authentication
  • Get Pairing Code: Get pairing code for phone number linking
  • Download Media Message: Download media files from WhatsApp messages

Webhook Operations

  • Configure: Set up webhook URLs for receiving WhatsApp events

Parser Operations

  • Parse Message: Parse and normalize WhatsApp message formats

Chatwoot Integration Operations

  • Sync Contacts: Synchronize WhatsApp contacts with Chatwoot
  • Process Webhooks: Handle incoming MegaAPI webhooks and route to Chatwoot
  • Create Conversations: Automatically create Chatwoot conversations

šŸŽÆ Use Cases

Customer Support Automation

WhatsApp Message → MegaAPI → n8n → Chatwoot → Agent
  • Route incoming WhatsApp messages to Chatwoot agents
  • Automatically create conversations from new contacts
  • Sync contact information between platforms
  • Handle media attachments (images, documents, videos)

Marketing & Engagement

Trigger → n8n → MegaAPI → WhatsApp Users
  • Send bulk WhatsApp messages through workflows
  • Automate responses based on message content
  • Manage WhatsApp instance status and connectivity
  • Process incoming webhooks for real-time updates

Development & Testing

HTTP Request → n8n → MegaAPI → WhatsApp → Response Processing
  • Test WhatsApp integrations in n8n environment
  • Debug message flows and webhook processing
  • Validate API responses and error handling

šŸ“– Example Workflows

Basic WhatsApp Message Sending

{
  "name": "Send WhatsApp Message",
  "nodes": [
    {
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger"
    },
    {
      "name": "MegaAPI",
      "type": "n8n-nodes-megaapi-chatwoot.megaApi",
      "parameters": {
        "resource": "message",
        "operation": "sendText",
        "phoneNumber": "+1234567890",
        "message": "Hello from n8n!"
      }
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "MegaAPI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Chatwoot Integration Workflow

{
  "name": "Chatwoot to WhatsApp",
  "nodes": [
    {
      "name": "Chatwoot Webhook",
      "type": "n8n-nodes-base.webhook"
    },
    {
      "name": "MegaAPI",
      "type": "n8n-nodes-megaapi-chatwoot.megaApi",
      "parameters": {
        "resource": "message",
        "operation": "sendTextFromChatwootDirect"
      }
    }
  ]
}

šŸ”’ Security Features

  • šŸ” Credential Encryption: Uses n8n's built-in credential encryption
  • šŸ”‘ Token-based Authentication: Secure API authentication for all services
  • šŸ›”ļø Environment Variable Support: Sensitive data stored securely
  • šŸ“ No Logging of Secrets: Credentials never appear in logs

šŸš€ Development

Building from Source

# Clone repository
git clone https://github.com/madeinlowcode/CommunityNodesChatwootMegaapi.git
cd CommunityNodesChatwootMegaapi

# Install dependencies
npm install

# Build project
npm run build

# Run linting
npm run lint

# Fix linting issues
npm run lintfix

# Format code
npm run format

Project Structure

community/
ā”œā”€ā”€ nodes/                          # Custom n8n nodes
│   ā”œā”€ā”€ MegaAPI/                   # Main MegaAPI WhatsApp integration
│   │   ā”œā”€ā”€ MegaApi.node.ts        # Main node implementation
│   │   ā”œā”€ā”€ operations/           # Operation implementations
│   │   ā”œā”€ā”€ types/               # TypeScript type definitions
│   │   └── utils/               # Utility functions
│   └── Community/               # Community test node
ā”œā”€ā”€ credentials/                   # Authentication credentials
│   ā”œā”€ā”€ MegaApi.credentials.ts            # MegaAPI auth
│   ā”œā”€ā”€ ChatwootApi.credentials.ts        # Chatwoot API auth
│   └── ChatwootMegaApi.credentials.ts    # Combined auth
ā”œā”€ā”€ workflows/                     # Example workflows
└── docs/                         # Documentation

šŸ¤ Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ“ License

This project is licensed under the MIT License - see the LICENSE.md file for details.

šŸ†˜ Support

šŸ”— Links

āš ļø Important Notes

  • This package integrates WhatsApp messaging with customer support platforms
  • Use in compliance with WhatsApp Business API terms of service
  • Ensure compliance with applicable data protection regulations
  • Test thoroughly in development environment before production use

Made with ā¤ļø by Script7Sistemas

Automate your WhatsApp customer support with n8n, MegaAPI, and Chatwoot!

Discussion