Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

This node enables sending WhatsApp location messages via the Green API service. It is designed to send a geographic location to a specified chat on WhatsApp, optionally including a name and address for the location. This functionality is useful in scenarios where you want to share a precise place with contacts or groups, such as sharing a restaurant location, meeting point, or any other place of interest.

Practical examples:

  • A delivery service sharing the exact drop-off location with customers.
  • Event organizers sending venue locations to participants.
  • Friends sharing their current location during meetups.

Properties

Name Meaning
Mode Operation mode: "Action" (execute WhatsApp actions) or "Listen for Incoming Webhook"
Chat ID Identifier of the chat to send the location to; format: phone@c.us for private, chat@g.us for group
Location Name Optional name of the location (e.g., "Restaurant")
Address Optional address string describing the location
Latitude Latitude coordinate of the location (required)
Longitude Longitude coordinate of the location (required)
Quoted Message ID Optional ID of a message to quote when sending the location

Output

The node outputs a JSON array containing the response from the Green API after attempting to send the location message. The structure typically includes confirmation details about the sent message, such as message ID and status.

Example output JSON snippet:

[
  {
    "sent": true,
    "messageId": "some-message-id",
    "chatId": "972501234567@c.us"
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires an active Green API account with valid credentials: instance ID and API token.
  • The node uses HTTP POST requests to Green API endpoints to perform actions.
  • Proper configuration of these credentials in n8n is necessary for successful operation.

Troubleshooting

  • Common issues:

    • Invalid or missing credentials will cause authentication failures.
    • Incorrect chat ID format may result in message delivery errors.
    • Latitude and longitude must be valid numbers; otherwise, the API call will fail.
    • Network connectivity issues can prevent communication with the Green API.
  • Error messages:

    • "Failed to send location: <error message>" indicates an issue with the API request. Check the provided coordinates, chat ID, and credentials.
    • Errors related to reading files or attachments do not apply here since this operation does not handle files.
    • If the node is configured in "trigger" mode but used as an action, it throws an error instructing to use it correctly.
  • Resolution tips:

    • Verify that the instance ID and API token are correct and active.
    • Ensure the chat ID matches the expected format for private or group chats.
    • Double-check latitude and longitude values for correctness.
    • Use the optional quoted message ID only if quoting an existing message.

Links and References

Discussion