Skip to content

πŸš€ REST API server for WhatsApp automation via whatsapp-web.js, made to integrate with n8n workflows.

Notifications You must be signed in to change notification settings

nicolasdelrosario/whatsapp-n8n-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WhatsApp N8N Server – Automate WhatsApp Messaging via REST API + N8N

A Node.js server that integrates with WhatsApp Web via whatsapp-web.js, enabling automated message sending through a REST API. Built with Clean Architecture principles.

✨ Features

  • WhatsApp Web integration using whatsapp-web.js
  • REST API endpoint for sending messages
  • QR code authentication
  • Session persistence with LocalAuth
  • Clean Architecture

βš™οΈ Prerequisites

  • Node.js v18 or higher
  • A WhatsApp account
  • A smartphone with WhatsApp installed
  • Package manager: Bun (recommended)

Note

This project uses Bun for local development and scripting, but is fully compatible with any Node.js-compatible package manager.

πŸš€ Installation

Clone the repository:

git clone https://github.com/nicolasdelrosario/whatsapp-n8n-server.git
cd whatsapp-n8n-server

Install dependencies

bun install

πŸ§ͺ Usage

Start development mode

bun dev
  • On first run, a QR code will appear in the terminal.
  • Scan it using WhatsApp on your phone to authenticate.
  • Once authenticated, your session will be saved.

Server will run on:

http://localhost:3000

πŸ“‘ API

POST /api/v1/send-message

Sends a WhatsApp message to a phone number.

πŸ”Έ Request Body (JSON)

{
    "number": "51123456789",
    "content": "Hello from WhatsApp N8N Server"
}

number: Phone number in international format (without +)

content: The message to send

πŸ”Έ Response

{
    "message": "OK"
}

πŸ§‘β€πŸ’» Author

Developed by Nicolas Del Rosario

πŸ“œ License

MIT

About

πŸš€ REST API server for WhatsApp automation via whatsapp-web.js, made to integrate with n8n workflows.

Topics

Resources

Stars

Watchers

Forks