Send WhatsApp Messages with n8n in 4 Steps

Hello Fellow,

Goal:

Today’s goal is to create an API for sending (initially) whatsapp messages, but we are not doing it programmatically as usual. Since I am learning n8n basics, the idea is to use it.

For this we are going through 4 steps:

Prepar…


This content originally appeared on DEV Community and was authored by J

Hello Fellow,

Goal:

Today’s goal is to create an API for sending (initially) whatsapp messages, but we are not doing it programmatically as usual. Since I am learning n8n basics, the idea is to use it.

For this we are going through 4 steps:

  1. Preparation: Meta Developer Account and WhatsApp Setup
  2. Run an n8n Instance with Docker
  3. Build the WhatsApp Workflow in n8n
  4. Test Your WhatsApp API

1. Preparation: Meta Developer Account and WhatsApp Setup

  • Go to Meta for Developers and create a Meta Developer Account.
  • Create an App (type: Business) and go to WhatsApp → Getting Started. Getting started with WhatsApp api You’ll get:
    • Temporary Access Token (valid 24h).
    • Phone Number ID.
    • WhatsApp Business Account ID.
    • A test phone number is provided (sender).
    • You must add recipient phone numbers manually for testing.

Remember: you must generate a permanent token later for production (see Docs).

Alternatives:

There are other options for sending messages, especially if you want to delegate some responsibility. You could check:

  • Twilio WhatsApp API
  • 360dialog WhatsApp API

Notes: Creating the account is supposed to be easy… but the process can be annoying. You have to log in with Facebook, I didn’t have my phone number updated, couldn’t remove the old one, couldn’t create an account… it was a mess haha. Hopefully your process is smoother than mine.

2. Run an n8n Instance with Docker

  • Create a docker-compose with this basic config. Feel free to change the AUTH values. Related doc.
services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=admin
    volumes:
      - ./n8n_data:/home/node/.n8n
  • Run the file and test you can access its interface at:
http://localhost:5678

It will ask you to create an owner account if this is your first time in that instance.

  • And create the workflow

3. Build the WhatsApp Workflow in n8n

We need 3 main nodes:

3.1. Webhook node

This node is going to act as your API, so choose:

  • Method: POST
  • Path: /wp/send-message
  • Auth: none
  • Respond: Using Respond to Webhook node

3.2. HTTP Request node

This node is going to call META’s API to send your whatsapp message

  • Method: POST
  • URL:

    https://graph.facebook.com/v19.0/<PHONE_NUMBER_ID>/messages
    
  • Headers:

    • Authorization: Bearer <YOUR_ACCESS_TOKEN>
    • Content-Type: application/json
  • Body:

    { 
    "messaging_product": "whatsapp", 
    "to": "<your number>", 
    "type": "template", 
    "template": { "name": "hello_world", "language": { "code": "en_US" } } 
    }
    

3.3. Respond to Webhook node

  • Returns success response: All incoming items
  • Response Code: 200

4. Test Your WhatsApp API

Along the process you can reach whatsapp API with the CURL they suggest to you that should look something like this:

curl --location 'https://graph.facebook.com/v22.0/123123/messages' \
--header 'Authorization: Bearer EEEEEE' \
--header 'Content-Type: application/json' \
--data '{ "messaging_product": "whatsapp", "to": "000000", "type": "template", "template": { "name": "hello_world", "language": { "code": "en_US" } } }'

And once you have the Webhook Node running you should be able to test it with something like this:

curl --location --request POST 'http://localhost:5678/webhook-test/wp/send-message'

Remember, this is just the simplest example and a first approach. From here, you can keep playing with it by adding templates, values, etc.

And remember: deploying for production requires additional configs for both Meta’s API and the n8n deployment.

You can check the repo with the mentioned code here. Remember to update your Ids, Vars and tokens.

Thanks for reading!


This content originally appeared on DEV Community and was authored by J


Print Share Comment Cite Upload Translate Updates
APA

J | Sciencx (2025-08-20T05:13:27+00:00) Send WhatsApp Messages with n8n in 4 Steps. Retrieved from https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/

MLA
" » Send WhatsApp Messages with n8n in 4 Steps." J | Sciencx - Wednesday August 20, 2025, https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/
HARVARD
J | Sciencx Wednesday August 20, 2025 » Send WhatsApp Messages with n8n in 4 Steps., viewed ,<https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/>
VANCOUVER
J | Sciencx - » Send WhatsApp Messages with n8n in 4 Steps. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/
CHICAGO
" » Send WhatsApp Messages with n8n in 4 Steps." J | Sciencx - Accessed . https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/
IEEE
" » Send WhatsApp Messages with n8n in 4 Steps." J | Sciencx [Online]. Available: https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/. [Accessed: ]
rf:citation
» Send WhatsApp Messages with n8n in 4 Steps | J | Sciencx | https://www.scien.cx/2025/08/20/send-whatsapp-messages-with-n8n-in-4-steps/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.