whatsapp-webjs

n8n community node for WhatsApp Web.js

Package Information

Released: 6 mo ago
Downloads: 4 weekly / 122 monthly
Latest Version: 1.0.1
Author: Manus AI

Documentation

n8n-nodes-whatsapp-webjs

This is an n8n community node for WhatsApp Web.js. It allows you to automate WhatsApp interactions directly from n8n using a real WhatsApp session.

Features

  • Trigger Node: Listen for incoming messages, sent messages (message_create), and session events (QR code, ready, disconnected).
  • Action Node:
    • Send Text: Send simple text messages to any chat.
    • Send Media: Send images, documents, and videos via URL with optional captions.
    • Session Management: Retrieve current session status or the latest QR code for scanning.
  • Smart Session Management: Handles concurrent requests and prevents multiple browser instances for the same session.
  • Persistent Auth: Supports LocalAuth to keep you logged in across n8n restarts.

Installation

Follow the n8n community node installation guide.

In your n8n instance, go to Settings > Community Nodes and install n8n-nodes-whatsapp-webjs.

Credentials

To use this node, you need to create a WhatsApp Web.js API credential in n8n:

  • Session ID: A unique identifier for your session (e.g., my-whatsapp-session).
  • Auth Strategy: Choose local (recommended) to persist your login or none for a temporary session.

Usage Workflow

  1. Initialization: Add the WhatsApp Web.js Trigger node to your workflow.
  2. Authentication:
    • Execute the workflow or use the Session: Get QR Code operation in the action node.
    • The trigger node will emit a qr event with a Base64 Data URL.
    • Use a QR code decoder or display it to scan with your WhatsApp mobile app (Linked Devices > Link a Device).
  3. Ready: Once scanned, the trigger will emit a ready event. Your session is now active.
  4. Automation: You can now use the WhatsApp Web.js action node to send messages or the trigger node to react to incoming messages.

Trigger Output Fields

When a message is received or created, the trigger provides:

  • id: Unique message ID.
  • from: Sender's WhatsApp ID.
  • to: Recipient's WhatsApp ID.
  • body: Message content.
  • type: Message type (chat, image, video, etc.).
  • hasMedia: Boolean indicating if the message contains media.
  • fromMe: Boolean indicating if the message was sent by you.

License

MIT

Discussion