Setting up n8n and WhatsApp integration#
The GREEN-API platform has its own app on the n8n service. We currently recommend using a local installation of n8n.
Integration setup procedure:
- Installing nodejs
- Installing ngrok
- Creating an instance in GREEN-API
- Installing the GREEN-API community node
- Examples of using the GREEN-API application
1. Installing nodejs#
- Download and install Node.js LTS
- Verify successful installation by typing
node -vin the command line - Install n8n by typing
npm install n8n -gin the command line - Run n8n by typing
n8nin the command line - The console will be accessible at
https://localhost:5678
2. Installing ngrok#
For the webhook server to work, it must be accessible from the outside. To do this, install ngrok or an equivalent.
- Download and install ngrok
- Run ngrok – in the command line, type
ngrok http 5678 - The network server address will be obtained:
- You can create a .env file with the parameter WEBHOOK_URL={received address}
- You can run
n8nwith the commandset WEBHOOK_URL={received address}&& n8n start
3. Creating an instance in GREEN-API#
To use the GREEN-API application, you need to obtain a registration token and instance ID in console. For testing, we recommend using the free developer plan.
- Log in or register for an account with GREEN-API
-
Create an instance on the free "Developer" plan. To do this, in console, click the
Create instancebutton and select a plan


-
Authorize the instance. To do this:
-
You can scan the QR code on the instance setup page.
In the WhatsApp or WhatsApp Business mobile app, sign in to your linked devices and scan the QR code you receive.

-
Or request a six-digit authorization code to link by phone number. In the WhatsApp or WhatsApp Business mobile app, go to linked devices and tap 'Link by phone number'.

After successful authorization, the instance should receive the 'Authorized' status. You can check the instance status using the method
GetStateInstance -
-
Copy the
idInstanceandapiTokenInstancevalues for further use with n8n
4. Installing the GREEN-API community node#
Go to the n8n page at https://localhost:5678.
-
Click on the three dots

-
Select
Settings -
Click on the menu item
Community nodes
-
Install
@green-api/n8n-nodes-whatsapp-greenapi -
Select the items as shown in the screenshot and click the 'Install' button

Examples of using the GREEN-API application#
How to Create a WhatsApp Echo Bot Using the Green API in n8n