Whatsapp messages


Is there a way to send messages on whatsapp with node-RED?

I would like to make an application example the following way:
I want to make a basic flow, where there is only one DI ( it could be more later but for now it is enough) and when the DI is 1, then a predefined message will be sent on whatsapp.


You can if you have business account for their API.
Else I would recommend Telegram which has free bots available.

??? what?

Yes at least one. Actually I can think of 2 off the top of my head.

Possibly the most reliable but also the most complex is to link to an automation tool on your mobile - there are lots of ways to do that if you use Android (maybe try Tasker to start with - but I don't use Android), not so many with iOS but probably possible using Shortcuts? I say possibly most reliable because Whatsapp is only realistically a mobile app (though see next).

The other method would be to drive something like Phantom from Node-RED and use the web version of Whatsapp. Just note that the web version is NOT a real app. It links to and uses your mobile and wont work unless your mobile app is online and giving permission.

The node-red-contrib-nbrowser uses Phantom to drive a virtual browser.

As bakman2 says though, Telegram is a much better bet for integration and automation if you are in a position to change.

Thanks for sharing your ideas TotallyInformation,

I'm guessing DI here means "Digital Input" where Node Red will wait for this DI status to change from "false" to "true" before triggering a series of events or actions in Node Red.

I digress, I am also trying to figure out a way of generating an automated alert message using Node Red and WhatsApp. I have successfully done it with Telegram, and it works pretty well I must say. But, unfortunately in some work environment, Telegram ports are being blocked from entering a company network.

At the moment, I have sent a request to WhatsApp Tech support to see if their API could be made available for non business WhatsApp accounts. :grin:

Instead of telegram you can consider slack (node-red-contrib-slack). For sure that won't be blocked by many companies as they are using that themselves.

You can create your personal slack workspace for free with the limitation that you can only see the last 10,000 messages which is for many personal use cases more than enough.

I'll look into that suggestion. Thanks Janvda

WhatsApp has always been quite a closed platform so I wouldn't hold my breath on that one.

I've never yet come across an organisation that blocks telegram to be honest. It is one of the easiest platforms to build bots for and well supported in Node-RED of course. It is also pretty secure if that is something you need.

But slack would also work as would others like PushBullet, et al. There are few restrictions on Telegram though.

Unfortunately, my current work place does block telegram. Only WhatsApp is allowed through the local network. Even that, they're considering to block if/when an intranet messaging system is ready for roll out. :sweat_smile:

Hi! Has someone managed to send a WhatsApp message?
I have a similar project to do but I have to connect it to a database to send the messages to whatsapp.
and I can't find much information ...

In the mean time the following whatsapp node is created:

So I suggest to have a look at that node.

Looks like a very useful node.
Has anyone managed to install it (before I flag it with the author) ??

I've just tried to install it from the command line in Node-RED's root directory and via the 'Manage Palette' - both methods failed with numerous errors messages (some of which I don't understand).

It installed for me (from command line in .node-red folder) on Ubuntu (nodejs 14.8.0) but appeared to install two separate versions of puppeteer and two versions of Chromium at 125MB each! The node appears in the palette but I don't use whatsapp so can't test it.

Thanks for the feedback.
I'm installing it on a RPi-3B running Buster.

Just tried on a Pi 4 (which shouldn't make any difference I don't think) running Buster and it is ok. That is with nodejs 10.19.0.
If you post the output when you try to install in a terminal someone might suggest the reason.

[Edit] Actually it isn't fully ok, it gives these warnings, though they look quite significant. Didn't stop it installing though.

npm WARN notsup Unsupported engine for @open-wa/wa-automate@1.9.105: wanted: {"node":">=12.18.3"} (current: {"node":"10.19.0","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: @open-wa/wa-automate@1.9.105

I think I mentioned this previously but that node is NOT a true bot for WhatsApp. It is, as you've discovered, a wrapper around a headless browser.

You should also note that WhatsApp does NOT have a proper web interface, it will only work in a browser in conjunction with an active phone.

It is PANTS!

If you want a bot with a messaging app, use Telegram.


I've already tried with that node, but it won't let me install it. I have the following error:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules\node-red-contrib-whatsappbot" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\abi\AppData\Roaming\npm-cache_logs\2020-09-10T11_47_23_927Z-debug.log

Is it because I'm trying in windows?

somebody could help me!


Please wrap code and log output in back-ticks when posting to make it easier to read.

No, your issue isn't due to Windows. I've checked the GitHub repo and it certainly has a package.json file so something else went wrong. You may wish to remove it, check that the folder has actually gone away (delete it if not), then reinstall.

It is very simple to send WhatsApp messages using this Node-Red node:

Or, you can also use the CallMeBot Web API (here) using the HTTP request Node. (GET metod)

Not quite clear from their privacy policy but it looks like you have to allow their servers access to your accounts?

If so, you need to be sure that you trust them and their security. I didn't see at a casual glance where they are based and therefore what might be accepted as standard security/privacy practices. Though they do at least mention GDPR and California privacy laws.

I certainly wouldn't use them with Signal (one of their services).

Also, I think you may be sharing your phone number with them in some circumstances? (happy to be told otherwise if you've used the service). Given the recent large-scale Facebook and other data dumps that include phone numbers, this is generally accepted as being poor security practice, you are recommended to remove phone numbers from all 3rd party services wherever possible.

I have been using node-red-contrib-whatsapp-cmb for several months and it is working very well.
You don't need to register on callmebot.com and they don't need access to your whatsapp account, you just need to authorize them to send you messages (this is the objective of their API at the end).
And of course, as you call the API with your phone number and the message that you want to send, they have access to both data fields. So I would never send confidential information through to any cloud-based web API.