npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-megaapi-chatwoot

v0.1.11

Published

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

Downloads

153

Readme

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!