n8n-nodes-whatsapp-webjs
v1.0.1
Published
n8n community node for WhatsApp Web.js
Maintainers
Readme
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
LocalAuthto 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 ornonefor a temporary session.
Usage Workflow
- Initialization: Add the WhatsApp Web.js Trigger node to your workflow.
- Authentication:
- Execute the workflow or use the Session: Get QR Code operation in the action node.
- The trigger node will emit a
qrevent 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).
- Ready: Once scanned, the trigger will emit a
readyevent. Your session is now active. - 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.
