WAHA API icon

WAHA API

Complete WhatsApp automation with WAHA API - Multi-engine support

Overview

This node integrates with the WAHA API to manage WhatsApp sessions and perform various session-related operations. Specifically, the "Get Sessions" operation under the "Session" resource lists all active WhatsApp sessions managed by the WAHA API.

Common scenarios where this node is beneficial include:

  • Monitoring multiple WhatsApp sessions in an automation workflow.
  • Retrieving session details for auditing or management purposes.
  • Integrating WhatsApp session data into other systems or dashboards.

For example, a user can automate the retrieval of all active WhatsApp sessions to check their status or to trigger further actions based on session availability.

Properties

Name Meaning
Additional Fields Optional extra parameters including:
- Filename: Custom filename for media files
- Mimetype: MIME type of the file
- Link Description: Description for link preview
- Link Title: Title for link preview
- Contact Name: Name for contact vCard
- Contact Number: Phone number for contact vCard
- Reaction: Emoji reaction to send (default 👍)
- Limit: Limit number of results (default 100)
- Download Media: Whether to download media files in messages (boolean, default false)

Note: For the "Get Sessions" operation specifically, none of these additional fields are required or used.

Output

The output JSON contains the list of WhatsApp sessions retrieved from the WAHA API endpoint /api/sessions. The structure typically includes session details such as session names, statuses, and other metadata provided by the API.

Example output snippet (conceptual):

[
  {
    "sessionName": "session1",
    "status": "connected",
    "createdAt": "2024-01-01T12:00:00Z",
    ...
  },
  {
    "sessionName": "session2",
    "status": "disconnected",
    "createdAt": "2024-01-02T08:30:00Z",
    ...
  }
]

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for the WAHA API to authenticate requests.
  • Optionally uses another API key credential for a validation service ("N8N Tools API") to verify subscription and API key validity before making WAHA API calls.
  • The node expects the WAHA API base URL and API key to be configured in credentials.
  • No additional environment variables are required.

Troubleshooting

  • Invalid Subscription or API Key: If the validation request to the external validation API fails with HTTP 401 or 403, the node throws an error indicating invalid subscription or API key. Verify that the API keys are correct and have proper permissions.
  • Unknown Operation or Resource: If an unsupported operation or resource is selected, the node throws an error specifying the unknown operation/resource. Ensure the correct resource and operation are chosen.
  • Network or API Errors: Any HTTP errors from the WAHA API will be surfaced. Check network connectivity and API endpoint availability.
  • Continue On Fail: If enabled, the node will continue processing subsequent items even if one item fails, returning error details in the output JSON.

Links and References

Discussion