Skip to content

Blog · WhatsApp and channels

WhatsApp Cloud API with n8n: connect, receive messages and send templates

Connect n8n to the WhatsApp Cloud API: credentials, the WhatsApp Trigger, the silent subscription error and templates. And with the Meteor IA API.

Equipo editorial de Meteor Published 8 min read

How do I connect n8n to the WhatsApp Cloud API?

n8n has two nodes: WhatsApp Trigger, which receives messages and uses your Meta app’s App ID and App Secret, and WhatsApp Business Cloud, which sends texts, files and templates with an access token and your WhatsApp Business account ID. The Meta app has to be in Live mode. When you publish the workflow, n8n registers the webhook URL on your app, but it does not subscribe the app to your WhatsApp Business account: if no messages arrive and n8n shows no errors, a POST to subscribed_apps is missing. Meteor IA has no n8n node of its own: with Meteor you use the HTTP Request node against its API and a Webhook node for its signed events.

This guide connects n8n to Meta’s official WhatsApp Cloud API: the credentials, how to receive messages with the WhatsApp Trigger (and the error that gives no warning), and how to send text and templates. Then, the same with the Meteor IA API, which has no n8n node of its own and is used with the HTTP Request node. At the end there are two workflows to import.

1. Before you start, on Meta’s side

According to n8n’s credentials guide, you need:

  1. A Meta developer account.
  2. A Meta business portfolio.
  3. A Meta app with WhatsApp: in the Apps dashboard, Create app, and in Add products to your app you choose Set up on WhatsApp. In App settings → Basic you fill in the privacy policy URL and the terms of service URL, and switch App Mode to Live.

About the token, Meta says: the one API Setup generates is temporary, expires quickly and is not suitable for development. For something that will keep running, create a system user in the business settings and generate its token with the business_management, whatsapp_business_messaging and whatsapp_business_management permissions.

2. The two n8n credentials

n8n credentialUsed byFieldsWhere they come from
WhatsApp APIThe WhatsApp Business Cloud node (send)Access Token and Business Account IDYour app’s WhatsApp → API Setup (or the system user token)
WhatsApp OAuth APIThe WhatsApp Trigger node (receive)Client ID and Client SecretThe App ID and App Secret from App settings → Basic

3. Receive messages with the WhatsApp Trigger

The WhatsApp Trigger listens to the Meta webhook fields you choose: Messages (what people send you and the status of what you send), Message Template Status Update, Account Update, Phone Number Quality Update and others. What each event carries is explained in the WhatsApp Cloud API webhook guide.

Three things from n8n’s documentation that save an afternoon:

  1. One URL per app. WhatsApp registers a single webhook per Meta app. n8n has a test URL and a production URL, and switching between them overwrites the registered one: only one of the two receives events. To test, n8n suggests unpublishing the workflow, testing with the test URL and publishing it again; while it is unpublished it receives no production traffic.
  2. Publishing does not subscribe the app to your account. When you publish, n8n registers the URL on your app, but it does not subscribe the app to your WhatsApp Business account. Without that subscription, the workflow does not start and n8n shows no failed execution. And the test you send from Meta’s dashboard can succeed anyway, so it does not rule the problem out.
  3. How to check and fix it. With a token that has whatsapp_business_management:
# Is it subscribed? Look for your app ID in data[].whatsapp_business_api_data.id
curl -X GET 'https://graph.facebook.com/<version>/<business-account-id>/subscribed_apps' \
  -H 'Authorization: Bearer <token>'

# If it is not there, subscribe it (no body; answers {"success": true})
curl -X POST 'https://graph.facebook.com/<version>/<business-account-id>/subscribed_apps' \
  -H 'Authorization: Bearer <token>'

n8n warns you not to send a DELETE to subscribed_apps to clear it: Meta stops sending that account’s webhooks.

4. Send text and templates

The WhatsApp Business Cloud node has three message operations: Send, Send and Wait for Response and Send Template. For files, Upload, Download and Delete.

  • Send sends a message inside the customer service window. According to Meta, that window lasts 24 hours from the person’s last message; once it closes, only approved templates go through.
  • Send Template is how you message first. You choose the sending number (Sender Phone Number (or ID)), the recipient (Recipient’s Phone Number, with the country code), the template from a list n8n loads from your account, and the values of its variables in Components.
  • Send and Wait for Response sends and keeps the workflow waiting for an answer: an approval, a free-form text or a form. n8n also suggests it as a human review step before an AI agent runs a tool.

If you need something the node does not do, n8n says to use the HTTP Request node with the same credential, choosing Predefined Credential Type.

5. The same with Meteor IA from n8n

Meteor IA has no n8n node of its own. What it does have is a public API, and from n8n you use it with the HTTP Request node and the line connected once from the Meteor dashboard (Channels → WhatsApp). The Meta app, its tokens and its webhook stay out of your workflow.

The credential

In the HTTP Request node choose Authentication → Generic Credential Type → Bearer Auth and paste your Meteor IA key. Create it under Settings → Developers → Create API key, in the live environment: a met_test_ key does not send WhatsApp. The API base is https://api.met.meteor.com.co/api/v1, and every response carries what you asked for inside data. The scopes depend on what you do:

ToScope
Create the contactcontacts:write
Send a text or a templatechannels:send
See the channel and its templateschannels:read
Subscribe your webhookwebhooks:manage
Receive incoming messagesconversations:read

Send a text

Two HTTP Request nodes in a row:

  1. POST /contacts with the body {"phone": "+573001234567", "name": "Ana"}. If a contact with that phone number already exists, it returns it unchanged (if that identity already has another phone number, it answers 409). The id is in {{ $json.data.id }}.
  2. POST /contacts/{{ $json.data.id }}/messages with {"content": "Hi, Ana"}.

If the person has not written in the last 24 hours, the API answers 409 with service_window_closed and sends nothing. And a send with an API key counts as automated: if that contact’s autopilot is off, paused or the chat went to a person, it answers 409 with autopilot_silenced, so it does not write over your team.

Send a template

  1. Your WhatsApp channel id comes from GET /workspaces/{workspaceId}/channels.
  2. GET /channels/{channelId}/templates gives you the name, language and components of each approved template.
  3. POST /channels/{channelId}/whatsapp/send-template with:
{
  "contact_id": 12345,
  "template_name": "recordatorio_pago",
  "language": "es_CO",
  "components": [
    { "type": "body", "parameters": [{ "type": "text", "text": "Ana" }] }
  ]
}

With ?dry_run=true at the end of the URL, Meteor validates the template and returns the resolved message without sending it: that is how you test the workflow without messaging anyone. A real send returns the wa_message_id and goes through the same autopilot rule as a text; the dry run does not evaluate it, so a green dry_run does not rule out a 409 autopilot_silenced when you send.

Receive messages in n8n

  1. Add a Webhook node with the POST method, the Raw Body option on and the Immediately response. With Raw Body, the body arrives as is in the data binary property, which is what you need to verify the signature.
  2. Subscribe its production URL in Meteor with an HTTP Request to POST /webhook-endpoints: {"url": "<Webhook production URL>", "enabled_events": ["contact.message.received"]}. The response carries the secret (whsec_…) only once: store it.
  3. Verify the X-Met-Signature signature in a Code node. On n8n Cloud the crypto module is available; if you self-host n8n, you have to enable Code node modules. The secret stays written in the node: do not share or export that workflow with the secret pasted in.
const crypto = require('crypto');

const secret = 'whsec_…'; // the one POST /webhook-endpoints returned
const header = $input.first().json.headers['x-met-signature'] ?? '';
const raw = (await this.helpers.getBinaryDataBuffer(0, 'data')).toString('utf8');

const parts = header.split(',').map((p) => p.trim().split('='));
const t = Number(parts.find(([k]) => k === 't')?.[1]);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) throw new Error('Meteor IA signature missing or expired');

const expected = Buffer.from(
  crypto.createHmac('sha256', secret).update(`${t}.${raw}`).digest('hex'),
);
const valid = parts
  .filter(([k]) => k === 'v1')
  .map(([, v]) => Buffer.from(v ?? ''))
  .some((v) => v.length === expected.length && crypto.timingSafeEqual(v, expected));
if (!valid) throw new Error('Invalid Meteor IA signature');

return [{ json: JSON.parse(raw) }];

The event is in the Code node’s output, with type, id and, in data, the message’s contact_id, content and attachments. Meteor expects a 2xx within 15 seconds and retries if it does not get one: with the Immediately response, the Webhook answers before the rest of the workflow runs. The signature and retry details are in the WhatsApp Cloud API webhook guide.

Two workflows to import

Save the file to your computer and, in n8n, import it from the workflow menu with Import from File; you can also copy the JSON and paste it onto the canvas. Once open, pick your Bearer Auth credential in each HTTP Request and replace the sample values (TU_CHANNEL_ID, the contact, the template and the secret).

What you have to run on each path

Cloud API with the n8n nodesMeteor IA API from n8n
Connecting the numberYour Meta app in Live mode, two credentials and the account subscriptionOnce, from the Meteor dashboard
ReceivingWhatsApp Trigger, one URL per appWebhook node with the X-Met-Signature signature
SendingWhatsApp Business Cloud nodeHTTP Request to the Meteor API
Contacts and conversationYou store themThey stay in Meteor’s CRM and inbox
Answering with AIYou build it in n8nA Met, with autopilot on
What you payThe messages Meta chargesThe Meteor IA plan, the Energy the AI uses and the messages Meta charges

If what you want is an AI agent answering on WhatsApp, continue with the AI agent on WhatsApp with n8n. If you write your own server instead of using n8n, the same path is in the tutorials with Node.js and with Python.

The limits

What this article does NOT answer

We would rather say it here than leave you hunting for something that is not there.

Keep going

What this article mentions, in detail

The integrations, the Mets and the automations named above, each with its own page.

Where it comes from

Sources

Everything this article claims that we did not measure ourselves, with its origin.

Frequently asked

Questions on this topic

It is almost always the subscription. Publishing the workflow registers the URL on your Meta app, but it does not subscribe the app to your WhatsApp Business account, and n8n shows no failed execution. According to n8n, the test you send from Meta’s dashboard can succeed even when the subscription is missing. Check it with a GET to your account’s /subscribed_apps and, if your app is not there, send the POST.

Not to receive the same thing: WhatsApp registers a single webhook URL per app. That is why, if you switch between the test URL and the production URL, the last one you registered is the only one that receives events.

No. According to Meta, free-form text only goes through within 24 hours of the person’s last message. To message first, use the Send Template operation with an approved template.

No. From n8n you use the Meteor IA API with the HTTP Request node, with a Bearer Auth credential that holds your key, and you receive its events with the Webhook node.

Because a send with an API key counts as automated and respects the contact’s autopilot: if autopilot is off, paused or the chat went to a person, nothing is sent. It is how the API avoids writing over your team.

Keep reading

Other articles on the same thing

Want to see it running on your operation?

See the API and the SDK, or message us and we will help with your first key.