Actions10
Overview
This node integrates with the Z-API service to send various types of WhatsApp messages programmatically. It supports sending text, audio, documents, images, stickers, GIFs, videos, PTv (possibly a type of video), location data, and interactive option lists. This node is useful for automating WhatsApp communications in workflows such as customer support, marketing campaigns, notifications, or alerts.
For example, you can use this node to:
- Send a text message notification when a new order is placed.
- Deliver an image or document to a user upon request.
- Share a location or contact details dynamically.
- Present users with interactive option lists to guide their responses.
Properties
Name | Meaning |
---|---|
Instance ID | Your Z-API Instance ID used to identify your WhatsApp instance. |
Instance Token | Your Z-API Instance Token for authenticating API requests (kept secret). |
Client Token | Your Z-API Client Token for additional authentication (kept secret). |
Note: The node also internally uses other parameters depending on the operation, such as phone number, message content, media URLs/base64 data, captions, titles, coordinates, and more, but these are not part of the provided input properties JSON.
Output
The node outputs a JSON array where each element corresponds to the response from the Z-API service for each input item processed. Each JSON object contains the result of the send message operation, typically including status information or message IDs returned by the API.
If an error occurs and "Continue On Fail" is enabled, the output will include an object with an error
property describing the failure for that item.
The node does not output binary data.
Dependencies
- Requires access to the Z-API WhatsApp messaging service.
- Needs three credentials: Instance ID, Instance Token, and Client Token.
- No additional environment variables or external services are required beyond the Z-API credentials.
- Uses an internal helper function (
zapiApiRequest
) to make HTTP requests to the Z-API endpoints.
Troubleshooting
- Unknown Operation Error: If you specify an unsupported operation, the node throws an error indicating the operation is unknown. Verify that the operation name matches one of the supported ones (e.g., send-text, send-option-list, send-audio, etc.).
- Unknown Resource Error: If the resource parameter is incorrect, an error is thrown. Currently, only the "send-message" resource is supported.
- Authentication Failures: Ensure that the Instance ID, Instance Token, and Client Token are correctly set and valid.
- Invalid Media Data: When sending media (audio, image, document, etc.), ensure the URL or base64 string is correct and accessible.
- Rate Limits or API Errors: These errors come from the Z-API service; check your account limits and API usage.
- Use the "Continue On Fail" option to allow the workflow to proceed even if some items fail.
Links and References
- Z-API Official Website — For detailed API documentation and account setup.
- WhatsApp Business API Documentation — For understanding message types and formats.
- n8n Documentation on Creating Custom Nodes — For extending or customizing nodes.