n8n-nodes-wasasa
v0.2.0
Published
n8n community node for Wasasa WhatsApp API integration
Maintainers
Readme
n8n-nodes-wasasa
Professional WhatsApp automation for n8n workflows
This is an n8n community node that provides comprehensive WhatsApp integration through the Wasasa API. Automate your WhatsApp communications with powerful workflows, send various message types, manage instances, and build sophisticated chatbot solutions.
n8n is a fair-code licensed workflow automation platform.
📋 Table of Contents
- Features
- Installation
- Credentials
- Operations
- Usage Examples
- API Compatibility
- Development
- Troubleshooting
- Version History
- Contributing
- License
✨ Features
🎯 Complete WhatsApp Automation
- 2 Nodes (Wasasa + Wasasa Trigger)
- 16 Operations across 2 resources (Instance & Message)
- 8 Message Types supported (Text, Image, Video, Document, Audio, Location, Contact, Poll)
- 5 Trigger Events (Message, Group Message, Status, Call, Any)
- Instance Management with full lifecycle control
- Real-time Status monitoring and QR code generation
- Webhook Integration for event-driven workflows
🚀 Production Ready
- Built with TypeScript for type safety
- Declarative routing for clean code
- Comprehensive error handling
- Follows n8n best practices
- Fully tested and documented
💡 Developer Friendly
- Auto-complete for instance selection
- Intuitive field organization
- Clear operation descriptions
- Extensive inline documentation
📦 Installation
Via n8n Community Nodes (Recommended)
- Open your n8n instance
- Go to Settings > Community Nodes
- Click Install
- Enter
n8n-nodes-wasasa - Agree to the risks and click Install
- Restart n8n
Via npm
npm install n8n-nodes-wasasaManual Installation
cd ~/.n8n/nodes
git clone https://github.com/wasasa/n8n-nodes-wasasa.git
cd n8n-nodes-wasasa
npm install
npm run build🔐 Credentials
Wasasa API Credentials
Before using this node, you need to configure your Wasasa API credentials:
- In n8n, go to Credentials > New Credential
- Search for Wasasa API
- Fill in the required fields:
| Field | Description | Example |
|-------|-------------|---------|
| API URL | Base URL of your Wasasa API server | https://api.wasasa.com or http://localhost:8080 |
| API Key | Your Wasasa API authentication key | your-secret-api-key |
- Click Test to verify the connection
- Click Save
Note: The credential test will attempt to fetch your instances list to verify connectivity.
🎛️ Operations
Instance Resource
Manage your WhatsApp instances with full lifecycle control.
📝 Available Operations
| Operation | Description | HTTP Method | Endpoint |
|-----------|-------------|-------------|----------|
| Create | Create a new WhatsApp instance | POST | /instance/create |
| Get | Get information about a specific instance | GET | /instance/:id |
| Get All | List all available instances | GET | /instance/fetchInstances |
| Delete | Permanently delete an instance | DELETE | /instance/delete/:id |
| Get QR Code | Retrieve QR code for connecting | GET | /instance/connect/:id/image |
| Get Status | Check connection status | GET | /instance/connectionState/:id |
| Logout | Disconnect and logout instance | DELETE | /instance/logout/:id |
| Update Settings | Modify instance configuration | PUT | /instance/update/:id |
⚙️ Update Settings Fields
When using Update Settings, you can configure:
- Reject Calls - Automatically reject incoming calls
- Always Online - Keep online status active 24/7
- Read Messages - Mark messages as read automatically
- Webhook URL - Endpoint for receiving events
Message Resource
Send various types of messages to WhatsApp contacts.
📨 Available Operations
| Operation | Description | Required Fields | Optional Fields |
|-----------|-------------|-----------------|-----------------|
| Send Text | Send a text message | number, text | - |
| Send Image | Send an image | number, media (URL) | caption |
| Send Video | Send a video | number, media (URL) | caption |
| Send Document | Send a document/file | number, media (URL) | fileName, caption |
| Send Audio | Send an audio file | number, audio (URL) | - |
| Send Location | Send GPS coordinates | number, latitude, longitude | name, address |
| Send Contact | Send a contact card | number, displayName, vcard | - |
| Send Poll | Send a poll/survey | number, name, options (2-12) | selectCount |
📋 Field Details
Common Fields:
instanceName- WhatsApp instance to use (auto-complete enabled)number- Phone number without + or country code (e.g.,1234567890)
Media Fields:
media/audio- Public URL of the file to sendcaption- Optional text caption for mediafileName- Custom filename for documents
Location Fields:
latitude- GPS latitude coordinate (e.g.,19.4326)longitude- GPS longitude coordinate (e.g.,-99.1332)name- Location name (e.g.,"Mexico City")address- Full address text
Contact Fields:
displayName- Name to displayvcard- vCard format contact data (see example below)
Poll Fields:
name- Poll questionoptions- Array of 2-12 answer optionsselectCount- Number of selections allowed (default: 1)
Wasasa Trigger
Automatically start workflows when WhatsApp events occur.
🔔 Available Events
| Event | Description | Filters Available | |-------|-------------|-------------------| | Message Received | Trigger on new direct messages | Message type, From number | | Group Message Received | Trigger on new group messages | Message type, Group ID | | Status Changed | Trigger when connection status changes | - | | Call Received | Trigger on incoming calls | - | | Any Event | Trigger on any event | - |
🔍 Event Filters
Message Type Filter (for Message/Group Message events):
- Any, Text, Image, Video, Document, Audio, Location, Contact
From Number (for Message events):
- Filter messages from specific phone number
Group ID (for Group Message events):
- Filter messages from specific group
📋 Trigger Examples
Auto-responder:
Wasasa Trigger (Message Received)
↓
IF: message contains "hello"
↓
Wasasa: Send Text
- Text: "Hi! How can I help?"Group Bot:
Wasasa Trigger (Group Message)
- Message Type: Text
- Group ID: [email protected]
↓
IF: message contains "@bot"
↓
Wasasa: Send Text
- Text: "Command received!"Status Monitor:
Wasasa Trigger (Status Changed)
↓
IF: status === "disconnected"
↓
Email: Alert Admin💼 Usage Examples
Example 1: Send a Welcome Message
Trigger: Webhook
↓
Wasasa: Send Text
- Instance: my-bot
- Number: 1234567890
- Text: "Welcome to our service! 👋"Example 2: Send Order Confirmation with Location
Shopify: New Order
↓
Wasasa: Send Text
- Text: "Order confirmed! #{{$json.order_number}}"
↓
Wasasa: Send Location
- Latitude: {{$json.shipping_address.latitude}}
- Longitude: {{$json.shipping_address.longitude}}
- Name: "Delivery Location"Example 3: Daily Customer Survey
Cron: Daily at 9 AM
↓
Google Sheets: Get Customer List
↓
Loop: For Each Customer
↓
Wasasa: Send Poll
- Question: "How satisfied are you with our service?"
- Options: ["Very Satisfied", "Satisfied", "Neutral", "Unsatisfied"]Example 4: Automated Instance Management
Manual Trigger
↓
Wasasa: Create Instance
- Name: "customer-{{$now.format('YYYY-MM-DD')}}"
↓
Wasasa: Get QR Code
↓
Wasasa: Update Settings
- Reject Calls: true
- Webhook URL: "https://my-app.com/webhook"
↓
Email: Send QR to AdminExample 5: Send Contact Card
HTTP Request: Get Contact Info
↓
Wasasa: Send Contact
- Display Name: "John Doe"
- vCard: |
BEGIN:VCARD
VERSION:3.0
FN:John Doe
TEL:+1234567890
EMAIL:[email protected]
ORG:Acme Corp
END:VCARDExample 6: Status Monitoring
Cron: Every 5 minutes
↓
Wasasa: Get All Instances
↓
Loop: For Each Instance
↓
Wasasa: Get Status
↓
IF: Status !== "open"
↓
Slack: Alert Admin
- Message: "Instance {{$json.name}} is disconnected!"🔗 API Compatibility
This node is compatible with Wasasa API servers that implement the following endpoints:
Instance Endpoints
POST /instance/createGET /instance/fetchInstancesGET /instance/:idDELETE /instance/delete/:idPUT /instance/update/:idGET /instance/connect/:id/imageGET /instance/connectionState/:idDELETE /instance/logout/:id
Message Endpoints
POST /instance/:id/message/textPOST /instance/:id/message/imagePOST /instance/:id/message/videoPOST /instance/:id/message/documentPOST /instance/:id/message/audioPOST /instance/:id/message/locationPOST /instance/:id/message/contactPOST /instance/:id/message/poll
🛠️ Development
Prerequisites
- Node.js v20 or higher
- npm v9 or higher
- n8n installed (via
@n8n/node-cli)
Setup
# Clone the repository
git clone https://github.com/wasasa/n8n-nodes-wasasa.git
cd n8n-nodes-wasasa
# Install dependencies
npm install
# Build the project
npm run build
# Start development server
npm run devThe npm run dev command will:
- Build your node with watch mode
- Start n8n with your node loaded
- Open n8n at
http://localhost:5678
Project Structure
n8n-nodes-wasasa/
├── credentials/
│ └── WasasaApi.credentials.ts # API credentials definition
├── nodes/
│ ├── Wasasa/
│ │ ├── Wasasa.node.ts # Main node definition
│ │ ├── wasasa.svg # Node icon
│ │ ├── resources/
│ │ │ ├── instance/
│ │ │ │ └── index.ts # Instance operations
│ │ │ └── message/
│ │ │ └── index.ts # Message operations
│ │ └── listSearch/
│ │ └── getInstances.ts # Auto-complete logic
│ └── WasasaTrigger/
│ ├── WasasaTrigger.node.ts # Trigger node definition
│ └── wasasa.svg # Node icon
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.mdScripts
| Command | Description |
|---------|-------------|
| npm run build | Compile TypeScript to JavaScript |
| npm run build:watch | Build in watch mode |
| npm run dev | Start n8n with node loaded |
| npm run lint | Check code for errors |
| npm run lint:fix | Auto-fix linting issues |
🔧 Troubleshooting
Node doesn't appear in n8n
- Ensure the package is installed:
npm list n8n-nodes-wasasa - Restart n8n completely
- Check n8n logs for errors
- Verify the node is listed in
package.jsonundern8n.nodes
Connection test fails
- Verify your API URL is correct and accessible
- Check that your API key is valid
- Ensure the Wasasa API server is running
- Test the endpoint manually:
curl -H "Authorization: Bearer YOUR_KEY" YOUR_URL/instance/fetchInstances
Instance dropdown is empty
- Ensure you have created at least one instance
- Check that the API key has permission to list instances
- Verify the
getInstanceslist search is working
Messages not sending
- Verify the instance is connected (use Get Status)
- Check the phone number format (no + or spaces)
- Ensure media URLs are publicly accessible
- Check Wasasa API logs for errors
📚 Resources
📝 Version History
0.1.0 (Current)
Initial Release - Full-featured WhatsApp automation
Nodes (2):
- ✅ Wasasa (Main node)
- ✅ Wasasa Trigger (Event-driven workflows)
Instance Resource (8 operations):
- ✅ Create, Get, Get Many, Delete
- ✅ Get QR Code, Get Status, Logout
- ✅ Update Settings
Message Resource (8 operations):
- ✅ Send Text, Image, Video, Document
- ✅ Send Audio, Location, Contact, Poll
Trigger Events (5):
- ✅ Message Received
- ✅ Group Message Received
- ✅ Status Changed
- ✅ Call Received
- ✅ Any Event
Features:
- Auto-complete for instance selection
- Declarative routing for all operations
- Comprehensive field validation
- Professional error handling
- Webhook integration for triggers
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow TypeScript best practices
- Use declarative routing when possible
- Add JSDoc comments for complex logic
- Test all operations thoroughly
- Update README for new features
📄 License
Copyright (c) 2024 Wasasa Team
🙏 Acknowledgments
- Built with n8n - Fair-code workflow automation
- Powered by Wasasa API - WhatsApp integration platform
- Inspired by the n8n community
Made with ❤️ for the n8n community
