WhatsApp workflows in n8n
Set n8n up once for WhatSync: the API key, the webhook, the signature check and the safe send workflow. Every workflow in these guides builds on these steps.
What you need
- A WhatSync account on the Max plan or higher. API keys and webhooks are part of Max. The WhatsApp Business API needs the Business plan.
- Your WhatsApp linked in the dashboard, a WhatsApp Business API number connected, or both.
- n8n Cloud or self-hosted n8n. The workflows here were tested on n8n 2.49.
- For workflows that start from a message: n8n must be reachable from the internet over HTTPS. n8n Cloud is. For self-hosted n8n, set its public address:
WEBHOOK_URL=https://n8n.your-domain.com/1. Create the API key credential
- In WhatSync open Developers and create a key. Read and Send are ticked by default; they cover listing groups and posting to them. Tick Manage groups only for workflows that change groups (members, admins, names, invite links). Tick Manage webhooks only if you use the WhatSync Trigger node.
- Copy the key. It starts with
wsk_live_and is shown once. - In n8n open Credentials, add a Header Auth credential and name it
WhatSync API key:
Credential type Header Auth
Name Authorization
Value Bearer wsk_live_YOUR_KEYEvery HTTP Request node in the workflows uses this credential, so the key is stored once, encrypted by n8n, and never sits in a workflow's text.
2. Import a workflow
- Download JSON
n8n: safe send (sub-workflow)
Import and publish this first. Every workflow that sends uses it.
- Download JSON
n8n: alert when a workflow fails
Set it as the Error workflow of every WhatSync workflow.
- Download the JSON file from the workflow's guide.
- In n8n create a new workflow, open the menu with the three dots and choose Import from file.
- Open each node with a warning sign and pick your credential.
- Read the yellow note on the canvas. It lists the few things to fill in for that workflow.
- Workflows that send a message call WhatSync: safe send. Import that one first and publish it. In the node that calls it, pick it from the list.
n8n 2 refuses to publish a workflow while a sub-workflow it calls is unpublished: "Please publish all referenced sub-workflows first." Publish safe send, then the workflow that uses it.
3. Connect the webhook
A workflow that starts from a WhatsApp message begins with a Webhook node.
- Publish the workflow (older n8n versions call this Activate).
- Open the Webhook node and copy its Production URL. The Test URL only works while you are watching the canvas.
- In WhatSync open Developers, add a webhook with that URL and tick the events the workflow's guide names.
- Copy the signing secret. It starts with
whsec_. - Paste it into the Verify signature node, in place of
whsec_PASTE_YOUR_SIGNING_SECRET, and save.
The same with the API, if you prefer:
curl -X POST https://whatsync.app/api/v1/webhooks \
-H "Authorization: Bearer $WHATSYNC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://YOUR-N8N/webhook/whatsync-bookings","event_types":["message.received"],"description":"n8n bookings"}'{
"id": "we_05cb8647-23eb-4e4a-adcf-fc7b710e64d1",
"secret": "whsec_...",
"api_version": "2026-10-01",
"header_names": []
}A received message arrives like this. Inside the workflow, after Verify signature, this object is $json:
{
"id": "evt_01M8EVG31XZ749690AGRB3MS2S",
"type": "message.received",
"created_at": "2026-11-27T15:55:30.749Z",
"api_version": "2026-10-01",
"account_id": "conn_example",
"data": {
"message": {
"id": "3A5F2C2545BA70614345",
"stored_message_id": "conn_example_3A5F2C2545BA70614345",
"conversation_id": "15550000001@s.whatsapp.net",
"channel": "qr",
"chat_type": "direct",
"group": null,
"from": { "phone": "15550000001", "name": "Ravi" },
"from_me": false,
"type": "text",
"text": "Hi, table for 4 tomorrow at 8pm?",
"quoted_message_id": null,
"has_attachment": false,
"attachment": null,
"timestamp": "2026-11-27T15:55:30.745Z"
}
},
"whatsapp_number": { "id": "conn_example", "phone": "+15550000002", "name": "Sample account" }
}Only chats you chose under What's saved send events. All event types and fields are in Webhooks.
4. The signature check
Anyone who learns your webhook URL could post a fake message to it. WhatSync signs every event, and the Verify signature node refuses anything that is not signed with your secret, is older than five minutes, or was changed on the way.
- It needs Raw Body switched on in the Webhook node's options, because the signature covers the exact bytes. The imported workflows have it on.
- It computes HMAC-SHA256 in plain JavaScript. n8n's Code node cannot load Node's
cryptomodule unless the server allows it, and this way the same workflow runs on n8n Cloud and on a default self-hosted install. - A wrong secret makes every run fail at this node with "the WhatSync signature does not match". Send a test event after pasting the secret to see a green run.
- The secret sits in the node's code. Remove it before you share or export the workflow.
A simpler check, with the secret in a credential
If you do not want the secret in a node, let WhatSync send a header of your own with every event, and let n8n require it. Set the Webhook node's Authentication to Header Auth with a credential named X-Workflow-Secret, then add the same header to the WhatSync webhook:
curl -X PATCH https://whatsync.app/api/v1/webhooks/we_YOUR_WEBHOOK_ID \
-H "Authorization: Bearer $WHATSYNC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"headers":{"X-Workflow-Secret":"a-long-random-value"}}'WhatSync stores the value encrypted and never shows it again. You can also add headers in Developers when you add or edit a webhook. Keep the signature check as well if you can: it also catches a changed body and an old, replayed event.
5. Skip repeated events
WhatSync delivers every event at least once, so the same event can arrive twice: after a slow answer, or when someone presses resend in the delivery log. The Skip repeats node (n8n's Remove Duplicates, set to remember across runs) keeps the last 10,000 event ids and drops one it has seen.
The idempotency key is the second guard. Even if a repeat got through, safe send would use the same event id as its key, and WhatSync would not send the reply twice.
Most workflows also start with a filter. This is the one for a new text from a customer:
{{ $json.type }} is equal to message.received
{{ $json.data.message.chat_type }} is equal to direct
{{ $json.data.message.from_me }} is false
{{ $json.data.message.type }} is equal to text
{{ $json.data.message.text }} is not emptyWhatSync's own test event has the type webhook.test, so it passes the signature check and stops here.
HTTP Request nodes or the WhatSync node
Every workflow comes in a version that uses only n8n's built-in nodes (Webhook, HTTP Request, Code, If). It works everywhere, including n8n Cloud.
On self-hosted n8n you can also install the community node n8n-nodes-whatsync under Settings > Community Nodes. n8n Cloud cannot install it until n8n has verified the package. Its WhatSync Trigger replaces the Webhook and Verify signature nodes:
- it adds the webhook in WhatSync when you publish the workflow, and removes it when you unpublish (the key needs Manage webhooks)
- it checks every signature with the secret it received, and answers 401 to anything else
- it skips an event id it has seen recently
The versions that use it need its own WhatSync API credential (paste the same key) for the trigger, and still use the Header Auth credential for the HTTP Request nodes.
6. Test before you rely on it
- In Developers, send a test event to the webhook. In n8n's Executions you should see a successful run that stops at the first filter.
- Write to your number from another phone. One run, one reply.
- Open that run and click through the nodes. Each one shows what came in and what went out.
- Switch sending off in the WhatSync dashboard (Settings, Sending), write again, and check that your alert arrives. Switch it back on.
Then read the go-live checklist.
When something does not work
| What you see | Cause | Fix |
|---|---|---|
| No run appears in n8n | The workflow is not published, the webhook points at the Test URL, or the chat is not saved. | Publish, use the Production URL, and check What's saved in the dashboard. |
| "the WhatSync signature does not match" | A wrong signing secret, or Raw Body is off. | Paste the secret again. Switch Raw Body on in the Webhook node's options. |
| "Paste your WhatSync signing secret" | The placeholder is still in the node. | Paste the whsec_ secret into Verify signature. |
401 invalid_api_key | The credential value is not Bearer followed by the key, or the key was revoked. | Fix the Header Auth credential. |
403 plan_required | The account is below Max. | API keys need the Max plan. |
403 insufficient_permission | The key lacks a permission, such as Manage groups for changing a group. | Edit the key in Developers. |
| "Please publish all referenced sub-workflows first" | Safe send is not published. | Publish it, then publish the workflow. |
| The webhook shows failures in Developers | n8n was unreachable or answered slowly. | last_failure says why. Failed events can be sent again for seven days. |