WA MCP
Development guide

WhatsApp webhooks or an n8n AI workflow?

A WhatsApp n8n AI workflow built around Business Cloud uses a business integration. For a linked personal account, WA MCP documents signed webhook events. Follow a message through the sample receiver before designing your own workflow.

Choose the right source of events

Suppose you want a workflow to record when a message arrives in a personal WhatsApp chat. First identify which system owns the number. The n8n WhatsApp Business Cloud node uses the official Business platform and its credentials. WA MCP uses a phone linked as a companion device. Its documented integration point for another program is a signed HTTP webhook. The project supplies a receiver you can run and inspect locally.

Choose a small first result, such as counting incoming text messages in one test chat. A count does not need a copy of the full conversation. You can confirm that delivery, verification and chat selection work before deciding whether any content should go to a workflow service or a model.

Subscribe to a live event

Add a webhook entry to the configuration used by the bridge. The URL in this example belongs to the local sample receiver. Put the same randomly generated secret in the environment of the receiver and the bridge, then restart the bridge after editing its configuration. The JSON stores the environment variable name.

{
  "webhooks": [{
    "url": "http://127.0.0.1:9000/hook",
    "events": ["message"],
    "secret_env": "WA_MCP_WEBHOOK_SECRET"
  }]
}

From the source checkout, run uv run python examples/webhook_receiver.py --port 9000. Look for the listening address and port. Ask the test contact to send a fresh message while both processes are running. The receiver normally prints a short event record without the message body. Compare the event kind and timestamp with the phone before adding more event types.

A message you send from the phone can also generate an event. Inspect the outgoing flag and chat identifier when counting incoming messages. Older messages that arrive during history sync do not generate these notifications. Edits, deletions and reactions can update the local database without producing message webhooks.

Verify before handing data to a workflow

The request includes the delivery identifier, a timestamp and a signature. Verification uses the original request bytes. Reformatting the JSON in a workflow before checking the signature changes those bytes. The example receiver verifies the signature and the age of the request and remembers accepted delivery identifiers. A request with a missing or incorrect signature should never trigger the downstream action.

Use the receiver as the reference when adapting this to a workflow engine. Check which component can access the raw body and keep the shared secret private. If that component is a small local program, it can pass only the fields your workflow needs after verification. The WA MCP docs describe that HTTP contract. They do not supply an n8n node, an importable workflow or a tested n8n AI configuration.

For the counter example, select the expected chat and use the message identifier for the record. A workflow that merely needs the arrival time and message kind has no reason to store the body, author name or quoted reply. A voice event contains metadata. Downloading and transcribing audio is a separate operation with its own storage and provider choices.

Handle repeated or missed deliveries

The bridge can retry a failed delivery using the same delivery identifier. If a receiver completes the action but loses its response, the next request can describe work it has already done. Track which identifiers have been accepted. A repeated identifier should be acknowledged without increasing the counter again. For a durable counter, keep that decision with the record it protects.

A webhook subscription is a live feed with limited retries. After sustained downtime the bridge can drop an event. For a daily report, use stored messages to check the missing interval. Keep the time and message identifier of the last processed record, and compare overlapping results before adding them. Receiving a fresh event proves the receiver is working now. It says little about a period when it was offline.

Diagnose a quiet receiver

Start with the URL the bridge can reach. A loopback address in a container refers to that container's network environment. Confirm the intended listener, then read the bridge startup log for the configured webhook count. If requests arrive but fail verification, compare the secret available to each process and check their clocks. Changing the variable in a different shell leaves an already running process with its original environment.

Finally, test an ordinary direct text message while the bridge is connected. It has fewer moving parts than a voice note or a missed call. Once the receiver records the expected event exactly once, you have a concrete input against which to test your own workflow.

Questions

Does WA MCP include a WhatsApp n8n AI workflow?

WA MCP documents signed webhooks and a sample Python receiver. A custom n8n workflow needs its own receiving and verification logic. The built-in n8n WhatsApp node uses Business Cloud credentials.

Why is there no event for an older message?

The bridge emits message webhooks for live messages. Use stored history to fill gaps after downtime or to retrieve messages received during history sync.

Read the project webhook reference

n8n WhatsApp Business Cloud node documentation