Package Information
Available Nodes
Documentation
n8n-nodes-whatsapp-api
Custom n8n nodes for integrating with WhatsApp API Manager. Automate your WhatsApp workflows with powerful nodes for sending messages, managing sessions, labels, and webhooks.
š¦ Installation
Option 1: Install from npm (Recommended)
npm install n8n-nodes-whatsapp-api
Option 2: Manual Installation
- Clone this repository
- Navigate to the project directory
- Build the project:
npm install npm run build - Link to your n8n installation:
npm link cd ~/.n8n npm link n8n-nodes-whatsapp-api
Option 3: Docker
If you're using n8n with Docker, mount the built nodes:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
-v /path/to/n8n-nodes-whatsapp-api/dist:/home/node/.n8n/custom \
n8nio/n8n
š Credentials Setup
- In n8n, go to Credentials ā New
- Search for "WhatsApp API"
- Configure:
- API URL: Your WhatsApp API base URL (e.g.,
http://localhost:3001) - API Token: Your JWT authentication token
- API URL: Your WhatsApp API base URL (e.g.,
- Click Test to verify the connection
- Save the credentials
š Available Nodes
1. WhatsApp API Trigger
Receive WhatsApp messages and events via webhook.
Features:
- Real-time message reception
- Event filtering (received, sent, delivered, read, QR updates, etc.)
- Automatic webhook registration
Example Use Cases:
- Auto-respond to customer messages
- Log all incoming messages
- Trigger workflows based on keywords
2. WhatsApp API - Send Message
Send various types of messages through WhatsApp.
Message Types:
- Text: Simple text messages with formatting
- Image: Send images with optional captions
- Video: Send video files
- Audio: Send audio/voice messages
- Document: Send PDF and other documents
- Buttons: Interactive messages with up to 3 buttons
- Bulk: Send to multiple recipients
Features:
- Media support (URL or base64)
- Label assignment
- Bulk sending with delay control
- Rich text formatting
Example Use Cases:
- Send promotional messages
- Share documents with customers
- Create interactive menus with buttons
- Bulk notifications
3. WhatsApp API - Session
Manage WhatsApp sessions (connections).
Operations:
- Create Session
- Get Session Details
- List All Sessions
- Start Session
- Stop Session
- Delete Session
Example Use Cases:
- Initialize new WhatsApp connections
- Monitor session status
- Manage multiple WhatsApp accounts
- Auto-restart disconnected sessions
4. WhatsApp API - Labels
Manage WhatsApp Business labels for organization.
Operations:
- Create Label (20 colors available)
- Get All Labels
- Delete Label
- Apply Label to Chat
- Remove Label from Chat
- Get Chat Labels
Example Use Cases:
- Organize conversations by category
- Tag important customers
- Filter chats by label
- Automated labeling based on message content
5. WhatsApp API - Webhook
Manage webhook configurations.
Operations:
- Register Webhook
- List Webhooks
- Toggle Webhook (enable/disable)
- Delete Webhook
- Get Webhook Logs
- Test Webhook
Example Use Cases:
- Configure multiple webhook endpoints
- Monitor webhook delivery
- Debug webhook issues
- Manage event subscriptions
š Example Workflows
Auto-Reply Bot
WhatsApp Trigger ā IF (contains keyword) ā Send Message
- Add WhatsApp API Trigger node
- Add IF node to check message content
- Add WhatsApp API - Send Message node to reply
Customer Support Labeling
WhatsApp Trigger ā Analyze Message ā Apply Label
- Receive message via WhatsApp API Trigger
- Process/analyze content (AI, keywords, etc.)
- Use WhatsApp API - Labels to categorize
Bulk Campaign
Spreadsheet ā Loop ā Send Message (with delay)
- Load contacts from spreadsheet
- Use WhatsApp API - Send Message in bulk mode
- Add delay to avoid rate limits
Session Monitor
Schedule Trigger ā List Sessions ā IF (disconnected) ā Start Session
- Run every 5 minutes with Schedule Trigger
- Get all sessions with WhatsApp API - Session
- Check status and restart if needed
š ļø Development
Prerequisites
- Node.js 18+
- npm or yarn
- n8n installed (globally or locally)
Setup
# Clone the repository
git clone https://github.com/joaopauloqueiroz/whatsapp-api.git
cd whatsapp-api/n8n-nodes-whatsapp-api
# Install dependencies
npm install
# Build in watch mode
npm run dev
Testing Locally
# Build the project
npm run build
# Link to n8n
npm link
# In your n8n directory
npm link n8n-nodes-whatsapp-api
# Start n8n
n8n start
Your custom nodes will appear in n8n under the "Custom" category.
Project Structure
n8n-nodes-whatsapp-api/
āāā credentials/
ā āāā WhatsAppApi.credentials.ts # Authentication
āāā nodes/
ā āāā WhatsAppApiTrigger/
ā ā āāā WhatsAppApiTrigger.node.ts
ā āāā WhatsAppApiSendMessage/
ā ā āāā WhatsAppApiSendMessage.node.ts
ā āāā WhatsAppApiSession/
ā ā āāā WhatsAppApiSession.node.ts
ā āāā WhatsAppApiLabels/
ā ā āāā WhatsAppApiLabels.node.ts
ā āāā WhatsAppApiWebhook/
ā āāā WhatsAppApiWebhook.node.ts
āāā package.json
āāā tsconfig.json
āāā gulpfile.js
š API Reference
This package integrates with WhatsApp API Manager.
Required API Endpoints:
POST /api/sessions- Create sessionGET /api/sessions- List sessionsPOST /api/messages/:sessionId/send- Send messageGET /api/labels/:sessionId/labels- Get labelsPOST /api/webhooks- Register webhook
For full API documentation, see the main project README.
š Troubleshooting
Nodes not appearing in n8n
- Ensure the package is properly linked:
npm link n8n-nodes-whatsapp-api - Restart n8n
- Check n8n logs for errors
Authentication errors
- Verify your API URL is correct (include
http://orhttps://) - Check that your JWT token is valid
- Test credentials using the "Test" button
Webhook not receiving events
- Ensure your n8n instance is publicly accessible
- Check webhook URL in the WhatsApp API dashboard
- Verify event types are correctly configured
Build errors
# Clean and rebuild
rm -rf dist node_modules
npm install
npm run build
š License
MIT License - see LICENSE file for details.
š¤ Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
š Links
š¬ Support
- Open an issue on GitHub
- Check existing issues for solutions
- Refer to the main project documentation
ā Credits
Created by ArchCode
Built with:
- n8n - Workflow automation
- WhatsApp Web.js - WhatsApp client
Made with ā¤ļø for the n8n community