megaapi

N8N Community Node for MegaAPI WhatsApp automation - Complete WhatsApp integration with messaging, groups, media, and more

Package Information

Downloads: 212 weeklyΒ /Β 17,897 monthly
Latest Version: 1.3.1
Author: JΓΊnior

Documentation

MegaAPI Logo

πŸš€ N8N Community Nodes - MegaAPI

Version
License
N8N

Complete WhatsApp Business automation solution for n8n workflows.

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


🌟 Features

WhatsApp Operations

  • βœ… Text Messages: Send and receive text messages
  • βœ… Media Messages: Send images, videos, documents, and audio files
  • βœ… Location Sharing: Send location coordinates and live location
  • βœ… Link Previews: Send messages with rich link previews
  • βœ… List Messages: Interactive list messages for better UX

Group Management

  • βœ… Group Operations: Create, manage, and configure groups
  • βœ… Participant Management: Add, remove, and manage group members
  • βœ… Group Messaging: Send messages to groups with media support

Instance Management

  • βœ… QR Code Generation: Generate QR codes for WhatsApp Web connection
  • βœ… Pairing Codes: Generate pairing codes for device linking
  • βœ… Status Monitoring: Real-time instance status and health checks
  • βœ… Webhook Configuration: Configure and manage webhooks

Chatwoot Integration

  • βœ… Contact Synchronization: Sync WhatsApp contacts with Chatwoot
  • βœ… Conversation Management: Create and manage customer conversations
  • βœ… Message Routing: Automatic message routing to Chatwoot agents
  • βœ… Webhook Processing: Complete MegaAPI β†’ Chatwoot automation

Advanced Features

  • βœ… Message Forwarding: Forward messages between contacts and groups
  • βœ… Message Quoting: Reply to specific messages with context
  • βœ… Presence Updates: Manage online/offline status and typing indicators
  • βœ… Media Download: Download and process received media files

πŸ“¦ Installation

NPM Installation

npm install n8n-nodes-megaapi

N8N Community Package Installation

  1. Open your n8n instance
  2. Go to Settings β†’ Community Nodes
  3. Enter package name: n8n-nodes-megaapi
  4. Click Install

Manual Installation

# Navigate to your n8n installation directory
cd ~/.n8n/nodes

# Clone or download the package
git clone https://github.com/megaapi/n8n-nodes-megaapi.git

# Install dependencies
npm install

# Build the package
npm run build

πŸ”§ Configuration

MegaAPI Credentials

  1. Create a MegaAPI Credentials in n8n
  2. Add your MegaAPI base URL and authentication token
  3. Test the connection

Chatwoot Integration

  1. Create Chatwoot MegaAPI Credentials for integrated workflows
  2. Configure both MegaAPI and Chatwoot API details
  3. Set up account ID and inbox ID

Required Information

  • MegaAPI Base URL: Your MegaAPI instance URL
  • MegaAPI Token: Authentication token from MegaAPI
  • Chatwoot URL: Your Chatwoot instance URL (for integration)
  • Chatwoot Token: API access token from Chatwoot (for integration)

🎯 Use Cases

Customer Support Automation

  • Route WhatsApp messages to Chatwoot agents automatically
  • Create conversations and contacts from new WhatsApp interactions
  • Handle media attachments in customer support workflows
  • Maintain conversation history and context

Business Communication

  • Send bulk WhatsApp messages for marketing campaigns
  • Automate order confirmations and shipping notifications
  • Handle customer inquiries with intelligent routing
  • Manage group communications for teams

E-commerce Integration

  • Send order confirmations via WhatsApp
  • Provide customer support through messaging
  • Automate product inquiries and responses
  • Handle refunds and support requests

Team Collaboration

  • Create WhatsApp groups for project teams
  • Automate status updates and notifications
  • Share files and media with team members
  • Manage participant access and permissions

πŸ“‹ Available Nodes

Message Operations

  • Send Text Message: Send text messages to contacts
  • Send Media URL: Send media files via URL
  • Send Media Base64: Send media files via base64 encoding
  • Send Location: Share location coordinates
  • Send Link Preview: Send messages with rich previews
  • Send List Message: Send interactive list messages
  • Forward Message: Forward existing messages
  • Quote Message: Reply to messages with context
  • Send Text Direct from Chatwoot: Direct text messaging from Chatwoot data
  • Send Media Direct from Chatwoot: Direct media messaging from Chatwoot data

Group Operations

  • Get Groups: List all available groups
  • Group Details: Get detailed group information
  • Create Group: Create new WhatsApp groups
  • Send Group Message: Send messages to groups
  • Send Group Media: Send media to groups
  • Add Participants: Add members to groups
  • Remove Participants: Remove members from groups
  • Leave Group: Leave from groups

Instance Management

  • Generate QR Code: Get QR code for WhatsApp Web
  • Generate Pairing Code: Get pairing code for devices
  • Instance Status: Check connection status
  • Logout Instance: Disconnect WhatsApp session
  • Restart Instance: Restart WhatsApp connection

Webhook & Media

  • Download Media: Download received media files
  • Check WhatsApp: Verify if number is on WhatsApp
  • Get Webhook Config: Retrieve webhook configuration
  • Configure Webhook: Set up webhook endpoints

Chat Operations

  • Update Presence: Manage online/typing status
  • Delete Message: Delete sent messages
  • Delete Message From Me: Delete messages from sender

Chatwoot Integration

  • Process Webhook to Chatwoot: Complete automation pipeline
  • Send Message to Chatwoot: Send messages to Chatwoot conversations
  • Sync Contact: Synchronize contacts between platforms
  • Create Conversation: Create new Chatwoot conversations

πŸ› οΈ Development

Requirements

  • Node.js 20.15 or higher
  • n8n 1.54.4 or higher
  • TypeScript 5.8.2 or higher

Build Commands

# Install dependencies
npm install

# Build the project
npm run build

# Development mode with watch
npm run dev

# Run linting
npm run lint

# Fix linting issues
npm run lintfix

# Format code
npm run format

# Prepare for publishing
npm run prepublishOnly

Project Structure

n8n-nodes-megaapi/
β”œβ”€β”€ πŸ“ nodes/MegaAPI/          # Main node implementation
β”‚   β”œβ”€β”€ πŸ“„ MegaApi.node.ts     # Node definition and routing
β”‚   β”œβ”€β”€ πŸ“ execute/            # Operation implementations
β”‚   β”‚   β”œβ”€β”€ πŸ“ message/        # Message operations
β”‚   β”‚   β”œβ”€β”€ πŸ“ group/          # Group operations
β”‚   β”‚   β”œβ”€β”€ πŸ“ instance/       # Instance management
β”‚   β”‚   β”œβ”€β”€ πŸ“ webhook/        # Webhook operations
β”‚   β”‚   β”œβ”€β”€ πŸ“ chat/           # Chat operations
β”‚   β”‚   └── πŸ“ chatwoot/       # Chatwoot integration
β”‚   └── πŸ“ properties/         # Node property definitions
β”œβ”€β”€ πŸ“ credentials/            # Authentication configurations
β”œβ”€β”€ πŸ“„ package.json            # Package configuration
β”œβ”€β”€ πŸ“„ tsconfig.json          # TypeScript configuration
└── πŸ“„ gulpfile.js            # Build configuration

πŸ“ License

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


🀝 Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/your-username/n8n-nodes-megaapi.git
  3. Install dependencies: npm install
  4. Make your changes
  5. Run tests: npm run lint && npm run build
  6. Submit a pull request

πŸ“ž Support


πŸŽ‰ Changelog

v1.1.2 - Current

  • βœ… Added syncContact operation for Chatwoot integration
  • βœ… Added createConversation operation for Chatwoot workflows
  • βœ… Improved error handling and validation
  • βœ… Enhanced TypeScript type definitions
  • βœ… Updated build and deployment pipeline

v1.1.0

  • βœ… Added processWebhookToChatwoot for complete automation
  • βœ… Enhanced Chatwoot integration capabilities
  • βœ… Improved webhook processing

v1.0.9

  • βœ… Added sendMessageToChatwoot operation
  • βœ… Enhanced Chatwoot API integration

v1.0.8

  • βœ… Added sendTextFromChatwootDirect operation
  • βœ… Improved direct messaging capabilities

v1.0.7

  • βœ… Added sendMediaFromChatwootDirect operation
  • βœ… Enhanced media handling for Chatwoot integration

Made with ❀️ for the n8n community

Discussion