Productivity

n8n Workflow: Follow Up When a WhatsApp Message Fails

When a WhatsApp send fails, nobody notices until the customer does. This n8n workflow catches the failure, verifies the webhook, and schedules a follow-up for the next day.

Daniel Roth6 min read

n8n Workflow: Follow Up When a WhatsApp Message Fails
On this page

A message you sent never arrived, and you find out a week later. This n8n workflow closes that gap: when a Blueticks send fails, n8n receives the event, checks that it is genuine, and schedules a follow-up to the same number for the next day.

Download the workflow JSON. It contains no keys; it reads three environment variables.

What does the workflow do?

Four steps, in order:

  1. A Webhook node receives the event from Blueticks.
  2. A Code node verifies the signature and rejects anything unsigned, tampered with, or older than five minutes.
  3. An If node passes only message.failed. Every other event is ignored.
  4. An HTTP Request node schedules a follow-up to the same number, due 24 hours later.

How do I set it up?

  1. Run n8n with NODE_FUNCTION_ALLOW_BUILTIN=crypto and N8N_BLOCK_ENV_ACCESS_IN_NODE=false, and set these variables: BLUETICKS_API=https://api.blueticks.co, BLUETICKS_API_KEY=<your API key> and BLUETICKS_WEBHOOK_SECRET=<the signing secret from step 3>.
  2. Import the JSON (Workflows, then Import from file) and activate it. Copy the production URL of the "Blueticks webhook" node.
  3. Register the webhook with POST /v1/webhooks and the body {"url": "<that URL>", "events": ["message.failed"]}. The response includes a signingSecret. Save it as BLUETICKS_WEBHOOK_SECRET.
  4. Send a message through the API with POST /v1/messages/{chatId}. If it fails, n8n receives message.failed.
  5. Open n8n Executions. The follow-up appears in your scheduled messages.

The webhook events and registration are covered in the delivery status webhooks guide. The send call itself is explained in the n8n, Make and Zapier guide.

How does the signature check work?

Each delivery carries a timestamp header and a signature header. The Code node rebuilds the signature as v1= plus an HMAC-SHA256 of timestamp.rawBody using your signing secret, and compares it in constant time. A missing header, a bad signature, or a timestamp more than 300 seconds old throws, and the run stops.

The signature covers the exact bytes Blueticks sent, so the Webhook node's Raw Body option has to stay on. If you turn it off, every delivery will fail verification. The Code node also assumes n8n's default in-memory binary mode; with filesystem or S3 binary storage the raw body has to be read differently.

What should I change before using it live?

Common mistake: leaving the placeholder text in the follow-up node. Edit the message in the "Schedule follow-up" node before you activate the workflow.

  • Loop guard. A follow-up that itself fails fires another message.failed, which schedules another follow-up. Add a condition on the follow-up text, or a counter, before you rely on this.
  • Duplicates. Delivery is at least once. If a second follow-up would matter, dedupe on the event id, which stays the same across retries of a delivery.
  • API sends only. Events fire for messages sent through the API, not for messages sent from the dashboard.
  • Timing. The follow-up is due 24 hours after the failure. Change 24*3600*1000 in the HTTP Request node for another delay.

What has been tested?

The signature check accepted a correctly signed payload and rejected a bad signature and a payload older than five minutes. A message.delivered event was ignored. A message.failed event scheduled the follow-up through the real API. The test payloads were signed locally with the same scheme rather than delivered through a public tunnel, and the test account had no connected number, so a naturally failing send was not part of the run.

Share this article

The Dispatch, every week.

One sharp WhatsApp growth tactic in your inbox each week. Joined by 238,000+ founders, marketers and support leads.

Free forever. No spam, unsubscribe in one click.

Also on TikTok: @blueticksagents