Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Overview
This node integrates with Green API to send and manage WhatsApp messages and groups, as well as listen for incoming WhatsApp events via webhooks. It supports two main modes:
Action mode: Execute various WhatsApp-related operations such as sending text messages, files, contacts, locations, polls; managing groups (create, add/remove participants, update group info); retrieving chat history and contacts; editing or deleting messages; forwarding messages; and uploading files.
Trigger mode: Listen for incoming WhatsApp webhook events from Green API and trigger workflows based on customizable filters like chat type, sender, message content, message type, instance ID, and webhook event type.
Practical examples
- Automatically send WhatsApp notifications or alerts to users by configuring the node in action mode to send messages or files.
- Manage WhatsApp groups programmatically, e.g., create groups and add participants dynamically.
- Trigger workflows when specific types of WhatsApp messages arrive, filtered by sender or chat type, enabling automated responses or logging.
- Retrieve chat histories or contact lists for analysis or integration with other systems.
Properties
| Name | Meaning |
|---|---|
| Mode | Select between "Action" (execute WhatsApp actions) or "Listen for Incoming Webhook" (trigger workflows on incoming Green API webhooks). |
| Webhook Filters | Collection of filters applied when in trigger mode to selectively process incoming webhook events: |
| - Chat ID Filter | Comma-separated list of specific chat IDs to accept (empty means all chats allowed). |
| - Chat Type Filter | Filter by chat type: All Chats, Group Chats Only, or Private Chats Only. |
| - Filter Logic | Logic to combine multiple filters: "And" (all must match) or "Or" (any can match). |
| - Instance ID Filter | Filter by specific Green API instance ID (empty means all instances allowed). |
| - Message Content Contains | Filter messages containing specified text (case insensitive). |
| - Message Type Filter | Filter by message types such as audio, contact, document, extended text, image, location, poll, quoted, sticker, text, video (empty means all types allowed). |
| - Sender Filter | Filter by specific sender ID (empty means all senders allowed). |
| - Webhook Type Filter | Filter by webhook event types: Delivery Receipt, Incoming Messages, Message Status, Outgoing Messages (empty means all types allowed). |
Output
In action mode, the node outputs an array of JSON objects representing the response from Green API for each executed operation. The structure depends on the specific API call but generally includes status and details about the performed action (e.g., message ID, group info).
In trigger mode, the node outputs the raw JSON payload received from the Green API webhook if it passes the configured filters. If no filters match, it outputs empty data to prevent workflow triggering.
The node does not output binary data directly but supports sending files either by URL or upload, where file data is handled internally during the request.
Dependencies
- Requires a valid API key credential for Green API with
instanceIdandapiTokenInstance. - Uses HTTP requests to Green API endpoints for all operations.
- For file upload operations, reads local files from the filesystem or accepts binary input data.
- Node expects proper configuration of webhook URLs in Green API to receive incoming events.
Troubleshooting
Common issues:
- Misconfigured credentials or invalid API tokens will cause authentication failures.
- Incorrect chat IDs or group IDs may result in errors from the API.
- File path errors when uploading files if the specified file does not exist or is inaccessible.
- Using the node configured as an action while expecting webhook triggers will throw an error.
Error messages:
- Errors include detailed messages with the failed operation and data sent, helping identify incorrect parameters.
- File read errors specify inability to access the file path.
- Network or API errors are surfaced with the original message from Green API.
Resolutions:
- Verify API credentials and permissions.
- Double-check chat/group IDs and ensure they follow the required format.
- Confirm file paths and permissions for file upload operations.
- Use the node in the correct mode according to your use case (trigger vs action).
Links and References
- Green API Documentation — Official API docs for WhatsApp messaging and webhook setup.
- WhatsApp Business API Concepts — Background on WhatsApp messaging features.
- n8n Documentation on Creating Custom Nodes for further customization guidance.