WhatsApp QR icon

WhatsApp QR

Send messages via WhatsApp using QR code authentication

Actions2

Overview

This node enables sending media messages via WhatsApp using a session authenticated through QR code scanning. It is designed to send various types of media files (images, documents, audio, video) along with optional captions to specified phone numbers. This functionality is useful for automating communication workflows that require rich media content delivery, such as customer support, marketing campaigns, or notifications with attachments.

Practical examples:

  • Sending product brochures (PDF documents) to customers.
  • Sharing promotional images or videos with clients.
  • Delivering voice notes or audio clips automatically.

Properties

Name Meaning
Phone Number The recipient's phone number without the "+" sign or country code.
Caption Optional text caption to accompany the media file.
Media File The binary data property name containing the media file to be sent.
Media Type The MIME type of the media being sent. Options: image/jpeg, image/png, application/pdf, audio/mpeg, video/mp4.
Filename Optional filename for the media file.

Output

The output JSON object contains details about the sent media message:

  • messageId: Unique identifier of the sent message.
  • to: The recipient phone number.
  • caption: The caption text sent with the media.
  • mediaType: MIME type of the media sent.
  • filename: The filename used for the media.
  • timestamp: Timestamp when the message was sent.
  • success: Boolean indicating if the message was successfully sent.
  • sessionName: The name of the WhatsApp session used.
  • sessionStatus: Current status of the WhatsApp session.

If the node runs in manual mode or encounters an error, it may return a sample response with a note indicating it is a test output.

The node also supports sending binary media data, which must be provided in the input under the specified binary property.

Dependencies

  • Requires a valid WhatsApp session authenticated via QR code.
  • Needs an API key credential configured in n8n for WhatsApp QR API access.
  • Depends on a Chromium/Chrome browser environment for session management.
  • Uses internal WhatsApp service utilities for sending messages and managing sessions.

Troubleshooting

  • Common issues:

    • Session not created or expired: Ensure a valid WhatsApp session is active before sending media.
    • Browser executable path misconfigured: Verify the path to Chrome/Chromium in credentials.
    • Network connectivity problems can prevent message sending.
    • Insufficient permissions for browser execution in containerized environments.
  • Error messages:

    • "Session not found. Please create a session first." — Create and authenticate a session before sending messages.
    • Errors related to browser or session creation usually indicate environment setup issues; check logs and browser installation.
    • If sending fails, verify the binary data property exists and contains valid media.

Links and References

Discussion