Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Overview
This node integrates with Green API to send and manage WhatsApp messages and related entities such as groups, chats, and contacts. Specifically for the Message - Upload File operation, it uploads a file from the user's local system or binary input to the Green API cloud storage. This is useful when you want to store media files in the cloud before sending them via WhatsApp or managing them through the API.
Common scenarios include:
- Uploading images, documents, or other media files to Green API's cloud storage for later use.
- Preparing files for sending in subsequent message operations.
- Automating media management workflows involving WhatsApp messaging.
Example: You have a file on your computer that you want to upload to Green API so it can be sent as a WhatsApp message attachment later.
Properties
| Name | Meaning |
|---|---|
| Mode | Selects the node mode: "Action" to execute WhatsApp actions or "Listen for Incoming Webhook" to trigger workflows on webhooks. For uploading files, "Action" mode is used. |
| Resource | The type of entity to operate on; here it should be "Message". |
| Operation | The action to perform on the resource; here "Upload File" uploads a file to cloud storage. |
| File Path | The full path to the file on your local system to upload (e.g., C:/path/to/file.jpg). This is required. |
Note: The "Mode", "Resource", and "Operation" properties are part of the general node configuration, while "File Path" is specific to the Upload File operation under the Message resource.
Output
The node outputs a JSON array where each item corresponds to the response from the Green API after attempting to upload the file. The exact structure depends on the API response but typically includes metadata about the uploaded file such as its ID, URL, or status.
No binary data is output by this operation since it only uploads files to the cloud and returns metadata.
Dependencies
- Requires an active Green API account with valid credentials (an instance ID and API token).
- The node uses HTTP POST requests to Green API endpoints.
- Access to the local filesystem is needed to read the file specified by the "File Path".
- Node environment must allow reading files from the provided path.
- No additional external libraries beyond standard Node.js modules (
fs,path) and n8n helpers are required.
Troubleshooting
- Failed to read file: If the file path is incorrect or inaccessible, the node will throw an error indicating failure to read the file. Ensure the path is correct and accessible by the n8n process.
- API request failures: Errors returned from the Green API (e.g., authentication errors, invalid parameters) will be surfaced with details. Verify your credentials and parameter correctness.
- Using the node in trigger mode: Attempting to run this operation when the node is configured as a webhook trigger will cause an error. Make sure the node mode is set to "Action" for this operation.
- Binary data handling: If you provide binary data instead of a file path, ensure the binary property named "data" exists and contains valid base64-encoded content with a filename.
Links and References
- Green API Documentation – Official API docs for understanding available endpoints and parameters.
- WhatsApp Business API Concepts – Background on WhatsApp messaging concepts relevant to this integration.
- n8n Documentation – General guidance on using n8n nodes and workflows.
This summary focuses exclusively on the Message - Upload File operation within the Green API node, describing its purpose, inputs, outputs, dependencies, and common issues based on static code analysis.