Learn Build Community Opportunities Hosted n8n Blog About Careers Contact Log in

Home / Blog / Fix

Fix

Automate food delivery order notifications with n8n

A tested n8n workflow to ingest delivery webhooks, dedupe orders, map fields, send WhatsApp/Telegram/SMS with retries and log to Google Sheets.

To automate food delivery order notifications reliably, use an n8n workflow that starts with a secure Webhook node, deduplicates by order id against Google Sheets, maps provider fields to your notification payload, and sends messages via WhatsApp, Telegram or SMS with retry/backoff and error logging.

Why this problem happens

Delivery platforms send many similar webhooks, sometimes retrying the same payload, or sending different JSON shapes per provider. If your workflow lacks dedupe logic, consistent mapping and persistent logging, you will double notify merchants, miss orders or lose the signal during a transient provider error.

Automate food delivery order notifications: ready workflow outline

Below is a step by step blueprint you can import into n8n by creating nodes as named. Each numbered step corresponds to a node or small node group in n8n.

  1. Webhook node: Create a Webhook node in n8n, set HTTP Method to POST, Response Mode to Immediate with a 200 and short JSON acknowledgement. Use a unique path like /order-notify. Enable Basic Auth if available from your delivery partner settings.
  2. Parse and normalize: Add a Code node named Normalize. Accept the raw JSON and map common fields to a canonical shape: order_id, customer_phone, items, total, address, status, received_at. Example mapping rules appear in the sample code below.
  3. Deduplicate using Google Sheets: Use a Google Sheets node called Check Order Exists to read recent rows or the order id column. Then use a Code node to check if order_id exists. If found, route to an Exit branch that appends a "duplicate" log row and stops.
  4. Log new order and prepare notifications: Append the canonical order to Google Sheets with a Google Sheets node named Append Order Log. Include fields order_id, status, attempts (start at 0), last_error, received_at.
  5. Send channel notifications: Branch to three nodes: WhatsApp, Telegram, SMS. For WhatsApp, use a HTTP Request node to call your WhatsApp provider API (Twilio, 360dialog, etc). For Telegram use the Telegram node, operation Send Message. For SMS use Twilio node or HTTP Request if you use another gateway.
  6. Retry and backoff: After each channel node, add an If node to check response success. On failure, increment attempts in a Code node, write back to the Google Sheet, use a Wait node with exponential backoff e.g. 30 seconds, then loop to the channel node up to a max of 5 attempts. Use the Error Trigger node to catch unexpected node errors and log them.
  7. Final status update: When notifications succeed or max attempts reached, update the Google Sheet row with final status, attempts, and last_error if any.

Step by step mapping examples and Code node snippets

Use a Code node called Normalize to adapt provider webhooks. Example snippet to produce canonical output:

const body = $json;
// Common patterns seen across providers
const orderId = body.order_id || (body.data && body.data.order && body.data.order.id) || body.id;
const phone = body.customer_phone || (body.customer && body.customer.phone);
const total = body.total || (body.order && body.order.total_amount);
const items = body.items || (body.order && body.order.items) || [];
const address = body.delivery_address || (body.order && body.order.address) || '';
const receivedAt = body.timestamp || new Date().toISOString();
return [{ json: { order_id: orderId, customer_phone: phone, total, items, address, received_at: receivedAt, raw: body } }];

Common JSON paths to try when mapping: $json["order_id"], $json["data"]["order"]["id"], $json["id"]. Change the Code node when you register a new provider.

Tool specific notes for n8n, Make.com and Zapier

n8n: Use the Webhook, Code, HTTP Request, Telegram, Wait, If, and Google Sheets nodes. Use the Error Trigger node to capture unhandled failures and append them to the sheet. Implement retry loops with Wait plus a counter in workflow data.

Make.com: scenarios use modules instead of nodes, but the same pattern applies. The Make forum thread on scheduling and Telegram shows how to link modules to send messages, see this community example for Telegram integration: Telegram and Google Calendar example on Make.

Zapier: Zaps can receive webhooks with the Webhooks trigger, but persistent dedupe and backoff loops are harder. Use a Google Sheets lookup to dedupe and third party services like Delay by Zapier for retry waits.

How to stop duplicate notifications and missed orders

  • Always ack webhooks immediately, respond 200 fast then process in background. This stops provider retries for timeouts.
  • Use a canonical order id and persist it. Google Sheets works for low volume, use a database for high volume.
  • Log every attempt, including response code and body. Append these to Google Sheets rows: timestamp, attempts, provider_response.
  • Set idempotent notification logic, for example include a delivered flag in the sheet and only send if delivered is false.

When to get help

Get external help when you have spiky volume, strict SLA or you must integrate a WhatsApp Business API provider with complicated authentication. The n8n forum thread about automating food delivery is a good community start for specifics, see this example: n8n community thread on food delivery notifications.

Troubleshooting quick checks

  • If the Webhook node shows no data, confirm the correct webhook URL and that your delivery partner is sending POST requests and not signing them in an unexpected way.
  • If your HTTP Request to WhatsApp fails, inspect headers in n8n execution, especially Authorization and Content-Type.
  • If duplicates persist, check exact whitespace or casing differences in order_id; normalise with .trim().toLowerCase() in the Code node.

For WhatsApp specific call patterns and examples, see our guide on sending WhatsApp from n8n or Make.com: How to Send WhatsApp Notification from Make.com or n8n.

Implementing this workflow gives you a resilient pipeline for delivery webhooks that reduces duplicates, maps fields for consistent messages, retries on transient failures and keeps a searchable log. Start small with one provider, test thoroughly, then add new providers by updating the Normalize Code node.

Learn to build automations like this with Automate Naija.

Frequently asked questions

How do I stop double notifications when a delivery platform retries their webhook?

Persist the order id as soon as you receive the webhook, for example by checking and appending to a Google Sheets row. Use a canonical id in a Code node and only proceed to notifications if the id is not already logged. Also respond 200 immediately from the Webhook node so the sender knows you received the payload.

Can I send WhatsApp notifications from n8n without a paid provider?

WhatsApp Business requires a provider such as Twilio, Meta API partners or an approved BSP to send messages. In n8n use the HTTP Request node to call your provider API or a prebuilt Twilio node if available. Test with sandbox or trial credentials from your chosen provider first.

How should I implement retries and backoff in n8n?

After a failed notification response, increment a retry counter in workflow data, write it to your log row, use a Wait node with increasing delay (30s, 2m, 8m) and loop back to the channel node. Stop after a max attempts value and mark the order row with the final error.

Is Google Sheets a good logging option for high volume delivery apps?

Google Sheets is fine for proof of concept and low volume. It is simple to set up for dedupe and logging. For higher volume or strict SLAs switch to a database like PostgreSQL, Redis for fast dedupe, or cloud storage with indexed rows to avoid rate limits.


Build it with us. The community is free and the build track teaches this kind of automation week by week: see pricing or join the community.

Keep reading

A new fix lands here every morning, picked from what builders are stuck on right now.